Package com.echothree.util.server.cdi
Class CommandScopeContext
java.lang.Object
com.echothree.util.server.cdi.CommandScopeContext
- All Implemented Interfaces:
javax.enterprise.context.spi.Context
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classHandle used for try-with-resources push/pop. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()Activate the root scope for the current thread if not already active.voidDeactivate the scope for the current thread, destroying all layers.<T> Tget(javax.enterprise.context.spi.Contextual<T> contextual) <T> Tget(javax.enterprise.context.spi.Contextual<T> contextual, javax.enterprise.context.spi.CreationalContext<T> creationalContext) Class<? extends Annotation> getScope()booleanisActive()voidpop()Pop the current layer, destroying its beans.push()Push a new nested layer on top of the current one.
-
Constructor Details
-
CommandScopeContext
public CommandScopeContext()
-
-
Method Details
-
getScope
- Specified by:
getScopein interfacejavax.enterprise.context.spi.Context
-
isActive
- Specified by:
isActivein interfacejavax.enterprise.context.spi.Context
-
activate
Activate the root scope for the current thread if not already active. Typically called at the start of a request. -
deactivate
Deactivate the scope for the current thread, destroying all layers. Typically called at the end of a request. -
push
Push a new nested layer on top of the current one. Returns an AutoCloseable handle so you can use try-with-resources. -
pop
Pop the current layer, destroying its beans. -
get
public <T> T get(javax.enterprise.context.spi.Contextual<T> contextual, javax.enterprise.context.spi.CreationalContext<T> creationalContext) - Specified by:
getin interfacejavax.enterprise.context.spi.Context
-
get
- Specified by:
getin interfacejavax.enterprise.context.spi.Context
-