public class CreationalContextImpl<T> extends java.lang.Object implements CreationalContext<T>, WeldCreationalContext<T>, java.io.Serializable
| Constructor and Description |
|---|
CreationalContextImpl(Contextual<T> contextual) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDependentInstance(ContextualInstance<?> contextualInstance) |
void |
addDependentResourceReference(ResourceReference<?> resourceReference)
Register a
ResourceReference as a dependency. |
boolean |
containsIncompleteInstance(Contextual<?> bean) |
boolean |
destroyDependentInstance(T instance)
Destroys dependent instance
|
java.util.List<AroundConstructCallback<T>> |
getAroundConstructCallbacks() |
Contextual<T> |
getContextual() |
<S> CreationalContextImpl<S> |
getCreationalContext(Contextual<S> contextual) |
java.util.List<ContextualInstance<?>> |
getDependentInstances()
Returns an unmodifiable list of dependent instances.
|
<S> S |
getIncompleteInstance(Contextual<S> bean) |
CreationalContextImpl<?> |
getParentCreationalContext() |
<S> CreationalContextImpl<S> |
getProducerReceiverCreationalContext(Contextual<S> contextual)
The returned
CreationalContext shares nothing but incomplete instances. |
boolean |
isConstructorInterceptionSuppressed()
Indicates whether Weld-managed
AroundConstruct interceptors are suppressed. |
void |
push(T incompleteInstance)
Registers an incompletely initialized contextual instance the with the container.
|
void |
registerAroundConstructCallback(AroundConstructCallback<T> callback)
Register a callback which is notified of component construction.
|
void |
release()
Destroys all dependent objects of the instance which is being destroyed, by passing each dependent object to
Contextual.destroy(Object, CreationalContext) . |
void |
release(Contextual<T> contextual,
T instance) |
void |
setConstructorInterceptionSuppressed(boolean value)
By default Weld takes care of
AroundConstruct interceptors of a component instance which are bound to the component using interceptor bindings or
the Interceptors annotation. |
protected java.lang.Object |
writeReplace() |
public CreationalContextImpl(Contextual<T> contextual)
public void push(T incompleteInstance)
CreationalContextContextual.create(CreationalContext) .push in interface CreationalContext<T>incompleteInstance - the incompletely initialized instancepublic <S> CreationalContextImpl<S> getCreationalContext(Contextual<S> contextual)
public <S> CreationalContextImpl<S> getProducerReceiverCreationalContext(Contextual<S> contextual)
WeldCreationalContextCreationalContext shares nothing but incomplete instances.CreationalContext for a producer recieverWELD-1513public <S> S getIncompleteInstance(Contextual<S> bean)
public boolean containsIncompleteInstance(Contextual<?> bean)
public void addDependentInstance(ContextualInstance<?> contextualInstance)
public void release()
CreationalContextContextual.destroy(Object, CreationalContext) .release in interface CreationalContext<T>public void release(Contextual<T> contextual, T instance)
public CreationalContextImpl<?> getParentCreationalContext()
CreationalContext or null if there isn't any parent.public java.util.List<ContextualInstance<?>> getDependentInstances()
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException
java.io.ObjectStreamExceptionpublic void addDependentResourceReference(ResourceReference<?> resourceReference)
ResourceReference as a dependency. ResourceReference.release() will be called on every ResourceReference once this
CreationalContext instance is released.public boolean destroyDependentInstance(T instance)
instance - public Contextual<T> getContextual()
Contextual for which this CreationalContext is created.public java.util.List<AroundConstructCallback<T>> getAroundConstructCallbacks()
public void setConstructorInterceptionSuppressed(boolean value)
WeldCreationalContextAroundConstruct interceptors of a component instance which are bound to the component using interceptor bindings or
the Interceptors annotation. This may not be desired should an integrator want to manage these interceptors themselves. In that case this switch
may be used to suppress Weld management of AroundConstruct interceptors. In that case an integrator is responsible for performing
AroundConstruct interception.setConstructorInterceptionSuppressed in interface WeldCreationalContext<T>value - the valueWeldCreationalContext.registerAroundConstructCallback(AroundConstructCallback)public boolean isConstructorInterceptionSuppressed()
WeldCreationalContextAroundConstruct interceptors are suppressed.isConstructorInterceptionSuppressed in interface WeldCreationalContext<T>AroundConstruct interceptors are suppressedWeldCreationalContext.setConstructorInterceptionSuppressed(boolean)public void registerAroundConstructCallback(AroundConstructCallback<T> callback)
WeldCreationalContextAroundConstructCallbacks are invoked in the order in which
they were registered.registerAroundConstructCallback in interface WeldCreationalContext<T>callback - the callbackCopyright © 2014. All Rights Reserved.