Errai 3.0.1-SNAPSHOT

org.jboss.errai.ioc.client.container
Interface ClientBeanManager

All Known Subinterfaces:
AsyncBeanManager, SyncBeanManager
All Known Implementing Classes:
AsyncBeanManagerImpl, SyncBeanManagerImpl, SyncToAsyncBeanManagerAdapter

public interface ClientBeanManager

Author:
Mike Brock

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.
 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.
 

Method Detail

destroyBean

void destroyBean(Object ref)
Destroy a bean and all other beans associated with its creational context in the bean manager.

Parameters:
ref - the instance reference of the bean

isManaged

boolean isManaged(Object ref)
Indicates whether the referenced object is currently a managed bean.

Parameters:
ref - the reference to the bean
Returns:
returns true if under management

getActualBeanReference

Object getActualBeanReference(Object ref)
Obtains an instance to the actual bean. If the specified reference is a proxy, this method will return an un-proxied reference to the object.

Parameters:
ref - the proxied or unproxied reference
Returns:
returns the absolute reference to bean if the specified reference is a proxy. If the specified reference is not a proxy, the same instance passed to the method is returned.
See Also:
isProxyReference(Object)

addProxyReference

void addProxyReference(Object proxyRef,
                       Object realRef)
Associates the reference to a proxied bean to the underlying bean instance which it is proxying.

Parameters:
proxyRef - the reference to the proxy
realRef - the reference to the bean being proxied.

isProxyReference

boolean isProxyReference(Object ref)
Determines whether the referenced object is itself a proxy to a managed bean.

Parameters:
ref - the reference to check
Returns:
returns true if the specified reference is itself a proxy.
See Also:
getActualBeanReference(Object)

addDestructionCallback

boolean addDestructionCallback(Object beanInstance,
                               DestructionCallback<?> destructionCallback)
Associates a 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.

Parameters:
beanInstance - the bean instance to associate the callback to.
destructionCallback - the instance of the DestructionCallback.
Returns:
true if the DestructionCallback is successfully registered against a valid CreationalContext and false if not.

addBeanToContext

void addBeanToContext(Object ref,
                      CreationalContext creationalContext)
Associates a bean instance with a creational context.

Parameters:
ref - the reference to the bean
creationalContext - the CreationalContext instance to associate the bean instance with.

destroyAllBeans

void destroyAllBeans()
Destroy all beans currently managed by the bean manager. Don't do this.


Errai 3.0.1-SNAPSHOT

Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.