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 protected
ReadOnlyBeanContainer(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 void
addPooledEJB(EntityContextImpl ctx)
protected void
afterNewlyActivated(EntityContextImpl context)
protected void
callEJBLoad(jakarta.ejb.EntityBean ejb, EntityContextImpl entityCtx, boolean activeTx)
protected void
callEJBRemove(jakarta.ejb.EntityBean ejb, EntityContextImpl context)
protected void
callEJBStore(jakarta.ejb.EntityBean ejb, EntityContextImpl context)
protected EntityContextImpl
createEntityContextInstance(jakarta.ejb.EntityBean ejb, EntityContainer entityContainer)
protected void
doConcreteContainerShutdown(boolean appBeingUndeployed)
protected void
forceDestroyBean(EJBContextImpl context)
Discard the bean instance.protected EJBHomeInvocationHandler
getEJBHomeInvocationHandler(Class homeIntfClass)
protected EJBLocalHomeInvocationHandler
getEJBLocalHomeInvocationHandler(Class homeIntfClass)
void
handleRefreshAllRequest()
Called from DistributedReadOnlyBeanServiceImpl when a refreshAll message arrives at this instancevoid
handleRefreshRequest(Object primaryKey)
Called from DistributedReadOnlyBeanServiceImpl when a refresh message arrives at this instanceprotected void
initializeHome()
Called from the ContainerFactory during initialization.protected Object
invokeFindByPrimaryKey(Method method, EjbInvocation inv, Object[] args)
protected Object
invokeTargetBeanMethod(Method beanClassMethod, EjbInvocation inv, Object target, Object[] params, SecurityManager mgr)
Object
postFind(EjbInvocation inv, Object primaryKeys, Object[] findParams)
Convert a collection of primary keys to a collection of EJBObjects.void
preInvoke(EjbInvocation inv)
Called from EJBObject/EJBHome before invoking on EJB.protected void
preInvokeNoTx(EjbInvocation inv)
protected void
removeBean(EJBLocalRemoteObject ejbo, Method removeMethod, boolean local)
void
setRefreshFlag(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:
callEJBStore
in classEntityContainer
-
_getContext
protected ComponentContext _getContext(EjbInvocation inv)
Description copied from class:EntityContainer
Called from BaseContainer.preInvoke which is called from the EJBObject for local and remote invocations, and from the EJBHome for create/find.- Overrides:
_getContext
in classEntityContainer
-
callEJBLoad
protected void callEJBLoad(jakarta.ejb.EntityBean ejb, EntityContextImpl entityCtx, boolean activeTx) throws Exception
- Overrides:
callEJBLoad
in classEntityContainer
- Throws:
Exception
-
callEJBRemove
protected void callEJBRemove(jakarta.ejb.EntityBean ejb, EntityContextImpl context) throws Exception
- Overrides:
callEJBRemove
in classEntityContainer
- Throws:
Exception
-
doConcreteContainerShutdown
protected void doConcreteContainerShutdown(boolean appBeingUndeployed)
- Overrides:
doConcreteContainerShutdown
in classEntityContainer
-
preInvokeNoTx
protected void preInvokeNoTx(EjbInvocation inv)
- Overrides:
preInvokeNoTx
in classEntityContainer
-
afterNewlyActivated
protected void afterNewlyActivated(EntityContextImpl context)
- Overrides:
afterNewlyActivated
in classEntityContainer
-
addPooledEJB
protected void addPooledEJB(EntityContextImpl ctx)
- Overrides:
addPooledEJB
in classEntityContainer
-
forceDestroyBean
protected void forceDestroyBean(EJBContextImpl context)
Description copied from class:EntityContainer
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.- Overrides:
forceDestroyBean
in classEntityContainer
-
preInvoke
public void preInvoke(EjbInvocation inv)
Description copied from class:BaseContainer
Called 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:
preInvoke
in interfaceContainer
- Overrides:
preInvoke
in classBaseContainer
-
invokeTargetBeanMethod
protected Object invokeTargetBeanMethod(Method beanClassMethod, EjbInvocation inv, Object target, Object[] params, SecurityManager mgr) throws Throwable
- Overrides:
invokeTargetBeanMethod
in classBaseContainer
- Throws:
Throwable
-
removeBean
protected void removeBean(EJBLocalRemoteObject ejbo, Method removeMethod, boolean local) throws jakarta.ejb.RemoveException, jakarta.ejb.EJBException, RemoteException
- Overrides:
removeBean
in classEntityContainer
- Throws:
jakarta.ejb.RemoveException
jakarta.ejb.EJBException
RemoteException
-
initializeHome
protected void initializeHome() throws Exception
Description copied from class:EntityContainer
Called from the ContainerFactory during initialization.- Overrides:
initializeHome
in classEntityContainer
- Throws:
Exception
-
getEJBHomeInvocationHandler
protected EJBHomeInvocationHandler getEJBHomeInvocationHandler(Class homeIntfClass) throws Exception
- Overrides:
getEJBHomeInvocationHandler
in classEntityContainer
- Throws:
Exception
-
getEJBLocalHomeInvocationHandler
protected EJBLocalHomeInvocationHandler getEJBLocalHomeInvocationHandler(Class homeIntfClass) throws Exception
- Overrides:
getEJBLocalHomeInvocationHandler
in classEntityContainer
- Throws:
Exception
-
setRefreshFlag
public void setRefreshFlag(Object primaryKey)
-
handleRefreshRequest
public void handleRefreshRequest(Object primaryKey)
Description copied from interface:ReadOnlyBeanRefreshEventHandler
Called from DistributedReadOnlyBeanServiceImpl when a refresh message arrives at this instance- Specified by:
handleRefreshRequest
in interfaceReadOnlyBeanRefreshEventHandler
- Parameters:
primaryKey
- the primary key that needs to be refreshed
-
handleRefreshAllRequest
public void handleRefreshAllRequest()
Description copied from interface:ReadOnlyBeanRefreshEventHandler
Called from DistributedReadOnlyBeanServiceImpl when a refreshAll message arrives at this instance- Specified by:
handleRefreshAllRequest
in interfaceReadOnlyBeanRefreshEventHandler
-
createEntityContextInstance
protected EntityContextImpl createEntityContextInstance(jakarta.ejb.EntityBean ejb, EntityContainer entityContainer)
- Overrides:
createEntityContextInstance
in classEntityContainer
-
invokeFindByPrimaryKey
protected Object invokeFindByPrimaryKey(Method method, EjbInvocation inv, Object[] args) throws Throwable
- Overrides:
invokeFindByPrimaryKey
in classEntityContainer
- Throws:
Throwable
-
postFind
public Object postFind(EjbInvocation inv, Object primaryKeys, Object[] findParams) throws jakarta.ejb.FinderException
Description copied from class:EntityContainer
Convert 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:
postFind
in interfaceContainer
- Overrides:
postFind
in classEntityContainer
primaryKeys
- 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
-
-