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 \u003ccode\u003eClientContext\u003c/code\u003e class encapsulates client state, including the executor, credentials, and transport channel, intended for use in generated code rather than direct user interaction.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of the documentation is for version 2.63.1, and the current page is referencing version 2.20.1 of \u003ccode\u003ecom.google.api.gax.rpc.ClientContext\u003c/code\u003e, with an extensive list of previous versions available for review.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eClientContext\u003c/code\u003e contains methods to retrieve various properties such as background resources, clock, credentials, call context, endpoint, executor, headers, quota project ID, stream watchdog, and transport channel.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eClientContext\u003c/code\u003e provides static methods to create instances based on \u003ccode\u003eClientSettings\u003c/code\u003e or \u003ccode\u003eStubSettings\u003c/code\u003e and offers a \u003ccode\u003enewBuilder\u003c/code\u003e method for creating a \u003ccode\u003eClientContext.Builder\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eClientContext\u003c/code\u003e can generate traces for operations using the defined ApiTracerFactory.\u003c/p\u003e\n"]]],[],null,[]]