org.ow2.bonita.pvm.internal.ejb
Class CommandReceiverMDB

java.lang.Object
  extended by org.ow2.bonita.pvm.internal.ejb.CommandReceiverMDB
All Implemented Interfaces:
java.io.Serializable, javax.ejb.EnterpriseBean, javax.ejb.MessageDrivenBean, javax.jms.MessageListener

public class CommandReceiverMDB
extends java.lang.Object
implements javax.ejb.MessageDrivenBean, javax.jms.MessageListener

Message driven command receiver.

Configuration

The command receiver listens for messages on the destination established during deployment. Upon delivery, this bean extracts a command from the message according to the format described in the onMessage method.

If the message does not match the expected format, it is forwarded to the message destination referenced by jms/DeadLetterQueue. No further processing is done on the message.

After extraction, the receiver dispatches the command to the local command executor specified by the EJB reference ejb/LocalCommandExecutor.

In case the incoming message includes a replyTo destination, the result of the command execution is wrapped into a message and sent there. The resource manager connection factory reference jms/CommandConnectionFactory specifies the factory used to obtain JMS connections.

Author:
Jim Rigsbee, Tom Baeyens, Alejandro Guizar
See Also:
Serialized Form

Constructor Summary
CommandReceiverMDB()
           
 
Method Summary
 void ejbCreate()
           
 void ejbRemove()
           
 void onMessage(javax.jms.Message message)
          Processes a command message.
 void setMessageDrivenContext(javax.ejb.MessageDrivenContext messageDrivenContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandReceiverMDB

public CommandReceiverMDB()
Method Detail

onMessage

public void onMessage(javax.jms.Message message)
Processes a command message.

Message format

The incoming messages must conform to one of the following formats.

Specified by:
onMessage in interface javax.jms.MessageListener

setMessageDrivenContext

public void setMessageDrivenContext(javax.ejb.MessageDrivenContext messageDrivenContext)
Specified by:
setMessageDrivenContext in interface javax.ejb.MessageDrivenBean

ejbCreate

public void ejbCreate()

ejbRemove

public void ejbRemove()
Specified by:
ejbRemove in interface javax.ejb.MessageDrivenBean


Copyright © 2009 OW2 Consortium. All Rights Reserved.