Encapsulates client state, including executor, credentials, and transport channel.
UnlikeClientSettingswhich allows users to configure the client,ClientContextis intended to be used in generated code. Most users will not need to use it.
The objects that need to be closed in order to clean up the resources created in the process of
creating this ClientContext. This will include the closeables from the transport context.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThe webpage provides documentation for \u003ccode\u003eClientContext\u003c/code\u003e, a class in the Google API Client Libraries for Java, which is used to encapsulate client state such as executor, credentials, and transport channel.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eClientContext\u003c/code\u003e class is primarily used within generated code and is not intended for direct use by most users, unlike \u003ccode\u003eClientSettings\u003c/code\u003e which is used for client configuration.\u003c/p\u003e\n"],["\u003cp\u003eThe page offers access to multiple versions of the \u003ccode\u003eClientContext\u003c/code\u003e documentation, ranging from the latest version 2.63.1 down to version 2.7.1, where each version is accessed through a unique URL.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eClientContext\u003c/code\u003e class includes static methods like \u003ccode\u003ecreate\u003c/code\u003e and \u003ccode\u003enewBuilder\u003c/code\u003e, and it has methods such as \u003ccode\u003egetBackgroundResources\u003c/code\u003e, \u003ccode\u003egetCredentials\u003c/code\u003e, \u003ccode\u003egetExecutor\u003c/code\u003e, and \u003ccode\u003egetTransportChannel\u003c/code\u003e to manage various aspects of the client environment.\u003c/p\u003e\n"],["\u003cp\u003eThe class inherits members from \u003ccode\u003ejava.lang.Object\u003c/code\u003e, and provides access to static methods that can be used to instantiate and modify \u003ccode\u003eClientContext\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,[]]