public final class MessageBeanContainer
extends com.sun.ejb.containers.BaseContainer
implements org.glassfish.ejb.api.MessageBeanProtocolManager
The 3 states of a Message-driven EJB (an EJB can be in only 1 state at a time): 1. POOLED : ready for invocations, no transaction in progress 2. INVOKING : processing an invocation 3. DESTROYED : does not exist A Message-driven Bean can hold open DB connections across invocations. It's assumed that the Resource Manager can handle multiple incomplete transactions on the same connection.
| Modifier and Type | Class and Description |
|---|---|
static class |
MessageBeanContainer.MessageDeliveryType |
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| Modifier and Type | Method and Description |
|---|---|
protected com.sun.ejb.containers.EJBContextImpl |
_constructEJBContextImpl(Object instance) |
protected com.sun.ejb.ComponentContext |
_getContext(com.sun.ejb.EjbInvocation inv) |
void |
activateEJB(Object ctx,
Object instanceKey) |
protected void |
addLocalRemoteInvocationInfo() |
protected void |
afterBegin(com.sun.ejb.containers.EJBContextImpl context) |
protected void |
afterCompletion(com.sun.ejb.containers.EJBContextImpl ctx,
int status) |
void |
afterMessageDelivery(com.sun.appserv.connectors.internal.api.ResourceHandle resourceHandle) |
protected void |
beforeCompletion(com.sun.ejb.containers.EJBContextImpl context) |
void |
beforeMessageDelivery(Method method,
MessageBeanContainer.MessageDeliveryType deliveryType,
boolean txImported,
com.sun.appserv.connectors.internal.api.ResourceHandle resourceHandle)
Actual message delivery happens in three steps :
1) beforeMessageDelivery(Message, MessageListener) This is our chance to
make the message delivery itself part of the instance's global
transaction.
|
protected boolean |
callEJBTimeout(com.sun.ejb.containers.RuntimeTimerState timerState,
com.sun.ejb.containers.EJBTimerService timerService)
Override callEJBTimeout from BaseContainer since delivery to message
driven beans is a bit different from session/entity.
|
com.sun.ejb.containers.EJBObjectImpl |
createEJBObjectImpl() |
org.glassfish.ejb.api.MessageBeanListener |
createMessageBeanListener(com.sun.appserv.connectors.internal.api.ResourceHandle resource)
The following are implementation for methods required by the *
MessageBeanProtocalManager interface.
|
Object |
deliverMessage(Object[] params) |
void |
destroyMessageBeanListener(org.glassfish.ejb.api.MessageBeanListener listener) |
protected void |
doConcreteContainerShutdown(boolean appBeingUndeployed)
Called by BaseContainer during container shutdown sequence
|
protected void |
forceDestroyBean(com.sun.ejb.containers.EJBContextImpl sc)
Force destroy the EJB.
|
com.sun.ejb.containers.EJBObjectImpl |
getEJBObjectImpl(byte[] instanceKey) |
long |
getMessageCount() |
String |
getMonitorAttributeValues() |
protected com.sun.ejb.monitoring.stats.EjbMonitoringStatsProvider |
getMonitoringStatsProvider(String appName,
String modName,
String ejbName) |
com.sun.enterprise.deployment.runtime.BeanPoolDescriptor |
getPoolDescriptor() |
protected void |
initializeHome() |
protected boolean |
isCreateHomeFinder(Method method) |
boolean |
isDeliveryTransacted(Method method) |
boolean |
passivateEJB(com.sun.ejb.ComponentContext context) |
void |
postInvoke(com.sun.ejb.EjbInvocation inv)
TODO
public void appendStats(StringBuffer sbuf) {
sbuf.append("\nMessageBeanContainer: ").append("CreateCount=").append(
statCreateCount).append("; ").append("RemoveCount=").append(
statRemoveCount).append("; ").append("MsgCount=").append(
statMessageCount).append("; ");
sbuf.append("]");
}
|
void |
preInvoke(com.sun.ejb.EjbInvocation inv) |
protected void |
registerMonitorableComponents(Method[] msgListenerMethods) |
void |
releaseContext(com.sun.ejb.EjbInvocation inv)
Return instance to a pooled state.
|
protected void |
removeBean(com.sun.ejb.containers.EJBLocalRemoteObject ejbo,
Method removeMethod,
boolean local) |
boolean |
scanForEjbCreateMethod() |
void |
setEJBHome(javax.ejb.EJBHome ejbHome) |
void |
startApplication(boolean deploy)
Called when the application containing this message-bean has
successfully gotten through the initial load phase of each
module.
|
protected static int |
stringToInt(String val,
String appName,
Logger logger) |
boolean |
userTransactionMethodsAllowed(org.glassfish.api.invocation.ComponentInvocation inv) |
protected int |
validateValue(int value,
int lowLimit,
int highLimit,
int deft,
String emsg,
String appName,
Logger logger) |
_constructEJBInstance, addInvocationInfo, addProxyInterfacesSetClass, adjustHomeTargetMethodInfo, adjustInvocationInfo, assertValidLocalObject, assertValidRemoteObject, authorize, authorizeLocalGetPrimaryKey, authorizeLocalMethod, authorizeRemoteGetPrimaryKey, authorizeRemoteMethod, cancelTimers, checkExceptionClientTx, checkExists, checkUnfinishedTx, checkUserTransactionLookup, cleanupInstance, containerStateToString, createCallFlowAgent, createEjbInstanceAndContext, createEjbInvocation, createEjbInvocation, createEJBLocalObjectImpl, createMonitoringRegistry, createRemoteReferenceWithId, delistExtendedEntityManagers, doAfterBegin, doEJBHomeRemove, doFlush, doTimerInvocationInit, enlistExtendedEntityManagers, externalPostInvoke, externalPreInvoke, findFlushEnabledAttr, getApplicationId, getClassLoader, getComponentId, getContainerClassLoader, getContainerId, getContainerType, getContext, getDebugMonitorFlag, getDescriptor, getEJBClass, getEjbDescriptor, getEJBHome, getEJBHomeInvocationHandler, getEJBHomeStub, getEJBLocalBusinessHome, getEJBLocalHome, getEJBLocalHomeInvocationHandler, getEJBLocalObjectForPrimaryKey, getEJBLocalObjectForPrimaryKey, getEJBLocalObjectImpl, 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, isEjbTimeoutMethod, isHAEnabled, isIdentical, isLocalInterfaceSupported, isLocalObject, isRemoteInterfaceSupported, isRemoteObject, isStopped, isSystemUncheckedException, isTimedObject, isUndeployed, lookupExtendedEntityManager, onEnteringContainer, onLeavingContainer, onReady, onShutdown, onTermination, postCreate, postEjbTimeout, postFind, postInvoke, postInvokeNoTx, postInvokeTx, postProcessInvocationInfo, preInitialize, preInvokeNoTx, preInvokeTx, prepareEjbTimeoutParams, preSelect, registerMonitorableComponents, registerTimerMonitorableComponent, releaseTargetObject, removeBeanUnchecked, removeBeanUnchecked, resumeTransaction, setDebugMonitorFlag, setEJBMetaData, setSecurityManager, setStartedState, setStoppedState, setUndeployedState, suspendTransaction, toString, undeploy, useClientTx, validateEMForClientTx, validateTxAttr, webServicePostInvokeprotected void registerMonitorableComponents(Method[] msgListenerMethods)
protected com.sun.ejb.monitoring.stats.EjbMonitoringStatsProvider getMonitoringStatsProvider(String appName, String modName, String ejbName)
getMonitoringStatsProvider in class com.sun.ejb.containers.BaseContainerpublic boolean scanForEjbCreateMethod()
scanForEjbCreateMethod in class com.sun.ejb.containers.BaseContainerprotected void initializeHome()
throws Exception
initializeHome in class com.sun.ejb.containers.BaseContainerExceptionprotected void addLocalRemoteInvocationInfo()
throws Exception
addLocalRemoteInvocationInfo in class com.sun.ejb.containers.BaseContainerExceptionprotected final boolean isCreateHomeFinder(Method method)
isCreateHomeFinder in class com.sun.ejb.containers.BaseContainerprotected int validateValue(int value,
int lowLimit,
int highLimit,
int deft,
String emsg,
String appName,
Logger logger)
public String getMonitorAttributeValues()
public boolean userTransactionMethodsAllowed(org.glassfish.api.invocation.ComponentInvocation inv)
userTransactionMethodsAllowed in interface com.sun.ejb.ContaineruserTransactionMethodsAllowed in class com.sun.ejb.containers.BaseContainerpublic com.sun.ejb.containers.EJBObjectImpl getEJBObjectImpl(byte[] instanceKey)
getEJBObjectImpl in class com.sun.ejb.containers.BaseContainerpublic com.sun.ejb.containers.EJBObjectImpl createEJBObjectImpl()
throws javax.ejb.CreateException
createEJBObjectImpl in class com.sun.ejb.containers.BaseContainerjavax.ejb.CreateExceptionprotected void removeBean(com.sun.ejb.containers.EJBLocalRemoteObject ejbo,
Method removeMethod,
boolean local)
throws javax.ejb.RemoveException,
javax.ejb.EJBException
removeBean in class com.sun.ejb.containers.BaseContainerjavax.ejb.RemoveExceptionjavax.ejb.EJBExceptionprotected boolean callEJBTimeout(com.sun.ejb.containers.RuntimeTimerState timerState,
com.sun.ejb.containers.EJBTimerService timerService)
throws Exception
callEJBTimeout in class com.sun.ejb.containers.BaseContainerExceptionprotected void forceDestroyBean(com.sun.ejb.containers.EJBContextImpl sc)
forceDestroyBean in class com.sun.ejb.containers.BaseContainerpublic void preInvoke(com.sun.ejb.EjbInvocation inv)
preInvoke in interface com.sun.ejb.ContainerpreInvoke in class com.sun.ejb.containers.BaseContainerprotected com.sun.ejb.ComponentContext _getContext(com.sun.ejb.EjbInvocation inv)
_getContext in class com.sun.ejb.containers.BaseContainerpublic void releaseContext(com.sun.ejb.EjbInvocation inv)
releaseContext in class com.sun.ejb.containers.BaseContainerpublic void postInvoke(com.sun.ejb.EjbInvocation inv)
postInvoke in interface com.sun.ejb.ContainerpostInvoke in class com.sun.ejb.containers.BaseContainerpublic org.glassfish.ejb.api.MessageBeanListener createMessageBeanListener(com.sun.appserv.connectors.internal.api.ResourceHandle resource)
throws org.glassfish.ejb.api.ResourcesExceededException
createMessageBeanListener in interface org.glassfish.ejb.api.MessageBeanProtocolManagerorg.glassfish.ejb.api.ResourcesExceededExceptionpublic void destroyMessageBeanListener(org.glassfish.ejb.api.MessageBeanListener listener)
destroyMessageBeanListener in interface org.glassfish.ejb.api.MessageBeanProtocolManagerpublic boolean isDeliveryTransacted(Method method)
isDeliveryTransacted in interface org.glassfish.ejb.api.MessageBeanProtocolManagermethod - One of the methods used to deliver messages, e.g. onMessage
method for javax.jms.MessageListener. Note that if the
method is not one of the methods for message
delivery, the behavior of this method is not defined.public com.sun.enterprise.deployment.runtime.BeanPoolDescriptor getPoolDescriptor()
getPoolDescriptor in interface org.glassfish.ejb.api.MessageBeanProtocolManagerprotected com.sun.ejb.containers.EJBContextImpl _constructEJBContextImpl(Object instance)
_constructEJBContextImpl in class com.sun.ejb.containers.BaseContainerprotected void afterBegin(com.sun.ejb.containers.EJBContextImpl context)
afterBegin in class com.sun.ejb.containers.BaseContainerprotected void beforeCompletion(com.sun.ejb.containers.EJBContextImpl context)
beforeCompletion in class com.sun.ejb.containers.BaseContainerprotected void afterCompletion(com.sun.ejb.containers.EJBContextImpl ctx,
int status)
afterCompletion in class com.sun.ejb.containers.BaseContainerpublic boolean passivateEJB(com.sun.ejb.ComponentContext context)
passivateEJB in class com.sun.ejb.containers.BaseContainerpublic void startApplication(boolean deploy)
startApplication in interface com.sun.ejb.ContainerstartApplication in class com.sun.ejb.containers.BaseContainerdeploy - true if this method is called during application deployprotected void doConcreteContainerShutdown(boolean appBeingUndeployed)
doConcreteContainerShutdown in class com.sun.ejb.containers.BaseContainerpublic void beforeMessageDelivery(Method method, MessageBeanContainer.MessageDeliveryType deliveryType, boolean txImported, com.sun.appserv.connectors.internal.api.ResourceHandle resourceHandle)
public void afterMessageDelivery(com.sun.appserv.connectors.internal.api.ResourceHandle resourceHandle)
public long getMessageCount()
Copyright © 2013. All Rights Reserved.