|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.errai.ioc.client.container.AbstractCreationalContext
org.jboss.errai.ioc.client.container.SimpleCreationalContext
public class SimpleCreationalContext
A SimpleCreationalContext is used for representing context associated with the creation of a bean and its dependencies.
A SimpleCreationalContext captures InitializationCallback
s and DestructionCallback
s associated with
the graph being constructed.
SyncBeanManagerImpl
itself and should not generally be used directly.
Field Summary |
---|
Fields inherited from class org.jboss.errai.ioc.client.container.AbstractCreationalContext |
---|
destructionCallbacks, immutableContext, initializationCallbacks, scope, unresolvedProxies, wired |
Constructor Summary | |
---|---|
SimpleCreationalContext(boolean immutableContext,
SyncBeanManager beanManager,
Class<? extends Annotation> scope)
|
|
SimpleCreationalContext(SyncBeanManagerImpl beanManager,
Class<? extends Annotation> scopeName)
|
Method Summary | ||
---|---|---|
void |
addProxyReference(Object proxyRef,
Object realRef)
Adds a lookup from a proxy to the actual bean instance that it is proxying. |
|
void |
finish()
Called to indicate all beans have been added to the context. |
|
|
getBeanInstance(Class<T> beanType,
Annotation[] qualifiers)
Obtains an instance of the bean within the creational context based on the specified bean type and qualifiers. |
|
|
getInstanceOrNew(BeanProvider<T> callback,
Class<?> beanType,
Annotation[] qualifiers)
Returns the instance of the specified bean of matching type and qualifiers, or if there is no matching bean within the context, the specified BeanProvider is called to instantiate and add the bean to the context. |
|
|
getSingletonInstanceOrNew(SimpleInjectionContext injectionContext,
BeanProvider<T> callback,
Class<?> beanType,
Annotation[] qualifiers)
Returns the instance of the specified bean of matching type and qualifiers, or if there is no matching bean within the context, an instance of the bean will be obtained from the SimpleInjectionContext . |
Methods inherited from class org.jboss.errai.ioc.client.container.AbstractCreationalContext |
---|
addBean, addBean, addDestructionCallback, addInitializationCallback, addUnresolvedProxy, destroyContext, fireAllInitCallbacks, getAllCreatedBeanInstances, getAllCreatedBeans, getBeanReference, getWiredOrNew |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleCreationalContext(SyncBeanManagerImpl beanManager, Class<? extends Annotation> scopeName)
public SimpleCreationalContext(boolean immutableContext, SyncBeanManager beanManager, Class<? extends Annotation> scope)
Method Detail |
---|
public void addProxyReference(Object proxyRef, Object realRef)
proxyRef
- the reference to the proxy instancerealRef
- the reference to the actual bean instance which the proxy wrapspublic <T> T getInstanceOrNew(BeanProvider<T> callback, Class<?> beanType, Annotation[] qualifiers)
BeanProvider
is called to instantiate and add the bean to the context.
T
- the type of the beancallback
- the BeanProvider
to be called in order to instantiate the bean if it is not already
available without he current creational context.beanType
- the type of the beanqualifiers
- the qualifiers for the bean
getSingletonInstanceOrNew(org.jboss.errai.ioc.client.SimpleInjectionContext, BeanProvider, Class, java.lang.annotation.Annotation[])
public <T> T getBeanInstance(Class<T> beanType, Annotation[] qualifiers)
T
- the type of the beanbeanType
- the type of the beanqualifiers
- the qualifiers fo the bean
public <T> T getSingletonInstanceOrNew(SimpleInjectionContext injectionContext, BeanProvider<T> callback, Class<?> beanType, Annotation[] qualifiers)
SimpleInjectionContext
. This method
assumes that the caller knows that the bean is a singleton bean. It is called directly by the
IOC bootstrapping code.
In the event that bean is not available within the SimpleInjectionContext
, the specified
BeanProvider
is invoked and the bean is added to the SimpleInjectionContext
. This
functionality primarily enables proper behavior for singleton producers.
T
- the type of the beaninjectionContext
- the SimpleInjectionContext
of the containercallback
- the BeanProvider
to be called in order to instantiate the bean if it is not already
available without he current creational context. * @param beanTypequalifiers
- the qualifiers for the bean
getInstanceOrNew(BeanProvider, Class, java.lang.annotation.Annotation[])
public void finish()
|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |