com.caucho.webbeans.component
Class SingletonClassComponent

java.lang.Object
  extended by com.caucho.webbeans.component.ComponentImpl
      extended by com.caucho.webbeans.component.ClassComponent
          extended by com.caucho.webbeans.component.SingletonClassComponent
All Implemented Interfaces:
ObjectProxy, java.io.Closeable, ComponentFactory

public class SingletonClassComponent
extends ClassComponent
implements java.io.Closeable

Configuration for a singleton component.


Field Summary
 
Fields inherited from class com.caucho.webbeans.component.ComponentImpl
_destroyProgram, _initProgram, _injectProgram, _scope, _webbeans
 
Constructor Summary
SingletonClassComponent(WbWebBeans webbeans)
           
 
Method Summary
 void close()
          Frees the singleton on environment shutdown
protected  java.lang.Object createNew(ConfigContext env)
          The singleton instance is created in its original class loader context
 java.lang.Object get()
          Returns the singleton object
 java.lang.Object get(ConfigContext env)
          Returns the singleton object
 java.lang.Object getIfExists()
          Returns the singleton object
protected  java.lang.Object init(java.lang.Object value, ConfigContext env)
          The singleton instance is initialized in its original class loader context
 
Methods inherited from class com.caucho.webbeans.component.ClassComponent
bind, createArg, getInstanceClass, getMBeanInterface, getMBeanName, init, introspect, introspectBindings, introspectConstructor, introspectInterceptors, introspectObservers, setConstructor, setInstanceClass, setMBeanName, setNewArgs
 
Methods inherited from class com.caucho.webbeans.component.ComponentImpl
addNameBinding, addProgram, create, createNoInit, createObject, createProgram, destroy, destroy, equals, error, getBindingList, getClassName, getHandle, getName, getScope, getScopeId, getSimpleName, getTargetClass, getTargetSimpleName, getTargetType, getType, getWebBeans, introspectScope, isDestroyPresent, isFromClass, isMatch, isMatch, isMatchByBinding, isMatchByBinding, isSingleton, setBindingList, setFromClass, setInit, setName, setScope, setTargetType, setType, toDebugString, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SingletonClassComponent

public SingletonClassComponent(WbWebBeans webbeans)
Method Detail

getIfExists

public java.lang.Object getIfExists()
Returns the singleton object

Overrides:
getIfExists in class ComponentImpl

get

public java.lang.Object get()
Returns the singleton object

Specified by:
get in interface ComponentFactory
Overrides:
get in class ComponentImpl

get

public java.lang.Object get(ConfigContext env)
Returns the singleton object

Overrides:
get in class ClassComponent

createNew

protected java.lang.Object createNew(ConfigContext env)
The singleton instance is created in its original class loader context

Overrides:
createNew in class ClassComponent
Parameters:
env - the configuration environment
Returns:
the new object

init

protected java.lang.Object init(java.lang.Object value,
                                ConfigContext env)
The singleton instance is initialized in its original class loader context

Overrides:
init in class ComponentImpl

close

public void close()
Frees the singleton on environment shutdown

Specified by:
close in interface java.io.Closeable