Encapsulates client state, including executor, credentials, and transport channel.
Unlike ClientSettings which allows users to configure the client,
ClientContext is 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-04-17 UTC."],[[["The latest version of the `ClientContext` class is 2.63.1, but this document also provides information on earlier versions going back to version 2.7.1."],["`ClientContext` is an abstract class that encapsulates client state, including executor, credentials, and transport channel, primarily intended for internal use in generated code."],["Users can instantiate the executor, credentials, and transport context through static methods such as `create(ClientSettings settings)` or `create(StubSettings settings)`, which may throw an `IOException`."],["`ClientContext` provides methods to retrieve various components of the client's state, such as `getBackgroundResources()`, `getClock()`, `getCredentials()`, `getExecutor()`, `getHeaders()`, and `getTransportChannel()`."],["The `newBuilder()` method, as well as `toBuilder()`, allows users to create a `ClientContext.Builder` instance to configure and construct a new `ClientContext`."]]],[]]