org.openeai.jms.consumer.commands
Interface RequestCommand

All Known Implementing Classes:
ApplicationSessionRequestCommand, EnterpriseRequestProxyCommand, EnterpriseSessionRequestCommand, EnterpriseUserPermissionRequestCommand, EnterpriseUserRequestCommand, FailureRequestCommand

public interface RequestCommand

The interface implmented by all RequestCommands and specifies that they must implement the 'execute' method which returns a JMS Message. These commands will be executed by the PointToPointConsumer when the JMSReplyTo property on a JMS message is not empty. The message returned by the RequestCommand will be returned to the calling application by the PointToPointConsumer.

Version:
3.0 beta2 - 28 January 2003
Author:
Tod Jackson (tod@openeai.org), Steve Wheat (steve@openeai.org)
See Also:
SyncCommand

Method Summary
 javax.jms.Message execute(int messageNumber, javax.jms.Message aMessage)
          Method used to implement business logic specific to a message or set of messages consumed by a OpenEAI PointToPointConsumer.
 

Method Detail

execute

public javax.jms.Message execute(int messageNumber,
                                 javax.jms.Message aMessage)
                          throws CommandException
Method used to implement business logic specific to a message or set of messages consumed by a OpenEAI PointToPointConsumer. When a consumer consumes a message it determines which RequestCommand implementation to execute and calls this method passing the JMS Message. The command then retrieves the body of the message and converts that into an XML Document (org.jdom.Document). Then the command executes business logic appropriate to it based on the contents of the message.

Returns:
Message the JMS Message that should be returned to the calling application after the command has performed its business logic.

Throws:
CommandException. - Generally, this exception should only ever be thrown if the Command has trouble turning the message body of the JMS Message passed to the execute method into an XML Document (org.jdom.Document). Any other error encountered by the command should be handled accordingly by returning a Reply document with errors indicating the nature of the problem.
CommandException
See Also:
SyncCommand.execute


Copyright © 2002, OpenEAI Software Foundation