Errai 3.0.1-SNAPSHOT

org.jboss.errai.ioc.client.container
Class IOCDependentBean<T>

java.lang.Object
  extended by org.jboss.errai.ioc.client.container.AbstractIOCBean<T>
      extended by org.jboss.errai.ioc.client.container.IOCDependentBean<T>
All Implemented Interfaces:
IOCBeanDef<T>
Direct Known Subclasses:
IOCSingletonBean

public class IOCDependentBean<T>
extends AbstractIOCBean<T>

Represents a default dependent scoped bean.

Author:
Mike Brock, Christian Sadilek

Field Summary
protected  SyncBeanManagerImpl beanManager
           
protected  BeanProvider<T> beanProvider
           
 
Fields inherited from class org.jboss.errai.ioc.client.container.AbstractIOCBean
beanType, concrete, name, qualifiers, type
 
Constructor Summary
protected IOCDependentBean(SyncBeanManagerImpl beanManager, Class<T> type, Class<?> beanType, Annotation[] qualifiers, String name, boolean concrete, BeanProvider<T> beanProvider, Class<Object> beanActivatorType)
           
 
Method Summary
 T getInstance()
          Returns an instance of the bean within the active scope.
 T getInstance(CreationalContext context)
          Returns an instance of the bean within the active scope, using the specified SimpleCreationalContext.
 Class<? extends Annotation> getScope()
          Returns the scope of the bean.
 boolean isActivated()
          Returns true if the bean is activated.
static
<T> IOCBeanDef<T>
newBean(SyncBeanManagerImpl beanManager, Class<T> type, Class<?> beanType, Annotation[] qualifiers, String name, boolean concrete, BeanProvider<T> callback, Class<Object> beanActivatorType)
           
 T newInstance()
          Returns a new instance of the bean.
 
Methods inherited from class org.jboss.errai.ioc.client.container.AbstractIOCBean
getBeanClass, getName, getQualifiers, getType, isConcrete, matches, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

beanManager

protected final SyncBeanManagerImpl beanManager

beanProvider

protected final BeanProvider<T> beanProvider
Constructor Detail

IOCDependentBean

protected IOCDependentBean(SyncBeanManagerImpl beanManager,
                           Class<T> type,
                           Class<?> beanType,
                           Annotation[] qualifiers,
                           String name,
                           boolean concrete,
                           BeanProvider<T> beanProvider,
                           Class<Object> beanActivatorType)
Method Detail

newBean

public static <T> IOCBeanDef<T> newBean(SyncBeanManagerImpl beanManager,
                                        Class<T> type,
                                        Class<?> beanType,
                                        Annotation[] qualifiers,
                                        String name,
                                        boolean concrete,
                                        BeanProvider<T> callback,
                                        Class<Object> beanActivatorType)

newInstance

public T newInstance()
Description copied from interface: IOCBeanDef
Returns a new instance of the bean. Calling this method overrides the underlying scope and instantiates a new instance of the bean.

Returns:
a new instance of the bean.

getInstance

public T getInstance()
Description copied from interface: IOCBeanDef
Returns an instance of the bean within the active scope.

Returns:
The bean instance.

getInstance

public T getInstance(CreationalContext context)
Description copied from interface: IOCBeanDef
Returns an instance of the bean within the active scope, using the specified SimpleCreationalContext.

Returns:

getScope

public Class<? extends Annotation> getScope()
Description copied from interface: IOCBeanDef
Returns the scope of the bean.


isActivated

public boolean isActivated()
Description copied from interface: IOCBeanDef
Returns true if the bean is activated. All managed beans are activated by default unless a BeanActivator was specified using ActivatedBy which will be consulted when invoking this method.

Returns:
true if activated, otherwise false.

Errai 3.0.1-SNAPSHOT

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