Class ServerSideContext

  • Direct Known Subclasses:
    TrackableContext

    public abstract class ServerSideContext
    extends Object
    Stores objects scoped to some server-side processing/call, such as an RPC, a servlet request processing, a session combining several calls etc. Stored objects can be obtained using Providers bound in the associated ContextScope.

    Overriding classes usually add properties and methods specific to a given type of call, like given call's arguments etc.

    If multiple threads run within the same context, the attributes that they access must be thread-safe or properly synchronized.

    • Constructor Detail

      • ServerSideContext

        public ServerSideContext()
    • Method Detail

      • removeScopedObject

        public void removeScopedObject​(Key<?> key)
        Removes the object given by key from this context. This is sometimes useful to force the associated ContextScope to obtain a new instance from the unscoped provider if the current one is not usable anymore (for example a timed-out connection, etc).

        Note: If multiple threads run within the same context, care must be taken to prevent some of them from retaining the old stale instance.