|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.ejb.containers.BaseContainer
com.sun.ejb.containers.MessageBeanContainer
public final class MessageBeanContainer
This class provides container functionality specific to message-driven EJBs. At deployment time, one instance of the MessageDrivenBeanContainer is created for each message-driven bean in an application.
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.
| Nested Class Summary | |
|---|---|
static class |
MessageBeanContainer.MessageDeliveryType
|
| Nested classes/interfaces inherited from class com.sun.ejb.containers.BaseContainer |
|---|
BaseContainer.ContainerType |
| Field Summary |
|---|
| 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 |
| Method Summary | |
|---|---|
protected EJBContextImpl |
_constructEJBContextImpl(java.lang.Object instance)
|
protected ComponentContext |
_getContext(EjbInvocation inv)
|
void |
activateEJB(java.lang.Object ctx,
java.lang.Object instanceKey)
|
void |
afterMessageDelivery(ResourceHandle resourceHandle)
|
void |
beforeMessageDelivery(java.lang.reflect.Method method,
MessageBeanContainer.MessageDeliveryType deliveryType,
boolean txImported,
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. |
EJBObjectImpl |
createEJBObjectImpl()
|
MessageBeanListener |
createMessageBeanListener(ResourceHandle resource)
The following are implementation for methods required by the * MessageBeanProtocalManager interface. |
java.lang.Object |
deliverMessage(java.lang.Object[] params)
|
void |
destroyMessageBeanListener(MessageBeanListener listener)
|
protected void |
doConcreteContainerShutdown(boolean appBeingUndeployed)
Called by BaseContainer during container shutdown sequence |
EJBObjectImpl |
getEJBObjectImpl(byte[] instanceKey)
Called when a remote invocation arrives for an EJB. |
long |
getMessageCount()
|
java.lang.String |
getMonitorAttributeValues()
|
protected EjbMonitoringStatsProvider |
getMonitoringStatsProvider(java.lang.String appName,
java.lang.String modName,
java.lang.String ejbName)
|
BeanPoolDescriptor |
getPoolDescriptor()
|
protected void |
initializeHome()
Called from the ContainerFactory during initialization. |
boolean |
isDeliveryTransacted(java.lang.reflect.Method method)
|
boolean |
passivateEJB(ComponentContext context)
|
void |
postInvoke(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(EjbInvocation inv)
Called from EJBObject/EJBHome before invoking on EJB. |
protected void |
registerMonitorableComponents(java.lang.reflect.Method[] msgListenerMethods)
|
void |
releaseContext(EjbInvocation inv)
Return instance to a pooled state. |
void |
setEJBHome(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(java.lang.String val,
java.lang.String appName,
java.util.logging.Logger logger)
|
boolean |
userTransactionMethodsAllowed(ComponentInvocation inv)
EJB spec makes a distinction between access to the UserTransaction object itself and access to its methods. |
protected int |
validateValue(int value,
int lowLimit,
int highLimit,
int deft,
java.lang.String emsg,
java.lang.String appName,
java.util.logging.Logger logger)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
protected void registerMonitorableComponents(java.lang.reflect.Method[] msgListenerMethods)
protected EjbMonitoringStatsProvider getMonitoringStatsProvider(java.lang.String appName,
java.lang.String modName,
java.lang.String ejbName)
getMonitoringStatsProvider in class BaseContainer
protected void initializeHome()
throws java.lang.Exception
BaseContainer
java.lang.Exception
protected static int stringToInt(java.lang.String val,
java.lang.String appName,
java.util.logging.Logger logger)
protected int validateValue(int value,
int lowLimit,
int highLimit,
int deft,
java.lang.String emsg,
java.lang.String appName,
java.util.logging.Logger logger)
public java.lang.String getMonitorAttributeValues()
public boolean userTransactionMethodsAllowed(ComponentInvocation inv)
BaseContainer
userTransactionMethodsAllowed in interface ContaineruserTransactionMethodsAllowed in class BaseContainer
public void setEJBHome(EJBHome ejbHome)
throws java.lang.Exception
java.lang.Exceptionpublic EJBObjectImpl getEJBObjectImpl(byte[] instanceKey)
BaseContainer
public EJBObjectImpl createEJBObjectImpl()
throws CreateException
CreateExceptionpublic void preInvoke(EjbInvocation inv)
BaseContainer
preInvoke in interface ContainerpreInvoke in class BaseContainerprotected ComponentContext _getContext(EjbInvocation inv)
_getContext in class BaseContainerpublic void releaseContext(EjbInvocation inv)
releaseContext in class BaseContainerpublic void postInvoke(EjbInvocation inv)
postInvoke in interface ContainerpostInvoke in class BaseContainer
public MessageBeanListener createMessageBeanListener(ResourceHandle resource)
throws ResourcesExceededException
createMessageBeanListener in interface MessageBeanProtocolManagerResourcesExceededExceptionpublic void destroyMessageBeanListener(MessageBeanListener listener)
destroyMessageBeanListener in interface MessageBeanProtocolManagerpublic boolean isDeliveryTransacted(java.lang.reflect.Method method)
isDeliveryTransacted in interface 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 BeanPoolDescriptor getPoolDescriptor()
getPoolDescriptor in interface MessageBeanProtocolManagerprotected EJBContextImpl _constructEJBContextImpl(java.lang.Object instance)
_constructEJBContextImpl in class BaseContainerpublic boolean passivateEJB(ComponentContext context)
public void activateEJB(java.lang.Object ctx,
java.lang.Object instanceKey)
public void startApplication(boolean deploy)
startApplication in interface ContainerstartApplication in class BaseContainerdeploy - true if this method is called during application deployprotected void doConcreteContainerShutdown(boolean appBeingUndeployed)
doConcreteContainerShutdown in class BaseContainer
public void beforeMessageDelivery(java.lang.reflect.Method method,
MessageBeanContainer.MessageDeliveryType deliveryType,
boolean txImported,
ResourceHandle resourceHandle)
public java.lang.Object deliverMessage(java.lang.Object[] params)
throws java.lang.Throwable
java.lang.Throwablepublic void afterMessageDelivery(ResourceHandle resourceHandle)
public long getMessageCount()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||