public class AsyncBeanManagerImpl extends Object implements AsyncBeanManager, AsyncBeanManagerSetup
Constructor and Description |
---|
AsyncBeanManagerImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addBean(Class<Object> type,
Class<?> beanType,
AsyncBeanProvider<Object> callback,
Object instance,
Annotation[] qualifiers) |
void |
addBean(Class<Object> type,
Class<?> beanType,
AsyncBeanProvider<Object> callback,
Object instance,
Annotation[] qualifiers,
String name) |
void |
addBean(Class<Object> type,
Class<?> beanType,
AsyncBeanProvider<Object> callback,
Object instance,
Annotation[] qualifiers,
String name,
boolean concreteType,
Class<Object> beanActivatorType) |
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.
|
<T> AsyncBeanDef<T> |
lookupBean(Class<T> type,
Annotation... qualifiers)
Looks up a bean reference based on type and qualifiers.
|
<T> Collection<AsyncBeanDef<T>> |
lookupBeans(Class<T> type)
Looks up all beans of the specified type.
|
<T> Collection<AsyncBeanDef<T>> |
lookupBeans(Class<T> type,
Annotation... qualifierInstances)
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 . |
public void addBean(Class<Object> type, Class<?> beanType, AsyncBeanProvider<Object> callback, Object instance, Annotation[] qualifiers)
addBean
in interface AsyncBeanManagerSetup
public void addBean(Class<Object> type, Class<?> beanType, AsyncBeanProvider<Object> callback, Object instance, Annotation[] qualifiers, String name)
addBean
in interface AsyncBeanManagerSetup
public void addBean(Class<Object> type, Class<?> beanType, AsyncBeanProvider<Object> callback, Object instance, Annotation[] qualifiers, String name, boolean concreteType, Class<Object> beanActivatorType)
addBean
in interface AsyncBeanManagerSetup
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 beanpublic Object getActualBeanReference(Object ref)
ClientBeanManager
getActualBeanReference
in interface ClientBeanManager
ref
- the proxied or unproxied referenceClientBeanManager.isProxyReference(Object)
public boolean isProxyReference(Object ref)
ClientBeanManager
isProxyReference
in interface ClientBeanManager
ref
- the reference to checkClientBeanManager.getActualBeanReference(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 void addBeanToContext(Object ref, CreationalContext creationalContext)
addBeanToContext
in interface ClientBeanManager
ref
- the reference to the beancreationalContext
- the CreationalContext
instance to associate the bean instance with.public Collection<AsyncBeanDef> lookupBeans(String name)
AsyncBeanManager
Named
.lookupBeans
in interface AsyncBeanManager
name
- the name of bean to lookuppublic <T> Collection<AsyncBeanDef<T>> lookupBeans(Class<T> type)
AsyncBeanManager
lookupBeans
in interface AsyncBeanManager
type
- The type of the beanpublic <T> Collection<AsyncBeanDef<T>> lookupBeans(Class<T> type, Annotation... qualifierInstances)
AsyncBeanManager
lookupBeans
in interface AsyncBeanManager
type
- The type of the beanqualifierInstances
- qualifiers to matchpublic <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 matchIOCSingletonBean
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.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 destroyAllBeans()
ClientBeanManager
destroyAllBeans
in interface ClientBeanManager
Copyright © 2013-2015 JBoss, a division of Red Hat. All Rights Reserved.