Class SingletonBean<T>

  extended by com.caucho.config.inject.AbstractBean<T>
      extended by com.caucho.config.inject.BeanAdapter<T,T>
          extended by com.caucho.config.inject.BeanWrapper<T>
              extended by com.caucho.config.inject.AbstractSingletonBean<T>
                  extended by com.caucho.config.inject.SingletonBean<T>
All Implemented Interfaces:
AnnotatedBean, ObjectProxy,, Contextual<T>, Bean<T>, PassivationCapable

public class SingletonBean<T>
extends AbstractSingletonBean<T>

SingletonBean represents a singleton instance exported as a web beans.

Method Summary
 void close()
          Frees the singleton on environment shutdown
 T create(CreationalContext<T> env)
          Creates a new instance for the Contextual's type.
 java.util.Set<InjectionPoint> getInjectionPoints()
          Returns the set of injection points, for validation.
Methods inherited from class com.caucho.config.inject.AbstractSingletonBean
getAnnotated, getAnnotatedType, getId, getName, getQualifiers, getScope, getStereotypes, getTypes, introspectProduces
Methods inherited from class com.caucho.config.inject.BeanWrapper
Methods inherited from class com.caucho.config.inject.BeanAdapter
getBean, getBeanClass, isAlternative, isNullable
Methods inherited from class com.caucho.config.inject.AbstractBean
calculatePassivationId, createObject, getBeanManager, getInjectionTarget, getJavaClass, introspect, isPassivationCapable, toDisplayString, toDisplayStringImpl, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Method Detail


public T create(CreationalContext<T> env)
Description copied from interface: Contextual
Creates a new instance for the Contextual's type. If the instance already exists in the CreationalContext, create will return it instead of creating a new instance.
  1. create an instance of the bean
  2. create interceptor and decorator stacks
  3. inject dependencies
  4. set any XML-configured values
  5. call @PostConstruct

Specified by:
create in interface Contextual<T>
Specified by:
create in class AbstractSingletonBean<T>
env - the creation context used to support circular references.
the new instance


public java.util.Set<InjectionPoint> getInjectionPoints()
Description copied from interface: Bean
Returns the set of injection points, for validation.

Specified by:
getInjectionPoints in interface Bean<T>
getInjectionPoints in class BeanAdapter<T,T>


public void close()
Frees the singleton on environment shutdown

Specified by:
close in interface
close in class AbstractSingletonBean<T>