public interface CreationalContext
The context is used for regulating lifecycle activities as well as managing proxies generated in the creation of the beans.
Modifier and Type | Method and Description |
---|---|
void |
addBean(BeanRef ref,
Object instance)
Adds a bean to the creational context based on the
BeanRef with a reference to the an actual instantiated
instance of the bean. |
void |
addBean(Class<?> beanType,
Annotation[] qualifiers,
Object instance)
Adds a bean to the creational context based on the specified bean type and qualifiers with a reference to an
actual instantiated instance of the bean.
|
void |
addDestructionCallback(Object beanInstance,
DestructionCallback callback)
Records a
DestructionCallback to the creational context. |
void |
addInitializationCallback(Object beanInstance,
InitializationCallback callback)
Records a
InitializationCallback to the creational context. |
void |
addProxyReference(Object proxyRef,
Object realRef)
Adds a lookup from a proxy to the actual bean instance that it is proxying.
|
void |
addUnresolvedProxy(ProxyResolver proxyResolver,
Class<?> beanType,
Annotation[] qualifiers)
Adds an unresolved proxy into the creational context.
|
Collection<Object> |
getAllCreatedBeanInstances()
Returns a list of the instances of every created bean within this creational context.
|
Set<BeanRef> |
getAllCreatedBeans()
Returns a list of all created beans within this creational context.
|
BeanRef |
getBeanReference(Class<?> beanType,
Annotation[] qualifiers)
Returns a
BeanRef which matches the specified type and qualifiers whether or not the bean is within
the creational context or not. |
void addInitializationCallback(Object beanInstance, InitializationCallback callback)
InitializationCallback
to the creational context.beanInstance
- the instance of the bean associated with the InitializationCallback
callback
- the instance of the InitializationCallback
void addDestructionCallback(Object beanInstance, DestructionCallback callback)
DestructionCallback
to the creational context. All destruction callbacks are executed
by the bean manager for a creational context when any of the beans within the creational context are
destroyed.beanInstance
- the instance of the bean associated with the DestructionCallback
.callback
- the instance of the DestructionCallback
void addProxyReference(Object proxyRef, Object realRef)
proxyRef
- the reference to the proxy instancerealRef
- the reference to the actual bean instance which the proxy wrapsBeanRef getBeanReference(Class<?> beanType, Annotation[] qualifiers)
BeanRef
which matches the specified type and qualifiers whether or not the bean is within
the creational context or not.beanType
- the type of the beanqualifiers
- the qualifiers for the beanBeanRef
matching the specified type and qualifiers.void addBean(Class<?> beanType, Annotation[] qualifiers, Object instance)
beanType
- the type of the beanqualifiers
- the qualifiers for the beaninstance
- the instance to the beanvoid addBean(BeanRef ref, Object instance)
BeanRef
with a reference to the an actual instantiated
instance of the bean.ref
- the BeanRef
representing the beaninstance
- the instance of the beanSet<BeanRef> getAllCreatedBeans()
Collection<Object> getAllCreatedBeanInstances()
void addUnresolvedProxy(ProxyResolver proxyResolver, Class<?> beanType, Annotation[] qualifiers)
ProxyResolver
callback, for implementing its own proxy closing strategy.
After a creational context has added all beans to the context, calling #finish()
will result in all of
the provided ProxyResolver
s being executed.
This method is typically called directly by the generated bootstrapper.proxyResolver
- the ProxyResolver
used for handling closure of the cycle.beanType
- the type of the beanqualifiers
- the qualifiers for the beanCopyright © 2013-2015 JBoss, a division of Red Hat. All Rights Reserved.