On this page:

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.

Access to this implicit context is provided by the Communicator interface:

{zcode:slice}
module Ice {
    local interface Communicator
    {
        ImplicitContext getImplicitContext();

        // ...
    };
};
{zcode}

getImplicitContext returns the implicit context object. If a communicator has no implicit context, the operation returns null.

You can manipulate the contents of the implicit context via the ImplicitContext interface:

{zcode:slice}
local interface ImplicitContext
{
    Context getContext();
    void    setContext(Context newContext);

    string get(string key);
    string put(string key, string value);
    string remove(string key);
    bool   containsKey(string key);
};
{zcode}

The getContext operation returns the currently-set context dictionary. The setContext operation replaces the currently-set context in its entirety.

The remaining operations allow you to manipulate specific entries:

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:

See Also