Class EntityContainer
- All Implemented Interfaces:
com.sun.appserv.util.cache.CacheListener,com.sun.ejb.Container,com.sun.enterprise.container.common.spi.JavaEEContainer,org.glassfish.enterprise.iiop.spi.EjbContainerFacade
- Direct Known Subclasses:
CommitCEntityContainer,ReadOnlyBeanContainer
The following sequence of actions happens for the EntityContainer, for each EJB lifecycle stage (note: getEJBObject, getContext, releaseContext, preInvokeTx, postInvokeTx are called from BaseContainer). 1. EJB Creation homeImpl.create, container.getContext, container.preInvokeTx, ejb.ejbCreate, container.postCreate, ejb.ejbPostCreate, container.postInvokeTx, container.releaseContext 2. EJB Finding homeImpl.find---, container.getContext, container.preInvokeTx, ejb.ejbFind---, container.postFind, container.postInvokeTx, container.releaseContext 3. EJB Invocation container.getEJBObject, ejbObject.someMethod, container.getContext, container.preInvokeTx, ejb.someMethod, container.postInvokeTx, container.releaseContext
State Management: The EntityContainer manages collections of EJBs in different states. The 5 states of an EntityBean (an EJB can be in only 1 state at a time):
- 1. POOLED : does not have identity. EJBs in the POOLED state are all identical, hence are maintained in a java.util.Vector, whose size is maintained below a HIGH_WATER_MARK (currently 100).
- 2. READY : ready for invocations, no transaction in progress. EJBs in the READY state are associated with a primary key. To enhance reuse of EJB instances, only one READY EJB per primary key is stored. READY EJBs are managed by the ejbstore/EntityStore class. READY EJBs are looked up using a key consisting of the primary key and a null transaction context.
- 3. INVOKING : processing an invocation. EJBs in the INVOKING state are not stored anywhere. Before transitioning from READY or INCOMPLETE_TX to INVOKING, the EJB is removed from the EntityStore.
- 4. INCOMPLETE_TX : ready for invocations, transaction in progress. EJBs in the INCOMPLETE_TX state are associated with a primary key. INCOMPLETE_TX EJBs are managed by the ejbstore/EntityStore class. INCOMPLETE_TX EJBs are looked up using a composite key consisting of the primary key and the transaction context.
- 5. DESTROYED : does not exist.
- Author:
- Mahesh Kannan, Shanker N, Pramod Gopinath
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected classprotected classNested classes/interfaces inherited from class com.sun.ejb.containers.BaseContainer
com.sun.ejb.containers.BaseContainer.ContainerInfo, com.sun.ejb.containers.BaseContainer.ContainerType, com.sun.ejb.containers.BaseContainer.PreInvokeException -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected org.glassfish.ejb.deployment.descriptor.runtime.BeanCacheDescriptorprotected com.sun.enterprise.deployment.runtime.BeanPoolDescriptorprotected final intprotected final floatprotected booleanprotected org.glassfish.ejb.config.EjbContainerprotected EJBObjectCacheprotected EJBObjectCacheprotected intprotected com.sun.ejb.containers.util.pool.AbstractPoolprotected static final intprotected org.glassfish.ejb.deployment.descriptor.runtime.IASEjbExtraDescriptorsprotected org.glassfish.persistence.ejb.entitybean.container.EntityContainer.IdleBeansPassivatorprotected org.glassfish.persistence.ejb.entitybean.container.EntityContainer.IdleBeansPassivatorprotected booleanprotected booleanprotected Stackprotected com.sun.appserv.util.cache.Cacheprotected intprotected intFields inherited from class com.sun.ejb.containers.BaseContainer
cacheProbeListener, cacheProbeNotifier, callFlowInfo, componentId, CONTAINER_INITIALIZING, CONTAINER_ON_HOLD, CONTAINER_STARTED, CONTAINER_STOPPED, CONTAINER_UNDEPLOYED, containerInfo, containerState, containerStateManager, containerTransactionManager, 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, metadata, methodMonitorMap, monitorOn, namingManager, NO_PARAMS, optIntfClassLoader, poolProbeListener, remoteBusinessHomeIntf, remoteBusinessIntfInfo, remoteHomeRefFactory, remoteIntf, scheduleIds, securityManager, sfsbSerializedClass, SINGLETON_BEAN_POOL_PROP, timerProbeListener, timerProbeNotifier, transactionManager, webServiceEndpointIntf, webServiceInvocationInfoMapFields 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
ConstructorsModifierConstructorDescriptionprotectedEntityContainer(com.sun.ejb.containers.BaseContainer.ContainerType containerType, org.glassfish.ejb.deployment.descriptor.EjbDescriptor desc, ClassLoader loader, com.sun.enterprise.security.SecurityManager sm) protectedEntityContainer(org.glassfish.ejb.deployment.descriptor.EjbDescriptor desc, ClassLoader loader, com.sun.enterprise.security.SecurityManager sm) This constructor is called from the JarManager when a Jar is deployed. -
Method Summary
Modifier and TypeMethodDescriptionprotected com.sun.ejb.ComponentContext_getContext(com.sun.ejb.EjbInvocation inv) Called from BaseContainer.preInvoke which is called from the EJBObject for local and remote invocations, and from the EJBHome for create/find.protected EntityContextImplactivateEJBFromPool(Object primaryKey, com.sun.ejb.EjbInvocation inv) Called from getContext and getEJBWithIncompleteTx Get an EJB in the ready state (i.e.protected voidaddPooledEJB(EntityContextImpl context) protected voidaddProxyInterfacesSetClass(Set proxyInterfacesSet, boolean local) protected voidaddReadyEJB(EntityContextImpl context) protected voidadjustHomeTargetMethodInfo(com.sun.ejb.InvocationInfo invInfo, String methodName, Class[] paramTypes) protected voidadjustInvocationInfo(com.sun.ejb.InvocationInfo invInfo, Method method, int txAttr, boolean flushEnabled, String methodIntf, Class originalIntf) protected voidafterBegin(com.sun.ejb.containers.EJBContextImpl ctx) protected voidafterCompletion(com.sun.ejb.containers.EJBContextImpl ctx, int status) protected voidafterNewlyActivated(EntityContextImpl context) protected voidauthorizeLocalGetPrimaryKey(com.sun.ejb.containers.EJBLocalRemoteObject ejbObj) protected voidauthorizeRemoteGetPrimaryKey(com.sun.ejb.containers.EJBLocalRemoteObject ejbObj) protected voidbeforeCompletion(com.sun.ejb.containers.EJBContextImpl ctx) protected voidcallEJBLoad(jakarta.ejb.EntityBean ejb, EntityContextImpl context, boolean activeTx) protected voidcallEJBRemove(jakarta.ejb.EntityBean ejb, EntityContextImpl context) protected voidcallEJBStore(jakarta.ejb.EntityBean ejb, EntityContextImpl context) voidcancel a timer task to trim timed out entries in the cache.protected voidcheckExists(com.sun.ejb.containers.EJBLocalRemoteObject ejbObj) Check if the given EJBObject/LocalObject has been removed.protected voidcheckUnfinishedTx(jakarta.transaction.Transaction prevTx, com.sun.ejb.EjbInvocation inv) protected com.sun.ejb.containers.EJBLocalObjectImplprotected com.sun.ejb.containers.EJBObjectImplImplementation of BaseContainer method.protected voidcreateEJBObjectStores(int cacheSize, int numberOfVictimsToSelect, long idleTimeout) protected EntityContextImplcreateEntityContextInstance(jakarta.ejb.EntityBean ejb, EntityContainer entityContainer) protected voidcreateReadyStore(int cacheSize, int numberOfVictimsToSelect, float loadFactor, long idleTimeout) protected voidprotected voiddoConcreteContainerShutdown(boolean appBeingUndeployed) protected voiddoEJBHomeRemove(Object primaryKey, Method removeMethod, boolean local) protected voiddoFlush(com.sun.ejb.EjbInvocation inv) protected voiddoTimerInvocationInit(com.sun.ejb.EjbInvocation inv, Object primaryKey) protected voidforceDestroyBean(com.sun.ejb.containers.EJBContextImpl ctx) Discard the bean instance.protected com.sun.ejb.containers.EJBHomeInvocationHandlergetEJBHomeInvocationHandler(Class homeIntfClass) protected com.sun.ejb.containers.EJBLocalHomeInvocationHandlergetEJBLocalHomeInvocationHandler(Class homeIntfClass) jakarta.ejb.EJBLocalObjectCalled only from the Persistence Manager for EJB2.0 CMP EntityBeans.jakarta.ejb.EJBLocalObjectgetEJBLocalObjectForPrimaryKey(Object pkey, jakarta.ejb.EJBContext ctx) Called only from the Persistence Manager for EJB2.0 CMP EntityBeans.protected com.sun.ejb.containers.EJBLocalObjectImplCalled from EJBLocalObjectImpl.getLocalObject() while deserializing a local object reference.jakarta.ejb.EJBObjectCalled only from the Persistence Manager for EJB2.0 CMP EntityBeans.protected com.sun.ejb.containers.EJBObjectImplgetEJBObjectImpl(byte[] streamKey) Called when a remote EjbInvocation arrives for an EJB.intintprotected com.sun.ejb.monitoring.stats.EjbMonitoringStatsProvidergetMonitoringStatsProvider(String appName, String modName, String ejbName) longprotected EntityContextImpllongprotected EntityContextImplgetReadyEJB(com.sun.ejb.EjbInvocation inv) intprotected voidCalled from the ContainerFactory during initialization.protected com.sun.ejb.containers.EJBLocalObjectImplinternalGetEJBLocalObjectImpl(Object primaryKey) The following are private methods for implementing internal logic for lifecyle and state management, in a reusable way.protected com.sun.ejb.containers.EJBLocalObjectImplinternalGetEJBLocalObjectImpl(Object primaryKey, boolean incrementRefCount) protected com.sun.ejb.containers.EJBLocalObjectImplinternalGetEJBLocalObjectImpl(Object primaryKey, boolean incrementRefCount, boolean cacheEJBO) protected ObjectinvokeFindByPrimaryKey(Method method, com.sun.ejb.EjbInvocation inv, Object[] args) protected booleanisIdentical(com.sun.ejb.containers.EJBObjectImpl ejbObjImpl, jakarta.ejb.EJBObject other) voidonReady()protected voidpassivateAndPoolEJB(EntityContextImpl context) protected booleanpassivateEJB(com.sun.ejb.ComponentContext ctx) voidpostCreate(com.sun.ejb.EjbInvocation inv, Object primaryKey) This is called from the generated "HelloEJBHomeImpl" create* method, after ejb.ejbCreate() has been called and before ejb.ejbPostCreate() is called.Convert a collection of primary keys to a collection of EJBObjects.protected voidpostInvokeNoTx(com.sun.ejb.EjbInvocation inv) protected com.sun.ejb.InvocationInfopostProcessInvocationInfo(com.sun.ejb.InvocationInfo invInfo) protected voidpreCreate(com.sun.ejb.EjbInvocation inv, EntityContextImpl context) Called from getContext before the ejb.ejbCreate is calledprotected voidpreFind(com.sun.ejb.EjbInvocation inv, EntityContextImpl context) Called from getContext before the ejb.ejbFind* is calledprotected voidpreInitialize(org.glassfish.ejb.deployment.descriptor.EjbDescriptor desc, ClassLoader loader) protected voidpreInvokeNoTx(com.sun.ejb.EjbInvocation inv) voidCalled from CMP PersistentManagerprotected voidvoidreleaseContext(com.sun.ejb.EjbInvocation inv) This is called from BaseContainer.postInvoke after EntityContainer.preInvokeTx has been called.protected voidremoveBean(com.sun.ejb.containers.EJBLocalRemoteObject ejbo, Method removeMethod, boolean local) protected voidremoveBean(com.sun.ejb.EjbInvocation inv) container.preInvoke() must already be done.voidremoveBeanUnchecked(jakarta.ejb.EJBLocalObject localObj) Remove a bean.voidremoveBeanUnchecked(Object primaryKey) Remove a bean.protected voidremoveContextFromReadyStore(Object primaryKey, EntityContextImpl context) protected voidremoveIncompleteTxEJB(EntityContextImpl context, boolean updateTxBeanTable) Called from releaseContext if ejb is removed, from afterCompletion, and from passivateEJB.protected voidorg.glassfish.persistence.ejb.entitybean.container.EntityContainer.IdleBeansPassivatorsetupIdleBeansPassivator(com.sun.appserv.util.cache.Cache cache) setup a timer task to trim timed out entries in the cache.voidprotected voidvalidateTxAttr(com.sun.enterprise.deployment.MethodDescriptor md, int txAttr) protected booleanwillInvokeWithClientTx(com.sun.ejb.EjbInvocation inv) Methods inherited from class com.sun.ejb.containers.BaseContainer
_constructEJBContextImpl, _constructEJBInstance, addInvocationInfo, addLocalRemoteInvocationInfo, assertValidLocalObject, assertValidRemoteObject, authorize, authorizeLocalMethod, authorizeRemoteMethod, callEJBTimeout, cancelTimers, checkExceptionClientTx, checkUserTransactionLookup, cleanupInstance, containerStateToString, createCallFlowAgent, createEjbInstanceAndContext, createEjbInstanceForInterceptors, createEjbInvocation, createEjbInvocation, createMonitoringRegistry, createRemoteReferenceWithId, delistExtendedEntityManagers, doAfterBegin, enlistExtendedEntityManagers, externalPostInvoke, externalPreInvoke, findFlushEnabledAttr, getApplicationId, getClassLoader, getComponentId, getContainerClassLoader, getContainerId, getContainerInfo, getContext, getDebugMonitorFlag, getDescriptor, getEJBClass, getEjbDescriptor, getEJBHome, getEJBHomeStub, getEJBLocalBusinessHome, getEJBLocalHome, getEJBMetaData, 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, invokeTargetBeanMethod, isApplicationException, isCreateHomeFinder, isEjbTimeoutMethod, isHAEnabled, isLocalInterfaceSupported, isLocalObject, isRemoteInterfaceSupported, isRemoteObject, isStopped, isSystemUncheckedException, isTimedObject, isUndeployed, lookupExtendedEntityManager, onEnteringContainer, onLeavingContainer, onShutdown, onTermination, postEjbTimeout, postInvoke, postInvoke, postInvokeTx, preInvoke, preInvokeTx, prepareEjbTimeoutParams, registerSystemInterceptor, registerTimerMonitorableComponent, releaseTargetObject, resumeTransaction, scanForEjbCreateMethod, setDebugMonitorFlag, setStartedState, setStoppedState, setUndeployedState, startApplication, suspendTransaction, toString, undeploy, useClientTx, userTransactionMethodsAllowed, validateEMForClientTx, webServicePostInvoke
-
Field Details
-
HIGH_WATER_MARK
protected static final int HIGH_WATER_MARK- See Also:
-
ejbObjectStore
-
ejbLocalObjectStore
-
passivationCandidates
-
readyStore
protected com.sun.appserv.util.cache.Cache readyStore -
entityCtxPool
protected com.sun.ejb.containers.util.pool.AbstractPool entityCtxPool -
isReentrant
protected boolean isReentrant -
isContainerManagedPers
protected boolean isContainerManagedPers -
DEFAULT_LOAD_FACTOR
protected final float DEFAULT_LOAD_FACTOR- See Also:
-
DEFAULT_CACHE_SIZE
protected final int DEFAULT_CACHE_SIZE- See Also:
-
_maxBuckets
protected int _maxBuckets -
iased
protected org.glassfish.ejb.deployment.descriptor.runtime.IASEjbExtraDescriptors iased -
beanCacheDes
protected org.glassfish.ejb.deployment.descriptor.runtime.BeanCacheDescriptor beanCacheDes -
beanPoolDes
protected com.sun.enterprise.deployment.runtime.BeanPoolDescriptor beanPoolDes -
ejbContainer
protected org.glassfish.ejb.config.EjbContainer ejbContainer -
idleEJBObjectPassivator
protected org.glassfish.persistence.ejb.entitybean.container.EntityContainer.IdleBeansPassivator idleEJBObjectPassivator -
idleLocalEJBObjectPassivator
protected org.glassfish.persistence.ejb.entitybean.container.EntityContainer.IdleBeansPassivator idleLocalEJBObjectPassivator -
defaultCacheEJBO
protected boolean defaultCacheEJBO -
ejboRemoved
protected int ejboRemoved -
totalPassivations
protected int totalPassivations -
totalPassivationErrors
protected int totalPassivationErrors
-
-
Constructor Details
-
EntityContainer
protected EntityContainer(org.glassfish.ejb.deployment.descriptor.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
-
EntityContainer
protected EntityContainer(com.sun.ejb.containers.BaseContainer.ContainerType containerType, org.glassfish.ejb.deployment.descriptor.EjbDescriptor desc, ClassLoader loader, com.sun.enterprise.security.SecurityManager sm) throws Exception - Throws:
Exception
-
-
Method Details
-
preInitialize
protected void preInitialize(org.glassfish.ejb.deployment.descriptor.EjbDescriptor desc, ClassLoader loader) - Overrides:
preInitializein classcom.sun.ejb.containers.BaseContainer
-
setEJBMetaData
- Overrides:
setEJBMetaDatain classcom.sun.ejb.containers.BaseContainer- Throws:
Exception
-
validateTxAttr
protected void validateTxAttr(com.sun.enterprise.deployment.MethodDescriptor md, int txAttr) throws jakarta.ejb.EJBException - Overrides:
validateTxAttrin classcom.sun.ejb.containers.BaseContainer- Throws:
jakarta.ejb.EJBException
-
adjustHomeTargetMethodInfo
protected void adjustHomeTargetMethodInfo(com.sun.ejb.InvocationInfo invInfo, String methodName, Class[] paramTypes) throws NoSuchMethodException - Overrides:
adjustHomeTargetMethodInfoin classcom.sun.ejb.containers.BaseContainer- Throws:
NoSuchMethodException
-
getEJBHomeInvocationHandler
protected com.sun.ejb.containers.EJBHomeInvocationHandler getEJBHomeInvocationHandler(Class homeIntfClass) throws Exception - Overrides:
getEJBHomeInvocationHandlerin classcom.sun.ejb.containers.BaseContainer- Throws:
Exception
-
getEJBLocalHomeInvocationHandler
protected com.sun.ejb.containers.EJBLocalHomeInvocationHandler getEJBLocalHomeInvocationHandler(Class homeIntfClass) throws Exception - Overrides:
getEJBLocalHomeInvocationHandlerin classcom.sun.ejb.containers.BaseContainer- Throws:
Exception
-
setupIdleBeansPassivator
public org.glassfish.persistence.ejb.entitybean.container.EntityContainer.IdleBeansPassivator setupIdleBeansPassivator(com.sun.appserv.util.cache.Cache cache) throws Exception setup a timer task to trim timed out entries in the cache.- Parameters:
cache- cache which is used to setup the timer task- Returns:
- the passivator object
- Throws:
Exception
-
cancelTimerTasks
public void cancelTimerTasks()cancel a timer task to trim timed out entries in the cache. -
postProcessInvocationInfo
protected com.sun.ejb.InvocationInfo postProcessInvocationInfo(com.sun.ejb.InvocationInfo invInfo) - Overrides:
postProcessInvocationInfoin classcom.sun.ejb.containers.BaseContainer
-
initializeHome
Called from the ContainerFactory during initialization.- Overrides:
initializeHomein classcom.sun.ejb.containers.BaseContainer- Throws:
Exception
-
registerMonitorableComponents
protected void registerMonitorableComponents()- Overrides:
registerMonitorableComponentsin classcom.sun.ejb.containers.BaseContainer
-
getMonitoringStatsProvider
protected com.sun.ejb.monitoring.stats.EjbMonitoringStatsProvider getMonitoringStatsProvider(String appName, String modName, String ejbName) - Specified by:
getMonitoringStatsProviderin classcom.sun.ejb.containers.BaseContainer
-
onReady
public void onReady()- Specified by:
onReadyin interfacecom.sun.ejb.Container- Overrides:
onReadyin classcom.sun.ejb.containers.BaseContainer
-
getMaxCacheSize
public int getMaxCacheSize() -
getSteadyPoolSize
public int getSteadyPoolSize() -
getMaxPoolSize
public int getMaxPoolSize() -
getPooledCount
public long getPooledCount() -
getReadyCount
public long getReadyCount() -
createEJBObjectImpl
protected com.sun.ejb.containers.EJBObjectImpl createEJBObjectImpl() throws jakarta.ejb.CreateException, RemoteExceptionImplementation of BaseContainer method. This is never called.- Specified by:
createEJBObjectImplin classcom.sun.ejb.containers.BaseContainer- Throws:
jakarta.ejb.CreateExceptionRemoteException
-
createEJBLocalObjectImpl
protected com.sun.ejb.containers.EJBLocalObjectImpl createEJBLocalObjectImpl() throws jakarta.ejb.CreateException- Overrides:
createEJBLocalObjectImplin classcom.sun.ejb.containers.BaseContainer- Throws:
jakarta.ejb.CreateException
-
getEJBObjectImpl
protected com.sun.ejb.containers.EJBObjectImpl getEJBObjectImpl(byte[] streamKey) Called when a remote EjbInvocation arrives for an EJB.- Specified by:
getEJBObjectImplin classcom.sun.ejb.containers.BaseContainer
-
getEJBLocalObjectImpl
Called from EJBLocalObjectImpl.getLocalObject() while deserializing a local object reference.- Overrides:
getEJBLocalObjectImplin classcom.sun.ejb.containers.BaseContainer
-
_getContext
protected com.sun.ejb.ComponentContext _getContext(com.sun.ejb.EjbInvocation inv) Called from BaseContainer.preInvoke which is called from the EJBObject for local and remote invocations, and from the EJBHome for create/find.- Specified by:
_getContextin classcom.sun.ejb.containers.BaseContainer
-
willInvokeWithClientTx
protected boolean willInvokeWithClientTx(com.sun.ejb.EjbInvocation inv) -
releaseContext
public void releaseContext(com.sun.ejb.EjbInvocation inv) This is called from BaseContainer.postInvoke after EntityContainer.preInvokeTx has been called.- Specified by:
releaseContextin classcom.sun.ejb.containers.BaseContainer
-
preCreate
Called from getContext before the ejb.ejbCreate is called -
postCreate
public void postCreate(com.sun.ejb.EjbInvocation inv, Object primaryKey) throws jakarta.ejb.CreateException This is called from the generated "HelloEJBHomeImpl" create* method, after ejb.ejbCreate() has been called and before ejb.ejbPostCreate() is called. Note: postCreate will not be called if ejbCreate throws an exception- Specified by:
postCreatein interfacecom.sun.ejb.Container- Overrides:
postCreatein classcom.sun.ejb.containers.BaseContainer- Throws:
jakarta.ejb.CreateException
-
invokeFindByPrimaryKey
protected Object invokeFindByPrimaryKey(Method method, com.sun.ejb.EjbInvocation inv, Object[] args) throws Throwable - Overrides:
invokeFindByPrimaryKeyin classcom.sun.ejb.containers.BaseContainer- Throws:
Throwable
-
authorizeLocalGetPrimaryKey
protected void authorizeLocalGetPrimaryKey(com.sun.ejb.containers.EJBLocalRemoteObject ejbObj) throws jakarta.ejb.EJBException - Overrides:
authorizeLocalGetPrimaryKeyin classcom.sun.ejb.containers.BaseContainer- Throws:
jakarta.ejb.EJBException
-
authorizeRemoteGetPrimaryKey
protected void authorizeRemoteGetPrimaryKey(com.sun.ejb.containers.EJBLocalRemoteObject ejbObj) throws RemoteException - Overrides:
authorizeRemoteGetPrimaryKeyin classcom.sun.ejb.containers.BaseContainer- Throws:
RemoteException
-
preFind
Called from getContext before the ejb.ejbFind* is called -
preSelect
public void preSelect() throws jakarta.ejb.EJBExceptionCalled from CMP PersistentManager- Specified by:
preSelectin interfacecom.sun.ejb.Container- Overrides:
preSelectin classcom.sun.ejb.containers.BaseContainer- Throws:
jakarta.ejb.EJBException
-
postFind
public Object postFind(com.sun.ejb.EjbInvocation inv, Object primaryKeys, Object[] findParams) throws jakarta.ejb.FinderException Convert a collection of primary keys to a collection of EJBObjects. (special case: single primary key). Note: the order of input invalid input: '&' output collections must be maintained. Null values are preserved in both the single primary key return and collection-valued return cases. This is called from the generated "HelloEJBHomeImpl" find* method, after ejb.ejbFind**() has been called. Note: postFind will not be called if ejbFindXXX throws an exception- Specified by:
postFindin interfacecom.sun.ejb.Container- Overrides:
postFindin classcom.sun.ejb.containers.BaseContainer- Throws:
jakarta.ejb.FinderException
-
getEJBObjectForPrimaryKey
Called only from the Persistence Manager for EJB2.0 CMP EntityBeans. This is a private API between the PM and Container because there is no standard API defined in EJB2.0 for the PM to get an EJBObject for a primary key (home.findByPrimaryKey cant be used because it may not run in the same tx).- Specified by:
getEJBObjectForPrimaryKeyin interfacecom.sun.ejb.Container- Overrides:
getEJBObjectForPrimaryKeyin classcom.sun.ejb.containers.BaseContainer
-
getEJBLocalObjectForPrimaryKey
public jakarta.ejb.EJBLocalObject getEJBLocalObjectForPrimaryKey(Object pkey, jakarta.ejb.EJBContext ctx) Called only from the Persistence Manager for EJB2.0 CMP EntityBeans. Called only during cascade delete...... This is a private API between the PM and Container because there is no standard API defined in EJB2.0 for the PM to get an EJBLocalObject for a primary key (findByPrimaryKey cant be used because it may not run in the same tx). Example 1: A cascadeDeletes B and B calls getA() (expected return value: null) In the above case, getA() eventualy calls getEJBLocalObjectForPrimaryKey(PK_of_A, Ctx_of_B) We first check if B is in the process of being cascade deleted by checking the cascadeDeleteBeforeEJBRemove flag. If this flag is true, only then we bother to check if the Context associated with the PK_of_A in this transaction is marked for cascade delete which can be figured out by checking isCascadeDeleteAfterSuperEJBRemove() in A's context. If A is marked for cascade delete then we return null else the EJBLocalObject associated with A. Example 2: C cascadeDeletes B and B calls getA() (expected return value: EJBLocalObject for PK_of_A) In the above case, getA() eventualy calls getEJBLocalObjectForPrimaryKey(PK_of_A, Ctx_of_B) We first check if B is in the process of being cascade deleted by checking the cascadeDeleteBeforeEJBRemove flag. This flag will be true, and hence we check if the Context associated with the PK_of_A in this transaction is marked for cascade delete which can be figured out by checking isCascadeDeleteAfterSuperEJBRemove() in A's context. In this case this flag will be false and hcen we return the ejbLocalObject Example 2: B is *NOT* cascade deleted and B calls getA() (expected return value: EJBLocalObject for PK_of_A) In the above case, getA() eventualy calls getEJBLocalObjectForPrimaryKey(PK_of_A, Ctx_of_B) We first check if B is in the process of being cascade deleted by checking the cascadeDeleteBeforeEJBRemove flag. This flag will be FALSE, and hence we do not make any further check and return the EJBLocalObject associated with A- Specified by:
getEJBLocalObjectForPrimaryKeyin interfacecom.sun.ejb.Container- Overrides:
getEJBLocalObjectForPrimaryKeyin classcom.sun.ejb.containers.BaseContainer- Parameters:
pkey- The primary key for which the EJBLocalObject is requiredctx- The context associated with the bean from which the accessor method is invoked- Returns:
- The EJBLocalObject associated with the PK or null if it is cascade deleted.
-
getEJBLocalObjectForPrimaryKey
Called only from the Persistence Manager for EJB2.0 CMP EntityBeans. This is a private API between the PM and Container because there is no standard API defined in EJB2.0 for the PM to get an EJBLocalObject for a primary key (findByPrimaryKey cant be used because it may not run in the same tx).- Specified by:
getEJBLocalObjectForPrimaryKeyin interfacecom.sun.ejb.Container- Overrides:
getEJBLocalObjectForPrimaryKeyin classcom.sun.ejb.containers.BaseContainer
-
doEJBHomeRemove
protected void doEJBHomeRemove(Object primaryKey, Method removeMethod, boolean local) throws jakarta.ejb.RemoveException, jakarta.ejb.EJBException, RemoteException - Overrides:
doEJBHomeRemovein classcom.sun.ejb.containers.BaseContainer- Throws:
jakarta.ejb.RemoveExceptionjakarta.ejb.EJBExceptionRemoteException
-
removeBean
protected void removeBean(com.sun.ejb.containers.EJBLocalRemoteObject ejbo, Method removeMethod, boolean local) throws jakarta.ejb.RemoveException, jakarta.ejb.EJBException, RemoteException - Specified by:
removeBeanin classcom.sun.ejb.containers.BaseContainer- Throws:
jakarta.ejb.RemoveExceptionjakarta.ejb.EJBExceptionRemoteException
-
removeBean
protected void removeBean(com.sun.ejb.EjbInvocation inv) throws jakarta.ejb.RemoveException container.preInvoke() must already be done. So this will be called with the proper Tx context.- Throws:
jakarta.ejb.RemoveException- if an error occurs while removing the bean
-
removeBeanUnchecked
public void removeBeanUnchecked(jakarta.ejb.EJBLocalObject localObj) Remove a bean. Used by the PersistenceManager. This is needed because the PM's remove must bypass tx/security checks.- Specified by:
removeBeanUncheckedin interfacecom.sun.ejb.Container- Overrides:
removeBeanUncheckedin classcom.sun.ejb.containers.BaseContainer
-
removeBeanUnchecked
Remove a bean. Used by the PersistenceManager. This is needed because the PM's remove must bypass tx/security checks.- Specified by:
removeBeanUncheckedin interfacecom.sun.ejb.Container- Overrides:
removeBeanUncheckedin classcom.sun.ejb.containers.BaseContainer
-
forceDestroyBean
protected void forceDestroyBean(com.sun.ejb.containers.EJBContextImpl ctx) Discard the bean instance. The bean's persistent state is not removed. This is usually called when the bean instance throws a system exception, from BaseContainer.postInvokeTx, getReadyEJB, afterBegin, beforeCompletion, passivateEJB.- Specified by:
forceDestroyBeanin classcom.sun.ejb.containers.BaseContainer
-
checkUnfinishedTx
protected void checkUnfinishedTx(jakarta.transaction.Transaction prevTx, com.sun.ejb.EjbInvocation inv) - Overrides:
checkUnfinishedTxin classcom.sun.ejb.containers.BaseContainer
-
checkExists
protected void checkExists(com.sun.ejb.containers.EJBLocalRemoteObject ejbObj) Check if the given EJBObject/LocalObject has been removed. Called before executing non-business methods of EJBLocalObject.- Overrides:
checkExistsin classcom.sun.ejb.containers.BaseContainer- Throws:
jakarta.ejb.NoSuchObjectLocalException- if the object has been removed.
-
afterBegin
protected void afterBegin(com.sun.ejb.containers.EJBContextImpl ctx) - Specified by:
afterBeginin classcom.sun.ejb.containers.BaseContainer
-
beforeCompletion
protected void beforeCompletion(com.sun.ejb.containers.EJBContextImpl ctx) - Specified by:
beforeCompletionin classcom.sun.ejb.containers.BaseContainer
-
afterCompletion
protected void afterCompletion(com.sun.ejb.containers.EJBContextImpl ctx, int status) - Specified by:
afterCompletionin classcom.sun.ejb.containers.BaseContainer
-
preInvokeNoTx
protected void preInvokeNoTx(com.sun.ejb.EjbInvocation inv) - Overrides:
preInvokeNoTxin classcom.sun.ejb.containers.BaseContainer
-
postInvokeNoTx
protected void postInvokeNoTx(com.sun.ejb.EjbInvocation inv) - Overrides:
postInvokeNoTxin classcom.sun.ejb.containers.BaseContainer
-
adjustInvocationInfo
protected void adjustInvocationInfo(com.sun.ejb.InvocationInfo invInfo, Method method, int txAttr, boolean flushEnabled, String methodIntf, Class originalIntf) throws jakarta.ejb.EJBException - Overrides:
adjustInvocationInfoin classcom.sun.ejb.containers.BaseContainer- Throws:
jakarta.ejb.EJBException
-
trimEvent
- Specified by:
trimEventin interfacecom.sun.appserv.util.cache.CacheListener
-
passivateEJB
protected boolean passivateEJB(com.sun.ejb.ComponentContext ctx) - Specified by:
passivateEJBin classcom.sun.ejb.containers.BaseContainer
-
internalGetEJBLocalObjectImpl
protected com.sun.ejb.containers.EJBLocalObjectImpl internalGetEJBLocalObjectImpl(Object primaryKey) The following are private methods for implementing internal logic for lifecyle and state management, in a reusable way. -
internalGetEJBLocalObjectImpl
protected com.sun.ejb.containers.EJBLocalObjectImpl internalGetEJBLocalObjectImpl(Object primaryKey, boolean incrementRefCount) -
internalGetEJBLocalObjectImpl
protected com.sun.ejb.containers.EJBLocalObjectImpl internalGetEJBLocalObjectImpl(Object primaryKey, boolean incrementRefCount, boolean cacheEJBO) -
getPooledEJB
-
addPooledEJB
-
passivateAndPoolEJB
-
activateEJBFromPool
Called from getContext and getEJBWithIncompleteTx Get an EJB in the ready state (i.e. which is not doing any invocations and doesnt have any incomplete Tx), for the ejbObject provided in the EjbInvocation. Concurrent invocations should get *different* instances. -
removeIncompleteTxEJB
Called from releaseContext if ejb is removed, from afterCompletion, and from passivateEJB. -
isIdentical
protected boolean isIdentical(com.sun.ejb.containers.EJBObjectImpl ejbObjImpl, jakarta.ejb.EJBObject other) throws RemoteException - Overrides:
isIdenticalin classcom.sun.ejb.containers.BaseContainer- Throws:
RemoteException
-
callEJBLoad
protected void callEJBLoad(jakarta.ejb.EntityBean ejb, EntityContextImpl context, boolean activeTx) throws Exception - Throws:
Exception
-
callEJBStore
- Throws:
Exception
-
callEJBRemove
protected void callEJBRemove(jakarta.ejb.EntityBean ejb, EntityContextImpl context) throws Exception - Throws:
Exception
-
doTimerInvocationInit
protected void doTimerInvocationInit(com.sun.ejb.EjbInvocation inv, Object primaryKey) throws Exception - Overrides:
doTimerInvocationInitin classcom.sun.ejb.containers.BaseContainer- Throws:
Exception
-
doConcreteContainerShutdown
protected void doConcreteContainerShutdown(boolean appBeingUndeployed) - Specified by:
doConcreteContainerShutdownin classcom.sun.ejb.containers.BaseContainer
-
afterNewlyActivated
-
createEntityContextInstance
protected EntityContextImpl createEntityContextInstance(jakarta.ejb.EntityBean ejb, EntityContainer entityContainer) -
createReadyStore
protected void createReadyStore(int cacheSize, int numberOfVictimsToSelect, float loadFactor, long idleTimeout) throws Exception - Throws:
Exception
-
createEJBObjectStores
protected void createEJBObjectStores(int cacheSize, int numberOfVictimsToSelect, long idleTimeout) throws Exception - Throws:
Exception
-
getReadyEJB
-
addReadyEJB
-
destroyReadyStoreOnUndeploy
protected void destroyReadyStoreOnUndeploy() -
removeContextFromReadyStore
-
addProxyInterfacesSetClass
- Overrides:
addProxyInterfacesSetClassin classcom.sun.ejb.containers.BaseContainer
-
doFlush
protected void doFlush(com.sun.ejb.EjbInvocation inv) - Overrides:
doFlushin classcom.sun.ejb.containers.BaseContainer
-