Package com.sun.ejb.containers
Class AbstractSingletonContainer
- java.lang.Object
-
- com.sun.ejb.containers.BaseContainer
-
- com.sun.ejb.containers.AbstractSingletonContainer
-
- All Implemented Interfaces:
Container,com.sun.enterprise.container.common.spi.JavaEEContainer,org.glassfish.enterprise.iiop.spi.EjbContainerFacade
- Direct Known Subclasses:
BMCSingletonContainer,CMCSingletonContainer
public abstract class AbstractSingletonContainer extends BaseContainer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classAbstractSingletonContainer.SingletonContextFactory-
Nested classes/interfaces inherited from class com.sun.ejb.containers.BaseContainer
BaseContainer.ContainerInfo, BaseContainer.ContainerType, BaseContainer.PreInvokeException
-
-
Field Summary
Fields Modifier and Type Field Description protected ComponentContextsingletonCtxprotected ObjectFactorysingletonCtxFactoryprotected booleansingletonInitializationFailedprotected AtomicBooleansingletonInitialized-
Fields inherited from class com.sun.ejb.containers.BaseContainer
_logger, cacheProbeListener, cacheProbeNotifier, callFlowInfo, componentId, CONTAINER_INITIALIZING, CONTAINER_ON_HOLD, CONTAINER_STARTED, CONTAINER_STOPPED, CONTAINER_UNDEPLOYED, containerInfo, containerState, containerStateManager, containerTransactionManager, containerType, debugMonitorFlag, ejbActivateMethod, ejbClass, ejbContainerUtilImpl, ejbDescriptor, ejbGeneratedOptionalLocalBusinessIntfClass, ejbHome, ejbHomeImpl, ejbHomeStub, ejbIntfMethodInfo, ejbIntfMethods, ejbLocalBusinessHome, ejbLocalBusinessHomeImpl, ejbLocalHome, ejbLocalHomeImpl, EJBLocalObject_getPrimaryKey, EJBObject_getPrimaryKey, ejbOptionalLocalBusinessHome, ejbOptionalLocalBusinessHomeImpl, ejbOptionalLocalBusinessHomeIntf, ejbPassivateMethod, ejbProbeListener, ejbProbeNotifier, ejbRemoteBusinessHome, ejbRemoteBusinessHomeImpl, ejbRemoteBusinessHomeStub, ejbRemoveMethod, envProps, hasLocalBusinessView, hasLocalHomeView, hasOptionalLocalBusinessView, hasRemoteBusinessView, hasRemoteHomeView, homeIntf, injectionManager, interceptorManager, invocationInfoMap, invocationManager, isBeanManagedTran, isLocal, isMessageDriven, isRemote, isSession, isSingleton, isStatefulSession, isStatelessSession, isWebServiceEndpoint, loader, localBusinessHomeIntf, localBusinessIntfs, localHomeIntf, logParams, metadata, methodMonitorMap, monitorOn, namingManager, NO_PARAMS, optIntfClassLoader, poolProbeListener, remoteBusinessHomeIntf, remoteBusinessIntfInfo, remoteHomeRefFactory, remoteIntf, scheduleIds, securityManager, sfsbSerializedClass, SINGLETON_BEAN_POOL_PROP, timerProbeListener, timerProbeNotifier, transactionManager, webServiceEndpointIntf, webServiceInvocationInfoMap
-
Fields inherited from interface com.sun.ejb.Container
SEC_CHECKED, SEC_EXCLUDED, SEC_NOT_INITIALIZED, SEC_UNCHECKED, secAttrStrings, TX_BEAN_MANAGED, TX_MANDATORY, TX_NEVER, TX_NOT_INITIALIZED, TX_NOT_SUPPORTED, TX_REQUIRED, TX_REQUIRES_NEW, TX_SUPPORTS, txAttrStrings
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractSingletonContainer(EjbDescriptor desc, ClassLoader loader, com.sun.enterprise.security.SecurityManager sm)This constructor is called from the JarManager when a Jar is deployed.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected EJBContextImpl_constructEJBContextImpl(Object instance)voidactivateEJB(Object ctx, Object instanceKey)protected voidafterBegin(EJBContextImpl context)protected voidafterCompletion(EJBContextImpl ctx, int status)protected voidbeforeCompletion(EJBContextImpl context)protected voidcheckExists(EJBLocalRemoteObject ejbObj)Check if the given EJBObject/LocalObject has been removed.protected voidcheckInit()protected EjbInvocationcreateEjbInvocation()protected EjbInvocationcreateEjbInvocation(Object ejb, ComponentContext ctx)EJBLocalObjectImplcreateEJBLocalBusinessObjectImpl(boolean localBeanView)Called during internal creation of session beanEJBLocalObjectImplcreateEJBLocalObjectImpl()Called during client creation request through EJB LocalHome view.EJBObjectImplcreateEJBObjectImpl()EJBObjectImplcreateRemoteBusinessObjectImpl()protected voiddoConcreteContainerShutdown(boolean appBeingUndeployed)TODO public void appendStats(StringBuffer sbuf) { sbuf.append("\nSingletonContainer: ") .append("CreateCount=").append(statCreateCount).append("; ") .append("RemoveCount=").append(statRemoveCount).append("; ") .append("]"); }protected voiddoTimerInvocationInit(EjbInvocation inv, Object primaryKey)This is implemented by concrete containers that support TimedObjects.protected voidforceDestroyBean(EJBContextImpl sc)Force destroy the EJB should be a no-op for singletons.protected EJBLocalObjectImplgetEJBLocalObjectImpl(Object key)Not applicable to Singletonsprotected EJBObjectImplgetEJBObjectImpl(byte[] instanceKey)Not applicable to SingletonsintgetMaxPoolSize()longgetMethodReadyCount()StringgetMonitorAttributeValues()protected EjbMonitoringStatsProvidergetMonitoringStatsProvider(String appName, String modName, String ejbName)intgetSteadyPoolSize()protected voidinitializeHome()Called from the ContainerFactory during initialization.ComponentContextinstantiateSingletonInstance()voidonReady()Called when server instance is ReadybooleanpassivateEJB(ComponentContext context)protected voidregisterMonitorableComponents()protected voidremoveBean(EJBLocalRemoteObject ejbo, Method removeMethod, boolean local)voidsetSingletonLifeCycleManager(SingletonLifeCycleManager lcm)booleanuserTransactionMethodsAllowed(org.glassfish.api.invocation.ComponentInvocation inv)EJB spec makes a distinction between access to the UserTransaction object itself and access to its methods.-
Methods inherited from class com.sun.ejb.containers.BaseContainer
_constructEJBInstance, _getContext, addInvocationInfo, addLocalRemoteInvocationInfo, addProxyInterfacesSetClass, adjustHomeTargetMethodInfo, adjustInvocationInfo, assertValidLocalObject, assertValidRemoteObject, authorize, authorizeLocalGetPrimaryKey, authorizeLocalMethod, authorizeRemoteGetPrimaryKey, authorizeRemoteMethod, callEJBTimeout, cancelTimers, checkExceptionClientTx, checkUnfinishedTx, checkUserTransactionLookup, cleanupInstance, containerStateToString, createCallFlowAgent, createEjbInstanceAndContext, createEjbInstanceForInterceptors, createMonitoringRegistry, createRemoteReferenceWithId, delistExtendedEntityManagers, doAfterBegin, doEJBHomeRemove, doFlush, enlistExtendedEntityManagers, externalPostInvoke, externalPreInvoke, findFlushEnabledAttr, getApplicationId, getClassLoader, getComponentId, getContainerClassLoader, getContainerId, getContainerType, getContext, getDebugMonitorFlag, getDescriptor, getEJBClass, getEjbDescriptor, getEJBHome, getEJBHomeInvocationHandler, getEJBHomeStub, getEJBLocalBusinessHome, getEJBLocalHome, getEJBLocalHomeInvocationHandler, getEJBLocalObjectForPrimaryKey, getEJBLocalObjectForPrimaryKey, getEJBMetaData, getEJBObjectForPrimaryKey, getInvocationKey, getJaccEjb, getJavaGlobalJndiNamePrefix, getMonitoringMethodsArray, getMonitoringMethodsArray, getPassByReference, getPre30LifecycleMethodNames, getProtocolManager, getSecurityManager, getTargetObject, getTimeoutMethod, getTxAttr, getTxAttr, getTxAttrForLifecycleCallback, getUserTransaction, getUseThreadPoolId, incrementCreatedTimedObject, incrementDeliveredTimedObject, incrementRemovedTimedObject, initializeProtocolManager, injectEjbInstance, instantiateEJBLocalBusinessObjectImpl, instantiateEJBLocalObjectImpl, instantiateEJBLocalObjectImpl, instantiateEJBObjectImpl, instantiateEJBObjectImpl, instantiateOptionalEJBLocalBusinessObjectImpl, instantiateRemoteBusinessObjectImpl, intercept, intercept, invokeBeanMethod, invokeFindByPrimaryKey, invokeTargetBeanMethod, isApplicationException, isCreateHomeFinder, isEjbTimeoutMethod, isHAEnabled, isIdentical, isLocalInterfaceSupported, isLocalObject, isRemoteInterfaceSupported, isRemoteObject, isStopped, isSystemUncheckedException, isTimedObject, isUndeployed, lookupExtendedEntityManager, onEnteringContainer, onLeavingContainer, onShutdown, onTermination, postCreate, postEjbTimeout, postFind, postInvoke, postInvoke, postInvokeNoTx, postInvokeTx, postProcessInvocationInfo, preInitialize, preInvoke, preInvokeNoTx, preInvokeTx, prepareEjbTimeoutParams, preSelect, registerTimerMonitorableComponent, releaseContext, releaseTargetObject, removeBeanUnchecked, removeBeanUnchecked, resumeTransaction, scanForEjbCreateMethod, setDebugMonitorFlag, setEJBMetaData, setStartedState, setStoppedState, setUndeployedState, startApplication, suspendTransaction, toString, undeploy, useClientTx, validateEMForClientTx, validateTxAttr, webServicePostInvoke
-
-
-
-
Field Detail
-
singletonCtxFactory
protected ObjectFactory singletonCtxFactory
-
singletonInitialized
protected AtomicBoolean singletonInitialized
-
singletonInitializationFailed
protected boolean singletonInitializationFailed
-
singletonCtx
protected volatile ComponentContext singletonCtx
-
-
Constructor Detail
-
AbstractSingletonContainer
protected AbstractSingletonContainer(EjbDescriptor desc, ClassLoader loader, com.sun.enterprise.security.SecurityManager sm) throws Exception
This constructor is called from the JarManager when a Jar is deployed.- Throws:
Exception- on error
-
-
Method Detail
-
getMonitorAttributeValues
public String getMonitorAttributeValues()
-
createEjbInvocation
protected EjbInvocation createEjbInvocation(Object ejb, ComponentContext ctx)
- Overrides:
createEjbInvocationin classBaseContainer
-
createEjbInvocation
protected EjbInvocation createEjbInvocation()
- Overrides:
createEjbInvocationin classBaseContainer
-
initializeHome
protected void initializeHome() throws ExceptionDescription copied from class:BaseContainerCalled from the ContainerFactory during initialization.- Overrides:
initializeHomein classBaseContainer- Throws:
Exception
-
registerMonitorableComponents
protected void registerMonitorableComponents()
- Overrides:
registerMonitorableComponentsin classBaseContainer
-
getMonitoringStatsProvider
protected EjbMonitoringStatsProvider getMonitoringStatsProvider(String appName, String modName, String ejbName)
- Specified by:
getMonitoringStatsProviderin classBaseContainer
-
onReady
public void onReady()
Description copied from class:BaseContainerCalled when server instance is Ready- Specified by:
onReadyin interfaceContainer- Overrides:
onReadyin classBaseContainer
-
createRemoteBusinessObjectImpl
public EJBObjectImpl createRemoteBusinessObjectImpl() throws jakarta.ejb.CreateException, RemoteException
- Throws:
jakarta.ejb.CreateExceptionRemoteException
-
createEJBObjectImpl
public EJBObjectImpl createEJBObjectImpl() throws jakarta.ejb.CreateException, RemoteException
- Specified by:
createEJBObjectImplin classBaseContainer- Throws:
jakarta.ejb.CreateExceptionRemoteException
-
createEJBLocalObjectImpl
public EJBLocalObjectImpl createEJBLocalObjectImpl() throws jakarta.ejb.CreateException
Called during client creation request through EJB LocalHome view.- Overrides:
createEJBLocalObjectImplin classBaseContainer- Throws:
jakarta.ejb.CreateException
-
createEJBLocalBusinessObjectImpl
public EJBLocalObjectImpl createEJBLocalBusinessObjectImpl(boolean localBeanView) throws jakarta.ejb.CreateException
Called during internal creation of session bean- Throws:
jakarta.ejb.CreateException
-
removeBean
protected void removeBean(EJBLocalRemoteObject ejbo, Method removeMethod, boolean local) throws jakarta.ejb.RemoveException, jakarta.ejb.EJBException, RemoteException
- Specified by:
removeBeanin classBaseContainer- Throws:
jakarta.ejb.RemoveExceptionjakarta.ejb.EJBExceptionRemoteException
-
forceDestroyBean
protected void forceDestroyBean(EJBContextImpl sc)
Force destroy the EJB should be a no-op for singletons. After Initialization completes successfully, runtime exceptions during invocations on the Singleton do not result in the instance being destroyed.- Specified by:
forceDestroyBeanin classBaseContainer
-
getEJBObjectImpl
protected EJBObjectImpl getEJBObjectImpl(byte[] instanceKey)
Not applicable to Singletons- Specified by:
getEJBObjectImplin classBaseContainer
-
getEJBLocalObjectImpl
protected EJBLocalObjectImpl getEJBLocalObjectImpl(Object key)
Not applicable to Singletons- Overrides:
getEJBLocalObjectImplin classBaseContainer
-
setSingletonLifeCycleManager
public void setSingletonLifeCycleManager(SingletonLifeCycleManager lcm)
-
checkInit
protected void checkInit()
-
instantiateSingletonInstance
public ComponentContext instantiateSingletonInstance()
-
_constructEJBContextImpl
protected EJBContextImpl _constructEJBContextImpl(Object instance)
- Overrides:
_constructEJBContextImplin classBaseContainer
-
doTimerInvocationInit
protected void doTimerInvocationInit(EjbInvocation inv, Object primaryKey) throws Exception
Description copied from class:BaseContainerThis is implemented by concrete containers that support TimedObjects.- Overrides:
doTimerInvocationInitin classBaseContainer- Throws:
Exception
-
userTransactionMethodsAllowed
public boolean userTransactionMethodsAllowed(org.glassfish.api.invocation.ComponentInvocation inv)
Description copied from class:BaseContainerEJB spec makes a distinction between access to the UserTransaction object itself and access to its methods. getUserTransaction covers the first check and this method covers the second. It is called by the UserTransaction implementation to verify access.- Specified by:
userTransactionMethodsAllowedin interfaceContainer- Overrides:
userTransactionMethodsAllowedin classBaseContainer
-
checkExists
protected void checkExists(EJBLocalRemoteObject ejbObj)
Check if the given EJBObject/LocalObject has been removed.- Overrides:
checkExistsin classBaseContainer- Throws:
jakarta.ejb.NoSuchObjectLocalException- if the object has been removed.
-
afterBegin
protected void afterBegin(EJBContextImpl context)
- Specified by:
afterBeginin classBaseContainer
-
beforeCompletion
protected void beforeCompletion(EJBContextImpl context)
- Specified by:
beforeCompletionin classBaseContainer
-
afterCompletion
protected void afterCompletion(EJBContextImpl ctx, int status)
- Specified by:
afterCompletionin classBaseContainer
-
passivateEJB
public boolean passivateEJB(ComponentContext context)
- Specified by:
passivateEJBin classBaseContainer
-
doConcreteContainerShutdown
protected void doConcreteContainerShutdown(boolean appBeingUndeployed)
TODO public void appendStats(StringBuffer sbuf) { sbuf.append("\nSingletonContainer: ") .append("CreateCount=").append(statCreateCount).append("; ") .append("RemoveCount=").append(statRemoveCount).append("; ") .append("]"); }- Specified by:
doConcreteContainerShutdownin classBaseContainer
-
getMethodReadyCount
public long getMethodReadyCount()
-
getMaxPoolSize
public int getMaxPoolSize()
-
getSteadyPoolSize
public int getSteadyPoolSize()
-
-