Package pl.morgwai.base.guice.scopes
Class ContextScope<Ctx extends ServerSideContext<Ctx>>
- java.lang.Object
-
- pl.morgwai.base.guice.scopes.ContextScope<Ctx>
-
- All Implemented Interfaces:
com.google.inject.Scope
public class ContextScope<Ctx extends ServerSideContext<Ctx>> extends Object implements com.google.inject.Scope
Scopes objects to a context of a call obtained from the associatedContextTracker
.
Scopes are thread-safe as long as context attributes that are accessed by several threads are not accessed manually usingServerSideContext
's{get,set,remove}Attribute(...)
methods.
-
-
Constructor Summary
Constructors Constructor Description ContextScope(String name, ContextTracker<Ctx> tracker)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getName()
<T> com.google.inject.Provider<T>
scope(com.google.inject.Key<T> key, com.google.inject.Provider<T> unscoped)
String
toString()
-
-
-
Constructor Detail
-
ContextScope
public ContextScope(String name, ContextTracker<Ctx> tracker)
-
-
Method Detail
-
getName
public String getName()
-
scope
public <T> com.google.inject.Provider<T> scope(com.google.inject.Key<T> key, com.google.inject.Provider<T> unscoped)
- Specified by:
scope
in interfacecom.google.inject.Scope
-
-