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 latest version available is 2.63.1, with a comprehensive list of previous versions accessible for reference, down to version 2.7.1.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eClientContext\u003c/code\u003e is an abstract class in the \u003ccode\u003ecom.google.api.gax.rpc\u003c/code\u003e package, designed to encapsulate client state like the executor, credentials, and transport channel.\u003c/p\u003e\n"],["\u003cp\u003eUnlike \u003ccode\u003eClientSettings\u003c/code\u003e, \u003ccode\u003eClientContext\u003c/code\u003e is primarily intended for internal use in generated code and is not directly utilized by most users.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eClientContext\u003c/code\u003e offers static methods like \u003ccode\u003ecreate()\u003c/code\u003e to instantiate client settings and \u003ccode\u003enewBuilder()\u003c/code\u003e to construct a \u003ccode\u003eClientContext.Builder\u003c/code\u003e, and contains methods like \u003ccode\u003egetExecutor()\u003c/code\u003e, \u003ccode\u003egetCredentials()\u003c/code\u003e, \u003ccode\u003egetTransportChannel()\u003c/code\u003e, and \u003ccode\u003egetHeaders()\u003c/code\u003e that return information about the current context.\u003c/p\u003e\n"],["\u003cp\u003eThe class inherits from \u003ccode\u003ejava.lang.Object\u003c/code\u003e, inheriting methods such as \u003ccode\u003eequals()\u003c/code\u003e, \u003ccode\u003ehashCode()\u003c/code\u003e, and \u003ccode\u003etoString()\u003c/code\u003e, among others.\u003c/p\u003e\n"]]],[],null,[]]