Package org.jboss.weld.context
Interface WeldAlterableContext
-
- All Superinterfaces:
jakarta.enterprise.context.spi.AlterableContext,jakarta.enterprise.context.spi.Context
- All Known Subinterfaces:
BoundContext<S>,BoundConversationContext,BoundRequestContext,BoundSessionContext,ConversationContext,EjbRequestContext,HttpConversationContext,HttpRequestContext,HttpSessionContext,ManagedContext,RequestContext,SessionContext
public interface WeldAlterableContext extends jakarta.enterprise.context.spi.AlterableContextEnriched version ofAlterableContextwhich allows to capture all instances from given context or to set them to previously obtained values. Most built-in contexts implement this in order to support context propagation. Exception areApplicationContextwhich works out of the box and thenSingletonContextandDependentContextwhich are not to be propagated.- Author:
- Matej Novotny
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default voidclearAndSet(Collection<ContextualInstance<?>> setOfInstances)Clears the backing bean store and feeds it with the set ofContextualInstanceprovided as parameter.default Collection<ContextualInstance<?>>getAllContextualInstances()Retrieves set ofContextualInstancewithin the context.
-
-
-
Method Detail
-
getAllContextualInstances
default Collection<ContextualInstance<?>> getAllContextualInstances()
Retrieves set ofContextualInstancewithin the context. This entails all instances that were created up to this point - Weld creates them lazily so unless some beans were already used, they have not been stored.- Returns:
- Set of all
ContextualInstanceexisting in this context
-
clearAndSet
default void clearAndSet(Collection<ContextualInstance<?>> setOfInstances)
Clears the backing bean store and feeds it with the set ofContextualInstanceprovided as parameter. AllContextualInstancehave to belong to the same scope as does thisWeldAlterableContextotherwiseIllegalArgumentExceptionis thrown.- Parameters:
setOfInstances- set ofContextualInstancewhich are to become the new bean store for this context- Throws:
IllegalArgumentException- ifContextualInstances belong to different scope than this context
-
-