Package org.jboss.weld.contexts
Class CreationalContextImpl<T>
- java.lang.Object
-
- org.jboss.weld.contexts.CreationalContextImpl<T>
-
- All Implemented Interfaces:
jakarta.enterprise.context.spi.CreationalContext<T>
,Serializable
,org.jboss.weld.construction.api.WeldCreationalContext<T>
,WeldCreationalContext<T>
public class CreationalContextImpl<T> extends Object implements jakarta.enterprise.context.spi.CreationalContext<T>, WeldCreationalContext<T>, Serializable
- Author:
- Pete Muir, Ales Justin, Jozef Hartinger
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CreationalContextImpl(jakarta.enterprise.context.spi.Contextual<T> contextual)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDependentInstance(org.jboss.weld.context.api.ContextualInstance<?> contextualInstance)
void
addDependentResourceReference(org.jboss.weld.injection.spi.ResourceReference<?> resourceReference)
Register aResourceReference
as a dependency.boolean
containsIncompleteInstance(jakarta.enterprise.context.spi.Contextual<?> bean)
boolean
destroyDependentInstance(T instance)
Destroys dependent instanceList<org.jboss.weld.construction.api.AroundConstructCallback<T>>
getAroundConstructCallbacks()
InterceptionContext
getAroundConstructInterceptionContext()
jakarta.enterprise.context.spi.Contextual<T>
getContextual()
<S> CreationalContextImpl<S>
getCreationalContext(jakarta.enterprise.context.spi.Contextual<S> contextual)
List<org.jboss.weld.context.api.ContextualInstance<?>>
getDependentInstances()
Returns an unmodifiable list of dependent instances.<S> S
getIncompleteInstance(jakarta.enterprise.context.spi.Contextual<S> bean)
CreationalContextImpl<?>
getParentCreationalContext()
<S> CreationalContextImpl<S>
getProducerReceiverCreationalContext(jakarta.enterprise.context.spi.Contextual<S> contextual)
The returnedCreationalContext
shares nothing but incomplete instances.boolean
isConstructorInterceptionSuppressed()
void
push(T incompleteInstance)
void
registerAroundConstructCallback(org.jboss.weld.construction.api.AroundConstructCallback<T> callback)
void
release()
void
release(jakarta.enterprise.context.spi.Contextual<T> contextual, T instance)
void
setAroundConstructInterceptionContext(InterceptionContext aroundConstructInterceptionContext)
void
setConstructorInterceptionSuppressed(boolean value)
protected Object
writeReplace()
-
-
-
Constructor Detail
-
CreationalContextImpl
public CreationalContextImpl(jakarta.enterprise.context.spi.Contextual<T> contextual)
-
-
Method Detail
-
push
public void push(T incompleteInstance)
- Specified by:
push
in interfacejakarta.enterprise.context.spi.CreationalContext<T>
-
getCreationalContext
public <S> CreationalContextImpl<S> getCreationalContext(jakarta.enterprise.context.spi.Contextual<S> contextual)
- Specified by:
getCreationalContext
in interfaceWeldCreationalContext<T>
-
getProducerReceiverCreationalContext
public <S> CreationalContextImpl<S> getProducerReceiverCreationalContext(jakarta.enterprise.context.spi.Contextual<S> contextual)
Description copied from interface:WeldCreationalContext
The returnedCreationalContext
shares nothing but incomplete instances.- Specified by:
getProducerReceiverCreationalContext
in interfaceWeldCreationalContext<T>
- Returns:
- the
CreationalContext
for a producer reciever
-
getIncompleteInstance
public <S> S getIncompleteInstance(jakarta.enterprise.context.spi.Contextual<S> bean)
- Specified by:
getIncompleteInstance
in interfaceWeldCreationalContext<T>
-
containsIncompleteInstance
public boolean containsIncompleteInstance(jakarta.enterprise.context.spi.Contextual<?> bean)
-
addDependentInstance
public void addDependentInstance(org.jboss.weld.context.api.ContextualInstance<?> contextualInstance)
- Specified by:
addDependentInstance
in interfaceWeldCreationalContext<T>
-
release
public void release()
- Specified by:
release
in interfacejakarta.enterprise.context.spi.CreationalContext<T>
- Specified by:
release
in interfaceWeldCreationalContext<T>
-
getParentCreationalContext
public CreationalContextImpl<?> getParentCreationalContext()
- Specified by:
getParentCreationalContext
in interfaceWeldCreationalContext<T>
- Returns:
- the parent
CreationalContext
or null if there isn't any parent.
-
getDependentInstances
public List<org.jboss.weld.context.api.ContextualInstance<?>> getDependentInstances()
Returns an unmodifiable list of dependent instances.- Specified by:
getDependentInstances
in interfaceWeldCreationalContext<T>
-
writeReplace
protected Object writeReplace() throws ObjectStreamException
- Throws:
ObjectStreamException
-
addDependentResourceReference
public void addDependentResourceReference(org.jboss.weld.injection.spi.ResourceReference<?> resourceReference)
Register aResourceReference
as a dependency.ResourceReference.release()
will be called on everyResourceReference
once thisCreationalContext
instance is released.- Specified by:
addDependentResourceReference
in interfaceWeldCreationalContext<T>
-
destroyDependentInstance
public boolean destroyDependentInstance(T instance)
Destroys dependent instance- Specified by:
destroyDependentInstance
in interfaceWeldCreationalContext<T>
- Parameters:
instance
-- Returns:
- true if the instance was destroyed, false otherwise
-
getContextual
public jakarta.enterprise.context.spi.Contextual<T> getContextual()
- Specified by:
getContextual
in interfaceWeldCreationalContext<T>
- Returns:
- the
Contextual
for which thisCreationalContext
is created.
-
getAroundConstructCallbacks
public List<org.jboss.weld.construction.api.AroundConstructCallback<T>> getAroundConstructCallbacks()
-
setConstructorInterceptionSuppressed
public void setConstructorInterceptionSuppressed(boolean value)
- Specified by:
setConstructorInterceptionSuppressed
in interfaceorg.jboss.weld.construction.api.WeldCreationalContext<T>
-
isConstructorInterceptionSuppressed
public boolean isConstructorInterceptionSuppressed()
- Specified by:
isConstructorInterceptionSuppressed
in interfaceorg.jboss.weld.construction.api.WeldCreationalContext<T>
-
registerAroundConstructCallback
public void registerAroundConstructCallback(org.jboss.weld.construction.api.AroundConstructCallback<T> callback)
- Specified by:
registerAroundConstructCallback
in interfaceorg.jboss.weld.construction.api.WeldCreationalContext<T>
-
getAroundConstructInterceptionContext
public InterceptionContext getAroundConstructInterceptionContext()
- Returns:
- the interception context used for Weld-managed AroundConstruct interceptors or
null
if no such interceptors were applied
-
setAroundConstructInterceptionContext
public void setAroundConstructInterceptionContext(InterceptionContext aroundConstructInterceptionContext)
-
-