Package org.jboss.weld.context
Class CreationalContextImpl<T>
- java.lang.Object
-
- org.jboss.weld.context.CreationalContextImpl<T>
-
- All Implemented Interfaces:
Serializable,javax.enterprise.context.spi.CreationalContext<T>,org.jboss.weld.construction.api.WeldCreationalContext<T>,WeldCreationalContext<T>
public class CreationalContextImpl<T> extends Object implements javax.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(javax.enterprise.context.spi.Contextual<T> contextual)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDependentInstance(org.jboss.weld.context.api.ContextualInstance<?> contextualInstance)voidaddDependentResourceReference(org.jboss.weld.injection.spi.ResourceReference<?> resourceReference)Register aResourceReferenceas a dependency.booleancontainsIncompleteInstance(javax.enterprise.context.spi.Contextual<?> bean)booleandestroyDependentInstance(T instance)Destroys dependent instanceList<org.jboss.weld.construction.api.AroundConstructCallback<T>>getAroundConstructCallbacks()InterceptionContextgetAroundConstructInterceptionContext()javax.enterprise.context.spi.Contextual<T>getContextual()<S> CreationalContextImpl<S>getCreationalContext(javax.enterprise.context.spi.Contextual<S> contextual)List<org.jboss.weld.context.api.ContextualInstance<?>>getDependentInstances()Returns an unmodifiable list of dependent instances.<S> SgetIncompleteInstance(javax.enterprise.context.spi.Contextual<S> bean)CreationalContextImpl<?>getParentCreationalContext()<S> CreationalContextImpl<S>getProducerReceiverCreationalContext(javax.enterprise.context.spi.Contextual<S> contextual)The returnedCreationalContextshares nothing but incomplete instances.booleanisConstructorInterceptionSuppressed()voidpush(T incompleteInstance)voidregisterAroundConstructCallback(org.jboss.weld.construction.api.AroundConstructCallback<T> callback)voidrelease()voidrelease(javax.enterprise.context.spi.Contextual<T> contextual, T instance)voidsetAroundConstructInterceptionContext(InterceptionContext aroundConstructInterceptionContext)voidsetConstructorInterceptionSuppressed(boolean value)protected ObjectwriteReplace()
-
-
-
Constructor Detail
-
CreationalContextImpl
public CreationalContextImpl(javax.enterprise.context.spi.Contextual<T> contextual)
-
-
Method Detail
-
push
public void push(T incompleteInstance)
- Specified by:
pushin interfacejavax.enterprise.context.spi.CreationalContext<T>
-
getCreationalContext
public <S> CreationalContextImpl<S> getCreationalContext(javax.enterprise.context.spi.Contextual<S> contextual)
- Specified by:
getCreationalContextin interfaceWeldCreationalContext<T>
-
getProducerReceiverCreationalContext
public <S> CreationalContextImpl<S> getProducerReceiverCreationalContext(javax.enterprise.context.spi.Contextual<S> contextual)
Description copied from interface:WeldCreationalContextThe returnedCreationalContextshares nothing but incomplete instances.- Specified by:
getProducerReceiverCreationalContextin interfaceWeldCreationalContext<T>- Returns:
- the
CreationalContextfor a producer reciever
-
getIncompleteInstance
public <S> S getIncompleteInstance(javax.enterprise.context.spi.Contextual<S> bean)
- Specified by:
getIncompleteInstancein interfaceWeldCreationalContext<T>
-
containsIncompleteInstance
public boolean containsIncompleteInstance(javax.enterprise.context.spi.Contextual<?> bean)
- Specified by:
containsIncompleteInstancein interfaceWeldCreationalContext<T>
-
addDependentInstance
public void addDependentInstance(org.jboss.weld.context.api.ContextualInstance<?> contextualInstance)
- Specified by:
addDependentInstancein interfaceWeldCreationalContext<T>
-
release
public void release()
- Specified by:
releasein interfacejavax.enterprise.context.spi.CreationalContext<T>- Specified by:
releasein interfaceWeldCreationalContext<T>
-
getParentCreationalContext
public CreationalContextImpl<?> getParentCreationalContext()
- Specified by:
getParentCreationalContextin interfaceWeldCreationalContext<T>- Returns:
- the parent
CreationalContextor 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:
getDependentInstancesin interfaceWeldCreationalContext<T>
-
writeReplace
protected Object writeReplace() throws ObjectStreamException
- Throws:
ObjectStreamException
-
addDependentResourceReference
public void addDependentResourceReference(org.jboss.weld.injection.spi.ResourceReference<?> resourceReference)
Register aResourceReferenceas a dependency.ResourceReference.release()will be called on everyResourceReferenceonce thisCreationalContextinstance is released.- Specified by:
addDependentResourceReferencein interfaceWeldCreationalContext<T>
-
destroyDependentInstance
public boolean destroyDependentInstance(T instance)
Destroys dependent instance- Specified by:
destroyDependentInstancein interfaceWeldCreationalContext<T>- Parameters:
instance-- Returns:
- true if the instance was destroyed, false otherwise
-
getContextual
public javax.enterprise.context.spi.Contextual<T> getContextual()
- Specified by:
getContextualin interfaceWeldCreationalContext<T>- Returns:
- the
Contextualfor which thisCreationalContextis created.
-
getAroundConstructCallbacks
public List<org.jboss.weld.construction.api.AroundConstructCallback<T>> getAroundConstructCallbacks()
-
setConstructorInterceptionSuppressed
public void setConstructorInterceptionSuppressed(boolean value)
- Specified by:
setConstructorInterceptionSuppressedin interfaceorg.jboss.weld.construction.api.WeldCreationalContext<T>
-
isConstructorInterceptionSuppressed
public boolean isConstructorInterceptionSuppressed()
- Specified by:
isConstructorInterceptionSuppressedin interfaceorg.jboss.weld.construction.api.WeldCreationalContext<T>
-
registerAroundConstructCallback
public void registerAroundConstructCallback(org.jboss.weld.construction.api.AroundConstructCallback<T> callback)
- Specified by:
registerAroundConstructCallbackin interfaceorg.jboss.weld.construction.api.WeldCreationalContext<T>
-
getAroundConstructInterceptionContext
public InterceptionContext getAroundConstructInterceptionContext()
- Returns:
- the interception context used for Weld-managed AroundConstruct interceptors or
nullif no such interceptors were applied
-
setAroundConstructInterceptionContext
public void setAroundConstructInterceptionContext(InterceptionContext aroundConstructInterceptionContext)
-
-