|
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.SyncToAsyncBeanManagerAdapter
public class SyncToAsyncBeanManagerAdapter
An adapter that makes the asynchronous bean manager API work with a synchronous bean manager.
Constructor Summary | |
---|---|
SyncToAsyncBeanManagerAdapter(SyncBeanManager bm)
|
Method Summary | ||
---|---|---|
void |
addBeanToContext(Object ref,
CreationalContext creationalContext)
Associates a bean instance with a creational context. |
|
boolean |
addDestructionCallback(Object beanInstance,
DestructionCallback<?> destructionCallback)
Associates a DestructionCallback with a bean instance. |
|
void |
addProxyReference(Object proxyRef,
Object realRef)
Associates the reference to a proxied bean to the underlying bean instance which it is proxying. |
|
void |
destroyAllBeans()
Destroy all beans currently managed by the bean manager. |
|
void |
destroyBean(Object ref)
Destroy a bean and all other beans associated with its creational context in the bean manager. |
|
void |
destroyBean(Object ref,
Runnable runnable)
Destroy the bean and all other beans associated with its AsyncCreationalContext . |
|
Object |
getActualBeanReference(Object ref)
Obtains an instance to the actual bean. |
|
boolean |
isManaged(Object ref)
Indicates whether the referenced object is currently a managed bean. |
|
boolean |
isProxyReference(Object ref)
Determines whether the referenced object is itself a proxy to a managed bean. |
|
|
lookupBean(Class<T> type,
Annotation... qualifiers)
Looks up a bean reference based on type and qualifiers. |
|
|
lookupBeans(Class<T> type)
Looks up all beans of the specified type. |
|
|
lookupBeans(Class<T> type,
Annotation... qualifiers)
Looks up a bean reference based on type and qualifiers. |
|
Collection<AsyncBeanDef> |
lookupBeans(String name)
Looks up all beans with the specified bean name as specified by Named . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SyncToAsyncBeanManagerAdapter(SyncBeanManager bm)
Method Detail |
---|
public void destroyBean(Object ref)
ClientBeanManager
destroyBean
in interface ClientBeanManager
ref
- the instance reference of the beanpublic void destroyBean(Object ref, Runnable runnable)
AsyncBeanManager
AsyncCreationalContext
. Because some
destruction activity may be asynchronous, this method accepts a second parameter as a callback to
be notified when the destruction of all the beans has been done.
destroyBean
in interface AsyncBeanManager
ref
- the reference to the bean to be destroyed.runnable
- a runnable callback to be called when all the beans have been destroyed.public boolean isManaged(Object ref)
ClientBeanManager
isManaged
in interface ClientBeanManager
ref
- the reference to the bean
public Object getActualBeanReference(Object ref)
ClientBeanManager
getActualBeanReference
in interface ClientBeanManager
ref
- the proxied or unproxied reference
ClientBeanManager.isProxyReference(Object)
public void addProxyReference(Object proxyRef, Object realRef)
ClientBeanManager
addProxyReference
in interface ClientBeanManager
proxyRef
- the reference to the proxyrealRef
- the reference to the bean being proxied.public boolean isProxyReference(Object ref)
ClientBeanManager
isProxyReference
in interface ClientBeanManager
ref
- the reference to check
ClientBeanManager.getActualBeanReference(Object)
public boolean addDestructionCallback(Object beanInstance, DestructionCallback<?> destructionCallback)
ClientBeanManager
DestructionCallback
with a bean instance. If the bean manager cannot find a valid
CreationalContext
to associate with the bean, or the bean is no longer considered active, the method
returns false. Otherwise, the method returns true, indicating the callback is now registered
and will be called when the bean is destroyed.
addDestructionCallback
in interface ClientBeanManager
beanInstance
- the bean instance to associate the callback to.destructionCallback
- the instance of the DestructionCallback
.
DestructionCallback
is successfully registered against a valid
CreationalContext
and false if not.public void addBeanToContext(Object ref, CreationalContext creationalContext)
ClientBeanManager
addBeanToContext
in interface ClientBeanManager
ref
- the reference to the beancreationalContext
- the CreationalContext
instance to associate the bean instance with.public void destroyAllBeans()
ClientBeanManager
destroyAllBeans
in interface ClientBeanManager
public Collection<AsyncBeanDef> lookupBeans(String name)
AsyncBeanManager
Named
.
lookupBeans
in interface AsyncBeanManager
name
- the name of bean to lookup
public <T> Collection<AsyncBeanDef<T>> lookupBeans(Class<T> type)
AsyncBeanManager
lookupBeans
in interface AsyncBeanManager
type
- The type of the bean
public <T> Collection<AsyncBeanDef<T>> lookupBeans(Class<T> type, Annotation... qualifiers)
AsyncBeanManager
lookupBeans
in interface AsyncBeanManager
type
- The type of the beanqualifiers
- qualifiers to match
public <T> AsyncBeanDef<T> lookupBean(Class<T> type, Annotation... qualifiers)
AsyncBeanManager
lookupBean
in interface AsyncBeanManager
T
- The type of the beantype
- The type of the beanqualifiers
- qualifiers to match
IOCSingletonBean
for the matching type and qualifiers.
Throws an IOCResolutionException
if there is a matching type but none of the
qualifiers match or if more than one bean matches.
|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |