com.caucho.webbeans.component
Class SingletonComponent

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

public class SingletonComponent
extends ClassComponent
implements java.io.Closeable

Component for a singleton beans


Field Summary
 
Fields inherited from class com.caucho.webbeans.component.ComponentImpl
_destroyProgram, _initProgram, _injectProgram, _scope, _webbeans
 
Constructor Summary
SingletonComponent(WbWebBeans webBeans, java.lang.Object value)
           
SingletonComponent(WebBeansContainer webBeans, java.lang.Object value)
           
 
Method Summary
 void bind()
          Binds parameters
 void close()
          Frees the singleton on environment shutdown
 java.lang.Object create()
          Creates a new instance of the component.
protected  java.lang.Object createNew(ConfigContext env)
          Creates a new instance of the component
 java.lang.Object get()
          Returns the component object, creating if necessary
 java.lang.Object get(ConfigContext env)
          Creates a new instance of the component.
 void init()
          Complete initialization
 void introspectConstructor()
          Introspects the constructor
 void setScope(ScopeContext scope)
          Sets the scope annotation.
 
Methods inherited from class com.caucho.webbeans.component.ClassComponent
createArg, getInstanceClass, getMBeanInterface, getMBeanName, introspect, introspectBindings, introspectInterceptors, introspectObservers, setConstructor, setInstanceClass, setMBeanName, setNewArgs
 
Methods inherited from class com.caucho.webbeans.component.ComponentImpl
addNameBinding, addProgram, createNoInit, createObject, createProgram, destroy, destroy, equals, error, getBindingList, getClassName, getHandle, getIfExists, getName, getScope, getScopeId, getSimpleName, getTargetClass, getTargetSimpleName, getTargetType, getType, getWebBeans, init, introspectScope, isDestroyPresent, isFromClass, isMatch, isMatch, isMatchByBinding, isMatchByBinding, isSingleton, setBindingList, setFromClass, setInit, setName, setTargetType, setType, toDebugString, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SingletonComponent

public SingletonComponent(WbWebBeans webBeans,
                          java.lang.Object value)

SingletonComponent

public SingletonComponent(WebBeansContainer webBeans,
                          java.lang.Object value)
Method Detail

bind

public void bind()
Description copied from class: ClassComponent
Binds parameters

Overrides:
bind in class ClassComponent

introspectConstructor

public void introspectConstructor()
Description copied from class: ClassComponent
Introspects the constructor

Overrides:
introspectConstructor in class ClassComponent

init

public void init()
Complete initialization

Overrides:
init in class ClassComponent

setScope

public void setScope(ScopeContext scope)
Description copied from class: ComponentImpl
Sets the scope annotation.

Overrides:
setScope in class ComponentImpl

get

public java.lang.Object get()
Description copied from class: ComponentImpl
Returns the component object, creating if necessary

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

get

public java.lang.Object get(ConfigContext env)
Description copied from class: ClassComponent
Creates a new instance of the component.

Overrides:
get in class ClassComponent

create

public java.lang.Object create()
Description copied from class: ComponentImpl
Creates a new instance of the component.

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

createNew

protected java.lang.Object createNew(ConfigContext env)
Description copied from class: ComponentImpl
Creates a new instance of the component

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

close

public void close()
Frees the singleton on environment shutdown

Specified by:
close in interface java.io.Closeable