Interface AdvancedContext<K>
- All Superinterfaces:
javax.enterprise.context.spi.Context
- All Known Implementing Classes:
AbstractContext,RequestContext,SessionContext,SharedContext,UnSharedContext
public interface AdvancedContext<K>
extends javax.enterprise.context.spi.Context
This interface defines all the additional methods needed to easily implement
an AlterableContext
-
Method Summary
Modifier and TypeMethodDescriptionvoidActivates the current context using the given key within the context of the threadvoiddeactivate(K key) Deactivates the current context using the given key from the context of the threadvoiddestroy(javax.enterprise.context.spi.Contextual<?> contextual) Destroy the existing contextual instance.voidRegisters a new key to the contextvoidunregister(K key) Unregisters a given key from the contextMethods inherited from interface javax.enterprise.context.spi.Context
get, get, getScope, isActive
-
Method Details
-
register
Registers a new key to the context- Parameters:
key- the key to register
-
unregister
Unregisters a given key from the context- Parameters:
key- the key to unregister
-
activate
Activates the current context using the given key within the context of the thread- Parameters:
key- the key to use to activate the context
-
deactivate
Deactivates the current context using the given key from the context of the thread- Parameters:
key- the key to use to deactivate the context
-
destroy
void destroy(javax.enterprise.context.spi.Contextual<?> contextual) Destroy the existing contextual instance. If there is no existing instance, no action is taken.
- Parameters:
contextual- the contextual type- Throws:
javax.enterprise.context.ContextNotActiveException- if the context is not active
-