com.caucho.ejb.session
Class SingletonManager<X>

java.lang.Object
  extended by com.caucho.ejb.server.AbstractEjbBeanManager<X>
      extended by com.caucho.ejb.session.AbstractSessionManager<X>
          extended by com.caucho.ejb.session.SingletonManager<X>
All Implemented Interfaces:
EnvironmentBean

public class SingletonManager<X>
extends AbstractSessionManager<X>

Server container for a session bean.


Field Summary
 
Fields inherited from class com.caucho.ejb.server.AbstractEjbBeanManager
_ejbClass, _ejbManager, _filename, _line, _location, _mappedName, _ut
 
Constructor Summary
SingletonManager(EjbManager ejbContainer, java.lang.String ejbName, java.lang.String moduleName, AnnotatedType<X> rawAnnType, AnnotatedType<X> annotatedType, EjbLazyGenerator<X> lazyGenerator)
           
 
Method Summary
 void bind()
           
protected
<T> Bean<T>
createBean(ManagedBeanImpl<X> mBean, java.lang.Class<T> api, java.util.Set<java.lang.reflect.Type> apiList, AnnotatedType<X> extAnnType)
           
protected  BeanGenerator<X> createBeanGenerator()
          Creates the bean generator for the session bean.
protected  EjbInjectionTarget<X> createInjectionTarget()
           
protected
<T> SingletonContext<X,T>
createSessionContext(java.lang.Class<T> api)
           
 void destroy()
          Cleans up the entity server nicely.
 void destroy(java.lang.Object instance, CreationalContextImpl<?> env)
           
 void destroyInstance(X instance)
          Destroy an instance
 AbstractContext getContext(java.lang.Object key, boolean forceLoad)
          Finds the remote bean by its key.
protected  java.lang.Class<?> getContextClass()
           
<T> java.lang.Object
getLocalJndiProxy(java.lang.Class<T> api)
          Returns the JNDI proxy object to create instances of the local interface.
<T> T
getRemoteObject(java.lang.Class<T> api, java.lang.String protocol)
          Returns the remote skeleton for the given API
protected  SessionBeanType getSessionBeanType()
           
protected
<T> SingletonContext<X,T>
getSessionContext(java.lang.Class<T> api)
           
protected  java.lang.String getType()
           
<T> T
initProxy(T proxy, CreationalContextImpl<T> env)
           
 X newInstance(CreationalContextImpl<X> env)
           
protected  void postStart()
           
 
Methods inherited from class com.caucho.ejb.session.AbstractSessionManager
createProxyFactory, getBean, getDeployBean, getInjectManager, getLazyGenerator, getLocalApi, getLocalBean, getLocalProxy, getProxyImplClass, getRemoteApi, init
 
Methods inherited from class com.caucho.ejb.server.AbstractEjbBeanManager
bindContext, bindInjection, encodeId, error, getAnnotatedType, getClassLoader, getContext, getContext, getEjbClass, getEjbContainer, getEJBName, getId, getMappedName, getModuleInjectManager, getModuleName, getProtocolId, getProtocolId, getRawAnnotatedType, getRemoteApiList, getServerProgram, getTimerService, getTransactionTimeout, getUserTransaction, hasRemoteObject, invalidateCache, isContainerTransaction, isDead, isDependValid, lookup, registerInjection, setAroundInvoke, setBusinessLocal, setConfigLocation, setContainerTransaction, setEjbClass, setId, setLocation, setMappedName, setRemoteApiList, setResourceList, setServerProgram, setTransactionTimeout, start, timeout, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SingletonManager

public SingletonManager(EjbManager ejbContainer,
                        java.lang.String ejbName,
                        java.lang.String moduleName,
                        AnnotatedType<X> rawAnnType,
                        AnnotatedType<X> annotatedType,
                        EjbLazyGenerator<X> lazyGenerator)
Method Detail

getType

protected java.lang.String getType()
Overrides:
getType in class AbstractSessionManager<X>

getSessionBeanType

protected SessionBeanType getSessionBeanType()
Overrides:
getSessionBeanType in class AbstractSessionManager<X>

getSessionContext

protected <T> SingletonContext<X,T> getSessionContext(java.lang.Class<T> api)
Overrides:
getSessionContext in class AbstractSessionManager<X>

createInjectionTarget

protected EjbInjectionTarget<X> createInjectionTarget()
Overrides:
createInjectionTarget in class AbstractEjbBeanManager<X>

getLocalJndiProxy

public <T> java.lang.Object getLocalJndiProxy(java.lang.Class<T> api)
Returns the JNDI proxy object to create instances of the local interface.

Specified by:
getLocalJndiProxy in class AbstractEjbBeanManager<X>
Parameters:
api - the bean's api to return a value for

bind

public void bind()
Overrides:
bind in class AbstractSessionManager<X>

newInstance

public X newInstance(CreationalContextImpl<X> env)
Overrides:
newInstance in class AbstractEjbBeanManager<X>

postStart

protected void postStart()
Overrides:
postStart in class AbstractEjbBeanManager<X>

initProxy

public <T> T initProxy(T proxy,
                       CreationalContextImpl<T> env)

destroy

public void destroy(java.lang.Object instance,
                    CreationalContextImpl<?> env)
Overrides:
destroy in class AbstractEjbBeanManager<X>

destroyInstance

public void destroyInstance(X instance)
Destroy an instance

Overrides:
destroyInstance in class AbstractEjbBeanManager<X>

createBean

protected <T> Bean<T> createBean(ManagedBeanImpl<X> mBean,
                                 java.lang.Class<T> api,
                                 java.util.Set<java.lang.reflect.Type> apiList,
                                 AnnotatedType<X> extAnnType)
Specified by:
createBean in class AbstractSessionManager<X>

createSessionContext

protected <T> SingletonContext<X,T> createSessionContext(java.lang.Class<T> api)
Overrides:
createSessionContext in class AbstractSessionManager<X>

getContextClass

protected java.lang.Class<?> getContextClass()
Overrides:
getContextClass in class AbstractSessionManager<X>

createBeanGenerator

protected BeanGenerator<X> createBeanGenerator()
Creates the bean generator for the session bean.

Overrides:
createBeanGenerator in class AbstractSessionManager<X>

getContext

public AbstractContext getContext(java.lang.Object key,
                                  boolean forceLoad)
                           throws FinderException
Finds the remote bean by its key.

Specified by:
getContext in class AbstractEjbBeanManager<X>
Parameters:
key - the remote key
Returns:
the remote interface of the entity.
Throws:
FinderException

destroy

public void destroy()
Cleans up the entity server nicely.

Overrides:
destroy in class AbstractSessionManager<X>

getRemoteObject

public <T> T getRemoteObject(java.lang.Class<T> api,
                             java.lang.String protocol)
Description copied from class: AbstractEjbBeanManager
Returns the remote skeleton for the given API

Specified by:
getRemoteObject in class AbstractEjbBeanManager<X>
Parameters:
api - the bean's api to return a value for
protocol - the remote protocol