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:
CacheListener,Container,JavaEEContainer,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
-
Nested classes/interfaces inherited from class com.sun.ejb.containers.BaseContainer
BaseContainer.ContainerInfo, BaseContainer.ContainerType, BaseContainer.PreInvokeException
-
-
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, 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, executorProbeListener, hasLocalBusinessView, hasLocalHomeView, hasOptionalLocalBusinessView, hasRemoteBusinessView, hasRemoteHomeView, homeIntf, injectionManager, interceptorManager, invocationInfoMap, invocationManager, isBeanManagedTran, isLocal, isMessageDriven, isRemote, isSession, isSingleton, isStatefulSession, isStatelessSession, isWebServiceEndpoint, jcdiService, loader, localBusinessHomeIntf, localBusinessIntfs, localHomeIntf, logParams, metadata, 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 protectedReadOnlyBeanContainer(EjbDescriptor desc, ClassLoader loader, SecurityManager sm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ComponentContext_getContext(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(EJBContextImpl context)Discard the bean instance.protected EJBHomeInvocationHandlergetEJBHomeInvocationHandler(Class homeIntfClass)protected 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, EjbInvocation inv, Object[] args)protected ObjectinvokeTargetBeanMethod(Method beanClassMethod, EjbInvocation inv, Object target, Object[] params, SecurityManager mgr)ObjectpostFind(EjbInvocation inv, Object primaryKeys, Object[] findParams)Convert a collection of primary keys to a collection of EJBObjects.voidpreInvoke(EjbInvocation inv)Called from EJBObject/EJBHome before invoking on EJB.protected voidpreInvokeNoTx(EjbInvocation inv)protected voidremoveBean(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, _createJCDIInjectionContext, _createJCDIInjectionContext, addInvocationInfo, addLocalRemoteInvocationInfo, assertValidLocalObject, assertValidRemoteObject, authorize, authorizeLocalMethod, authorizeRemoteMethod, callEJBTimeout, cancelTimers, checkExceptionClientTx, checkUserTransactionLookup, cleanupInstance, containerStateToString, createCallFlowAgent, createEjbInstanceAndContext, createEjbInstanceForInterceptors, createEjbInvocation, createEjbInvocation, createEmptyContextAndInterceptors, createMonitoringRegistry, createRemoteReferenceWithId, delistExtendedEntityManagers, doAfterBegin, enlistExtendedEntityManagers, externalPostInvoke, externalPreInvoke, findFlushEnabledAttr, getApplicationId, getClassLoader, getComponentId, getContainerClassLoader, getContainerId, getContainerType, 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, initialize, initializeProtocolManager, injectEjbInstance, instantiateEJBLocalBusinessObjectImpl, instantiateEJBLocalObjectImpl, instantiateEJBLocalObjectImpl, instantiateEJBObjectImpl, instantiateEJBObjectImpl, instantiateOptionalEJBLocalBusinessObjectImpl, instantiateRemoteBusinessObjectImpl, intercept, intercept, invokeBeanMethod, isApplicationException, isCreateHomeFinder, isEjbTimeoutMethod, isHAEnabled, isJCDIEnabled, isLocalInterfaceSupported, isLocalObject, isRemoteInterfaceSupported, isRemoteObject, isStopped, isSystemUncheckedException, isTimedObject, isUndeployed, lookupExtendedEntityManager, onEnteringContainer, onLeavingContainer, onShutdown, onTermination, postEjbTimeout, postInvoke, postInvoke, postInvokeTx, preInvokeTx, prepareEjbTimeoutParams, 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(EjbDescriptor desc, ClassLoader loader, SecurityManager sm) throws Exception
- Throws:
Exception
-
-
Method Detail
-
callEJBStore
protected void callEJBStore(jakarta.ejb.EntityBean ejb, EntityContextImpl context)- Overrides:
callEJBStorein classEntityContainer
-
_getContext
protected ComponentContext _getContext(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(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(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(EjbInvocation inv)
Description copied from class:BaseContainerCalled from EJBObject/EJBHome before invoking on EJB. Set the EJB instance in the EjbInvocation. It must be ensured that the following general pattern is followed by various parts of the EJBContainer code: try { container.preInvoke(inv); returnValue = container.intercept(inv); } catch (Exception1 e1) { ... } catch (Exception2 e2) { ... } finally { container.postInvoke(); }- Specified by:
preInvokein interfaceContainer- Overrides:
preInvokein classBaseContainer
-
invokeTargetBeanMethod
protected Object invokeTargetBeanMethod(Method beanClassMethod, EjbInvocation inv, Object target, Object[] params, SecurityManager mgr) throws Throwable
- Overrides:
invokeTargetBeanMethodin classBaseContainer- Throws:
Throwable
-
removeBean
protected void removeBean(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 EJBHomeInvocationHandler getEJBHomeInvocationHandler(Class homeIntfClass) throws Exception
- Overrides:
getEJBHomeInvocationHandlerin classEntityContainer- Throws:
Exception
-
getEJBLocalHomeInvocationHandler
protected 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, EjbInvocation inv, Object[] args) throws Throwable
- Overrides:
invokeFindByPrimaryKeyin classEntityContainer- Throws:
Throwable
-
postFind
public Object postFind(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 interfaceContainer- Overrides:
postFindin classEntityContainerprimaryKeys- the primaryKey or collection of primaryKeys (Collection/Enumeration) returned from ejbFind.findParams- the parameters to the ejbFind method.- Returns:
- an EJBObject reference or Collection/Enumeration of EJBObjects.
- Throws:
jakarta.ejb.FinderException
-
-