public class CreationalContextImpl<T> extends Object implements CreationalContext<T>, WeldCreationalContext<T>, Serializable
Constructor and Description |
---|
CreationalContextImpl(Contextual<T> contextual) |
Modifier and Type | Method and Description |
---|---|
void |
addDependentInstance(ContextualInstance<?> contextualInstance) |
void |
addDependentResourceReference(ResourceReference<?> resoruceReference)
Register a
ResourceReference as a dependency. |
boolean |
containsIncompleteInstance(Contextual<?> bean) |
boolean |
destroyDependentInstance(T instance)
Destroys dependent instance
|
List<AroundConstructCallback<T>> |
getAroundConstructCallbacks() |
Contextual<T> |
getContextual() |
<S> CreationalContextImpl<S> |
getCreationalContext(Contextual<S> contextual) |
List<ContextualInstance<?>> |
getDependentInstances()
Returns an unmodifiable list of dependent instances.
|
<S> S |
getIncompleteInstance(Contextual<S> bean) |
CreationalContextImpl<?> |
getParentCreationalContext() |
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 Object |
writeReplace() |
public CreationalContextImpl(Contextual<T> contextual)
public void push(T incompleteInstance)
CreationalContext
Contextual.create(CreationalContext)
.push
in interface CreationalContext<T>
incompleteInstance
- the incompletely initialized instancepublic <S> CreationalContextImpl<S> getCreationalContext(Contextual<S> contextual)
public <S> S getIncompleteInstance(Contextual<S> bean)
public boolean containsIncompleteInstance(Contextual<?> bean)
public void addDependentInstance(ContextualInstance<?> contextualInstance)
public void release()
CreationalContext
Contextual.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 List<ContextualInstance<?>> getDependentInstances()
protected Object writeReplace() throws ObjectStreamException
ObjectStreamException
public void addDependentResourceReference(ResourceReference<?> resoruceReference)
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 List<AroundConstructCallback<T>> getAroundConstructCallbacks()
public void setConstructorInterceptionSuppressed(boolean value)
WeldCreationalContext
AroundConstruct
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()
WeldCreationalContext
AroundConstruct
interceptors are suppressed.isConstructorInterceptionSuppressed
in interface WeldCreationalContext<T>
AroundConstruct
interceptors are suppressedWeldCreationalContext.setConstructorInterceptionSuppressed(boolean)
public void registerAroundConstructCallback(AroundConstructCallback<T> callback)
WeldCreationalContext
AroundConstructCallback
s are invoked in the order in which
they were registered.registerAroundConstructCallback
in interface WeldCreationalContext<T>
callback
- the callbackCopyright © 2013 Seam Framework. All Rights Reserved.