org.openeai.jms.consumer
Class MessageConsumer.MessageTransaction

java.lang.Object
  extended by org.openeai.jms.consumer.MessageConsumer.MessageTransaction
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
MessageConsumer

protected class MessageConsumer.MessageTransaction
extends java.lang.Object
implements java.lang.Runnable

This is the class that is used to execute the SyncCommand associated to a message consumed by the Consumer. When a message is delivered to the Destination onwhich the consumer is connected and there is no expected reply, it will instantiate this class passing a message number and the actual message it consumed and add this classes run method to the ThreadPool (if the ThreadPool is in use). If the ThreadPool is not in use, the consumer will simply call this classes run method and will block until that command's execution is complete.

By adding this "job" to the ThreadPool, the consumer does not wait for the command to complete execution before consuming another message. Therefore, you can affect how many "jobs" may be in progress by configuring the ThreadPool associated to this Consumer.

Since both PubSub and PointToPoint Consumers may handle SyncCommands, this class is defined at this ancestor level. A PointToPointConsumer also contains a RequestTransaction that executes RequestCommands if the incomming request expects a reply.

Version:
3.0 - 28 January 2003
Author:
Tod Jackson (tod@openeai.org)
See Also:
ThreadPoolConfig, ThreadPool, PubSubConsumer.MyTopicListener.onMessage(Message), PointToPointConsumer.MyQueueListener.onMessage(Message), PointToPointConsumer.RequestTransaction

Constructor Summary
MessageConsumer.MessageTransaction(int messageNumber, javax.jms.Message inMsg)
           
 
Method Summary
 void run()
          Calls the handleSync method passing the message number and Message consumed by the consumer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageConsumer.MessageTransaction

public MessageConsumer.MessageTransaction(int messageNumber,
                                          javax.jms.Message inMsg)
Method Detail

run

public void run()
Calls the handleSync method passing the message number and Message consumed by the consumer. We break this out so both PubSub and PointToPoint consumers can inherit the handleSync functionality.

Specified by:
run in interface java.lang.Runnable
See Also:
MessageConsumer.handleSync(int, Message)


Copyright © 2002,2003 OpenEAI Software Foundation