Package pl.morgwai.base.guice.scopes
Class ServerSideContext
- java.lang.Object
-
- pl.morgwai.base.guice.scopes.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 usingProvider
s bound in the associatedContextScope
.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 Summary
Constructors Constructor Description ServerSideContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
removeScopedObject(Key<?> key)
Removes the object given bykey
from this context.
-
-
-
Method Detail
-
removeScopedObject
public void removeScopedObject(Key<?> key)
Removes the object given bykey
from this context. This is sometimes useful to force the associatedContextScope
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.
-
-