Package com.zeroc.Ice

Interface ImplicitContext


public interface ImplicitContext
Represents the request context associated with a communicator. When you make a remote invocation without an explicit request context parameter, Ice uses the per-proxy request context (if any) combined with the ImplicitContext associated with your communicator.

The property Ice.ImplicitContext controls if your communicator has an associated implicit context, and when it does, whether this implicit context is per-thread or shared by all threads:

None (default)
No implicit context at all.
PerThread
The implementation maintains a context per thread.
Shared
The implementation maintains a single context shared by all threads.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks if the specified key has an associated value in the request context.
    get(String key)
    Gets the value associated with the specified key in the request context.
    Gets a copy of the request context maintained by this object.
    put(String key, String value)
    Creates or updates a key/value entry in the request context.
    Removes the entry for the specified key in the request context.
    void
    setContext(Map<String,String> newContext)
    Sets the request context.
  • Method Details

    • getContext

      Map<String,String> getContext()
      Gets a copy of the request context maintained by this object.
      Returns:
      a copy of the request context
    • setContext

      void setContext(Map<String,String> newContext)
      Sets the request context.
      Parameters:
      newContext - the new request context
    • containsKey

      boolean containsKey(String key)
      Checks if the specified key has an associated value in the request context.
      Parameters:
      key - the key
      Returns:
      true if the key has an associated value, false otherwise
    • get

      String get(String key)
      Gets the value associated with the specified key in the request context.
      Parameters:
      key - the key
      Returns:
      the value associated with the key, or the empty string if no value is associated with the key. containsKey(java.lang.String) allows you to distinguish between an empty-string value and no value at all.
    • put

      String put(String key, String value)
      Creates or updates a key/value entry in the request context.
      Parameters:
      key - the key
      value - the value
      Returns:
      the previous value associated with the key, if any
    • remove

      String remove(String key)
      Removes the entry for the specified key in the request context.
      Parameters:
      key - the key
      Returns:
      the value associated with the key, if any