Errai 3.0.1-SNAPSHOT

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

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

public class IOCSingletonBean<T>
extends IOCDependentBean<T>

Represents a bean inside the container, capturing the type, qualifiers and instance reference for the bean.

Author:
Mike Brock

Field Summary
 
Fields inherited from class org.jboss.errai.ioc.client.container.IOCDependentBean
beanManager, beanProvider
 
Fields inherited from class org.jboss.errai.ioc.client.container.AbstractIOCBean
beanType, concrete, name, qualifiers, type
 
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.
static
<T> IOCBeanDef<T>
newBean(SyncBeanManagerImpl beanManager, Class<T> type, Class<?> beanType, Annotation[] qualifiers, String name, boolean concrete, BeanProvider<T> callback, T instance, Class<Object> beanActivatorType)
          Creates a new IOC Bean reference
 String toString()
           
 
Methods inherited from class org.jboss.errai.ioc.client.container.IOCDependentBean
isActivated, newBean, newInstance
 
Methods inherited from class org.jboss.errai.ioc.client.container.AbstractIOCBean
getBeanClass, getName, getQualifiers, getType, isConcrete, matches
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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,
                                        T instance,
                                        Class<Object> beanActivatorType)
Creates a new IOC Bean reference

Type Parameters:
T - The type of the bean
Parameters:
type - The type of a bean
qualifiers - The qualifiers of the bean.
name - The name of the bean
instance - The instance of the bean.
activator - The bean activator to use, may be null.
Returns:
A new instance of IOCSingletonBean

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.

Specified by:
getInstance in interface IOCBeanDef<T>
Overrides:
getInstance in class IOCDependentBean<T>
Returns:

getInstance

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

Specified by:
getInstance in interface IOCBeanDef<T>
Overrides:
getInstance in class IOCDependentBean<T>
Returns:
The bean instance.

getScope

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

Specified by:
getScope in interface IOCBeanDef<T>
Overrides:
getScope in class IOCDependentBean<T>

toString

public String toString()
Overrides:
toString in class AbstractIOCBean<T>

Errai 3.0.1-SNAPSHOT

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