Class ReadOnlyBeanContainer
- java.lang.Object
-
- com.sun.ejb.containers.BaseContainer
-
- org.glassfish.persistence.ejb.entitybean.container.EntityContainer
-
- org.glassfish.persistence.ejb.entitybean.container.ReadOnlyBeanContainer
-
- 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,ReadOnlyBeanRefreshEventHandler
public class ReadOnlyBeanContainer extends EntityContainer implements ReadOnlyBeanRefreshEventHandler
The Container that manages instances of ReadOnly Beans. This container blocks all calls to ejbStore() and selectively performs ejbLoad()- Author:
- Mahesh Kannan, Pramod Gopinath
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.glassfish.persistence.ejb.entitybean.container.EntityContainer
EntityContainer.CacheProperties, EntityContainer.EJBObjectCacheVictimHandler, EntityContainer.LocalEJBObjectCacheVictimHandler
-
-
Field Summary
-
Fields inherited from class org.glassfish.persistence.ejb.entitybean.container.EntityContainer
_maxBuckets, beanCacheDes, beanPoolDes, DEFAULT_CACHE_SIZE, DEFAULT_LOAD_FACTOR, defaultCacheEJBO, ejbContainer, ejbLocalObjectStore, ejbObjectStore, ejboRemoved, entityCtxPool, HIGH_WATER_MARK, iased, idleEJBObjectPassivator, idleLocalEJBObjectPassivator, isContainerManagedPers, isReentrant, passivationCandidates, readyStore, totalPassivationErrors, totalPassivations
-
Fields 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, webServiceInvocationInfoMap
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedReadOnlyBeanContainer(org.glassfish.ejb.deployment.descriptor.EjbDescriptor desc, ClassLoader loader, com.sun.enterprise.security.SecurityManager sm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.protected voidaddPooledEJB(EntityContextImpl ctx)protected voidafterNewlyActivated(EntityContextImpl context)protected voidcallEJBLoad(jakarta.ejb.EntityBean ejb, EntityContextImpl entityCtx, boolean activeTx)protected voidcallEJBRemove(jakarta.ejb.EntityBean ejb, EntityContextImpl context)protected voidcallEJBStore(jakarta.ejb.EntityBean ejb, EntityContextImpl context)protected EntityContextImplcreateEntityContextInstance(jakarta.ejb.EntityBean ejb, EntityContainer entityContainer)protected voiddoConcreteContainerShutdown(boolean appBeingUndeployed)protected voidforceDestroyBean(com.sun.ejb.containers.EJBContextImpl context)Discard the bean instance.protected com.sun.ejb.containers.EJBHomeInvocationHandlergetEJBHomeInvocationHandler(Class homeIntfClass)protected com.sun.ejb.containers.EJBLocalHomeInvocationHandlergetEJBLocalHomeInvocationHandler(Class homeIntfClass)voidhandleRefreshAllRequest()Called from DistributedReadOnlyBeanServiceImpl when a refreshAll message arrives at this instancevoidhandleRefreshRequest(Object primaryKey)Called from DistributedReadOnlyBeanServiceImpl when a refresh message arrives at this instanceprotected voidinitializeHome()Called from the ContainerFactory during initialization.protected ObjectinvokeFindByPrimaryKey(Method method, com.sun.ejb.EjbInvocation inv, Object[] args)protected ObjectinvokeTargetBeanMethod(Method beanClassMethod, com.sun.ejb.EjbInvocation inv, Object target, Object[] params, com.sun.enterprise.security.SecurityManager mgr)ObjectpostFind(com.sun.ejb.EjbInvocation inv, Object primaryKeys, Object[] findParams)Convert a collection of primary keys to a collection of EJBObjects.voidpreInvoke(com.sun.ejb.EjbInvocation inv)protected voidpreInvokeNoTx(com.sun.ejb.EjbInvocation inv)protected voidremoveBean(com.sun.ejb.containers.EJBLocalRemoteObject ejbo, Method removeMethod, boolean local)voidsetRefreshFlag(Object primaryKey)-
Methods inherited from class org.glassfish.persistence.ejb.entitybean.container.EntityContainer
activateEJBFromPool, addProxyInterfacesSetClass, addReadyEJB, adjustHomeTargetMethodInfo, adjustInvocationInfo, afterBegin, afterCompletion, authorizeLocalGetPrimaryKey, authorizeRemoteGetPrimaryKey, beforeCompletion, cancelTimerTasks, checkExists, checkUnfinishedTx, createEJBLocalObjectImpl, createEJBObjectImpl, createEJBObjectStores, createReadyStore, destroyReadyStoreOnUndeploy, doEJBHomeRemove, doFlush, doTimerInvocationInit, getEJBLocalObjectForPrimaryKey, getEJBLocalObjectForPrimaryKey, getEJBLocalObjectImpl, getEJBObjectForPrimaryKey, getEJBObjectImpl, getMaxCacheSize, getMaxPoolSize, getMonitoringStatsProvider, getPooledCount, getPooledEJB, getReadyCount, getReadyEJB, getSteadyPoolSize, internalGetEJBLocalObjectImpl, internalGetEJBLocalObjectImpl, internalGetEJBLocalObjectImpl, isIdentical, onReady, passivateAndPoolEJB, passivateEJB, postCreate, postInvokeNoTx, postProcessInvocationInfo, preCreate, preFind, preInitialize, preSelect, registerMonitorableComponents, releaseContext, removeBean, removeBeanUnchecked, removeBeanUnchecked, removeContextFromReadyStore, removeIncompleteTxEJB, setEJBMetaData, setupIdleBeansPassivator, trimEvent, validateTxAttr, willInvokeWithClientTx
-
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, isApplicationException, isCreateHomeFinder, isEjbTimeoutMethod, isHAEnabled, isLocalInterfaceSupported, isLocalObject, isRemoteInterfaceSupported, isRemoteObject, isStopped, isSystemUncheckedException, isTimedObject, isUndeployed, lookupExtendedEntityManager, onEnteringContainer, onLeavingContainer, onShutdown, onTermination, postEjbTimeout, postInvoke, postInvoke, postInvokeTx, preInvokeTx, prepareEjbTimeoutParams, registerSystemInterceptor, registerTimerMonitorableComponent, releaseTargetObject, resumeTransaction, scanForEjbCreateMethod, setDebugMonitorFlag, setStartedState, setStoppedState, setUndeployedState, startApplication, suspendTransaction, toString, undeploy, useClientTx, userTransactionMethodsAllowed, validateEMForClientTx, webServicePostInvoke
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.glassfish.persistence.ejb.entitybean.container.distributed.ReadOnlyBeanRefreshEventHandler
getClassLoader
-
-
-
-
Constructor Detail
-
ReadOnlyBeanContainer
protected ReadOnlyBeanContainer(org.glassfish.ejb.deployment.descriptor.EjbDescriptor desc, ClassLoader loader, com.sun.enterprise.security.SecurityManager sm) throws Exception- Throws:
Exception
-
-
Method Detail
-
callEJBStore
protected void callEJBStore(jakarta.ejb.EntityBean ejb, EntityContextImpl context)- Overrides:
callEJBStorein classEntityContainer
-
_getContext
protected com.sun.ejb.ComponentContext _getContext(com.sun.ejb.EjbInvocation inv)
Description copied from class:EntityContainerCalled from BaseContainer.preInvoke which is called from the EJBObject for local and remote invocations, and from the EJBHome for create/find.- Overrides:
_getContextin classEntityContainer
-
callEJBLoad
protected void callEJBLoad(jakarta.ejb.EntityBean ejb, EntityContextImpl entityCtx, boolean activeTx) throws Exception- Overrides:
callEJBLoadin classEntityContainer- Throws:
Exception
-
callEJBRemove
protected void callEJBRemove(jakarta.ejb.EntityBean ejb, EntityContextImpl context) throws Exception- Overrides:
callEJBRemovein classEntityContainer- Throws:
Exception
-
doConcreteContainerShutdown
protected void doConcreteContainerShutdown(boolean appBeingUndeployed)
- Overrides:
doConcreteContainerShutdownin classEntityContainer
-
preInvokeNoTx
protected void preInvokeNoTx(com.sun.ejb.EjbInvocation inv)
- Overrides:
preInvokeNoTxin classEntityContainer
-
afterNewlyActivated
protected void afterNewlyActivated(EntityContextImpl context)
- Overrides:
afterNewlyActivatedin classEntityContainer
-
addPooledEJB
protected void addPooledEJB(EntityContextImpl ctx)
- Overrides:
addPooledEJBin classEntityContainer
-
forceDestroyBean
protected void forceDestroyBean(com.sun.ejb.containers.EJBContextImpl context)
Description copied from class:EntityContainerDiscard 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.- Overrides:
forceDestroyBeanin classEntityContainer
-
preInvoke
public void preInvoke(com.sun.ejb.EjbInvocation inv)
- Specified by:
preInvokein interfacecom.sun.ejb.Container- Overrides:
preInvokein classcom.sun.ejb.containers.BaseContainer
-
invokeTargetBeanMethod
protected Object invokeTargetBeanMethod(Method beanClassMethod, com.sun.ejb.EjbInvocation inv, Object target, Object[] params, com.sun.enterprise.security.SecurityManager mgr) throws Throwable
- Overrides:
invokeTargetBeanMethodin classcom.sun.ejb.containers.BaseContainer- Throws:
Throwable
-
removeBean
protected void removeBean(com.sun.ejb.containers.EJBLocalRemoteObject ejbo, Method removeMethod, boolean local) throws jakarta.ejb.RemoveException, jakarta.ejb.EJBException, RemoteException- Overrides:
removeBeanin classEntityContainer- Throws:
jakarta.ejb.RemoveExceptionjakarta.ejb.EJBExceptionRemoteException
-
initializeHome
protected void initializeHome() throws ExceptionDescription copied from class:EntityContainerCalled from the ContainerFactory during initialization.- Overrides:
initializeHomein classEntityContainer- Throws:
Exception
-
getEJBHomeInvocationHandler
protected com.sun.ejb.containers.EJBHomeInvocationHandler getEJBHomeInvocationHandler(Class homeIntfClass) throws Exception
- Overrides:
getEJBHomeInvocationHandlerin classEntityContainer- Throws:
Exception
-
getEJBLocalHomeInvocationHandler
protected com.sun.ejb.containers.EJBLocalHomeInvocationHandler getEJBLocalHomeInvocationHandler(Class homeIntfClass) throws Exception
- Overrides:
getEJBLocalHomeInvocationHandlerin classEntityContainer- Throws:
Exception
-
setRefreshFlag
public void setRefreshFlag(Object primaryKey)
-
handleRefreshRequest
public void handleRefreshRequest(Object primaryKey)
Description copied from interface:ReadOnlyBeanRefreshEventHandlerCalled from DistributedReadOnlyBeanServiceImpl when a refresh message arrives at this instance- Specified by:
handleRefreshRequestin interfaceReadOnlyBeanRefreshEventHandler- Parameters:
primaryKey- the primary key that needs to be refreshed
-
handleRefreshAllRequest
public void handleRefreshAllRequest()
Description copied from interface:ReadOnlyBeanRefreshEventHandlerCalled from DistributedReadOnlyBeanServiceImpl when a refreshAll message arrives at this instance- Specified by:
handleRefreshAllRequestin interfaceReadOnlyBeanRefreshEventHandler
-
createEntityContextInstance
protected EntityContextImpl createEntityContextInstance(jakarta.ejb.EntityBean ejb, EntityContainer entityContainer)
- Overrides:
createEntityContextInstancein classEntityContainer
-
invokeFindByPrimaryKey
protected Object invokeFindByPrimaryKey(Method method, com.sun.ejb.EjbInvocation inv, Object[] args) throws Throwable
- Overrides:
invokeFindByPrimaryKeyin classEntityContainer- Throws:
Throwable
-
postFind
public Object postFind(com.sun.ejb.EjbInvocation inv, Object primaryKeys, Object[] findParams) throws jakarta.ejb.FinderException
Description copied from class:EntityContainerConvert a collection of primary keys to a collection of EJBObjects. (special case: single primary key). Note: the order of 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 classEntityContainer- Throws:
jakarta.ejb.FinderException
-
-