|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CreationalContext
The CreationalContext is as its name implies, the context used in the creation of beans. There is a one-to-one relationship between a CreationalContext and a scope. The creation of new dependent scope beans and forced new-instance creation of normal-scoped beans are contained in their own CreationalContext.
The context is used for regulating lifecycle activities as well as managing proxies generated in the creation of the beans.
Method Summary | |
---|---|
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. |
Method Detail |
---|
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 bean
BeanRef
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 bean
|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |