Package io.quarkus.arc
Interface ManagedContext
- All Superinterfaces:
jakarta.enterprise.context.spi.AlterableContext,jakarta.enterprise.context.spi.Context,InjectableContext
- All Known Implementing Classes:
CurrentManagedContext,SessionContext
A context implementing this interface can be manually managed.
It can be activated with certain state hence allowing for context propagation and then deactivated on demand.
- Author:
- Martin Kouba
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.quarkus.arc.InjectableContext
InjectableContext.ContextState -
Method Summary
Modifier and TypeMethodDescriptiondefault InjectableContext.ContextStateactivate()Activate the context with no initial state.activate(InjectableContext.ContextState initialState) Activate the context.default voiddefault voidactivate$$bridge(InjectableContext.ContextState initialState) voidDeactivate the context - do not destroy existing contextual instances.Creates a newInjectableContext.ContextState.default voidDestroy and deactivate the context.Methods inherited from interface jakarta.enterprise.context.spi.AlterableContext
destroyMethods inherited from interface jakarta.enterprise.context.spi.Context
get, get, getScope, isActiveMethods inherited from interface io.quarkus.arc.InjectableContext
destroy, destroy, getIfActive, getState, getStateIfActive, isNormal
-
Method Details
-
activate
Activate the context with no initial state.If needed, activating a context will fire
@Initializedevent for the given context.- Returns:
- the context state
-
activate$$bridge
default void activate$$bridge() -
activate
Activate the context.If invoked with
nullparameter, a freshInjectableContext.ContextStateis automatically created.- Parameters:
initialState- The initial state, may benull- Returns:
- the context state
-
activate$$bridge
-
deactivate
void deactivate()Deactivate the context - do not destroy existing contextual instances. -
terminate
default void terminate()Destroy and deactivate the context. -
initializeState
InjectableContext.ContextState initializeState()Creates a newInjectableContext.ContextState.Creating a context state does not fire
@Initializedevent for given context.- Returns:
- a new initialized context state
-