|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.directwebremoting.guice.AbstractContextScope<C,R>
public abstract class AbstractContextScope<C,R>
Partial implementation of ContextScope
. Concrete implementations
must pass the context identifier type to the super constructor and define
get()
to return the current context identifier (and to return null
or throw an exception if there is no current context). They must also implement
the ContextRegistry
interface.
Method Summary | ||
---|---|---|
void |
close(C context,
ContextCloseHandler<?>... closeHandlers)
Closes the given context. |
|
void |
closeAll(ContextCloseHandler<?>... closeHandlers)
Closes all open contexts. |
|
abstract C |
get()
The context identifier used to look up an instance registry. |
|
java.util.List<com.google.inject.Key<?>> |
getKeysInScope()
The keys bound in this scope. |
|
java.util.Collection<C> |
getOpenContexts()
The context identifiers of all open contexts that this scope knows about. |
|
|
scope(com.google.inject.Key<T> key,
com.google.inject.Provider<T> creator)
Returns a provider that finds the instance registry corresponding to the current context and returns the object registered with the given key, creating it if it doesn't exist in the registry. |
|
java.lang.String |
toString()
|
|
java.lang.Class<C> |
type()
The type of object used as a context identifier. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.directwebremoting.guice.ContextRegistry |
---|
get, putIfAbsent, registryFor, remove |
Method Detail |
---|
public java.lang.String toString()
toString
in interface com.google.inject.Scope
toString
in class java.lang.Object
public java.util.List<com.google.inject.Key<?>> getKeysInScope()
ContextScope
getKeysInScope
in interface ContextScope<C>
public <T> com.google.inject.Provider<T> scope(com.google.inject.Key<T> key, com.google.inject.Provider<T> creator)
ContextScope
scope
in interface com.google.inject.Scope
scope
in interface ContextScope<C>
public abstract C get()
ContextScope
get
in interface com.google.inject.Provider<C>
get
in interface ContextScope<C>
public java.lang.Class<C> type()
ContextScope
type
in interface ContextScope<C>
public java.util.Collection<C> getOpenContexts()
ContextScope
getOpenContexts
in interface ContextScope<C>
public void close(C context, ContextCloseHandler<?>... closeHandlers)
ContextScope
close
in interface ContextScope<C>
public void closeAll(ContextCloseHandler<?>... closeHandlers)
ContextScope
closeAll
in interface ContextScope<C>
|
Copyright ? 2005 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |