com.caucho.config.inject
Class SingletonBean<T>
java.lang.Object
com.caucho.config.inject.AbstractBean<T>
com.caucho.config.inject.BeanAdapter<T,T>
com.caucho.config.inject.BeanWrapper<T>
com.caucho.config.inject.AbstractSingletonBean<T>
com.caucho.config.inject.SingletonBean<T>
- All Implemented Interfaces:
- AnnotatedBean, ObjectProxy, java.io.Closeable, Contextual<T>, Bean<T>, PassivationCapable
public class SingletonBean<T>
- extends AbstractSingletonBean<T>
- implements java.io.Closeable
SingletonBean represents a singleton instance exported as a web beans.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
create
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.
- create an instance of the bean
- create interceptor and decorator stacks
- inject dependencies
- set any XML-configured values
- call @PostConstruct
- Specified by:
create
in interface Contextual<T>
- Specified by:
create
in class AbstractSingletonBean<T>
- Parameters:
env
- the creation context used to support circular
references.
- Returns:
- the new instance
getInjectionPoints
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>
- Overrides:
getInjectionPoints
in class BeanAdapter<T,T>
close
public void close()
- Frees the singleton on environment shutdown
- Specified by:
close
in interface java.io.Closeable
- Overrides:
close
in class AbstractSingletonBean<T>