org.jboss.errai.ioc.client.container
Class IOCSingletonBean<T>
java.lang.Object
org.jboss.errai.ioc.client.container.AbstractIOCBean<T>
org.jboss.errai.ioc.client.container.IOCDependentBean<T>
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
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 beanqualifiers
- The qualifiers of the bean.name
- The name of the beaninstance
- 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>
Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.