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 various versions of \u003ccode\u003eClientContext\u003c/code\u003e, ranging from version 2.63.1 (latest) down to version 2.7.1.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eClientContext\u003c/code\u003e is designed for generated code and encapsulates client state, including executor, credentials, and transport channel, and is not typically used by most end-users.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eClientContext\u003c/code\u003e includes methods for retrieving resources such as \u003ccode\u003eBackgroundResources\u003c/code\u003e, \u003ccode\u003eClock\u003c/code\u003e, \u003ccode\u003eCredentials\u003c/code\u003e, \u003ccode\u003eExecutor\u003c/code\u003e, \u003ccode\u003eHeaders\u003c/code\u003e, \u003ccode\u003eTracerFactory\u003c/code\u003e, and \u003ccode\u003eTransportChannel\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eClientContext\u003c/code\u003e offers static methods \u003ccode\u003ecreate\u003c/code\u003e that create a new \u003ccode\u003eClientContext\u003c/code\u003e based on \u003ccode\u003eClientSettings\u003c/code\u003e or \u003ccode\u003eStubSettings\u003c/code\u003e and a \u003ccode\u003enewBuilder()\u003c/code\u003e to start creating a new \u003ccode\u003eClientContext\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eClientContext\u003c/code\u003e class inherits members from \u003ccode\u003ejava.lang.Object\u003c/code\u003e, such as \u003ccode\u003eclone()\u003c/code\u003e, \u003ccode\u003eequals()\u003c/code\u003e, \u003ccode\u003ehashCode()\u003c/code\u003e, and others, extending its functionality.\u003c/p\u003e\n"]]],[],null,[]]