Implicit Request Contexts
2 min read
2 min read
2 min read
2 min read
2 min read
2 min read
2 min read
2 min read
2 min read
Using Implicit Request Contexts
In addition to explicit and per-proxy request contexts, you can also establish an implicit context on a communicator. This implicit context is sent with all invocations made via proxies created by that communicator, provided that you do not supply an explicit context with the call.
Scope of the Implicit Context
You establish the implicit context on a communicator by setting a property, Ice.ImplicitContext. This property controls whether a communicator has an implicit context and, if so, at what scope the context applies. The property can be set to the following values:
NoneWith this setting (or ifIce.ImplicitContextis not set at all), the communicator has no implicit context, andgetImplicitContexton the communicator returns null.SharedThe communicator has a single implicit context that is shared by all threads. Access to the context via itsImplicitContextclass is interlocked, so different threads can concurrently manipulate the context without risking data corruption or reading stale values.PerThreadThe communicator maintains a separate implicit context for each thread. This allows you to propagate contexts that depend on the sending thread (for example, to send per-thread transaction IDs).