org.exolab.jmscts.core
Class EchoListener

java.lang.Object
  |
  +--org.exolab.jmscts.core.EchoListener
All Implemented Interfaces:
javax.jms.MessageListener

public class EchoListener
extends java.lang.Object
implements javax.jms.MessageListener

This helper class implements the MessageListener interface and echoes messages to another destination

Version:
$Revision: 1.3 $
Author:
Tim Anderson

Constructor Summary
EchoListener(MessageSender sender, int count)
          Construct an instance with the sender, the number of messages to send when onMessage(javax.jms.Message) is invoked
EchoListener(javax.jms.Session session, MessageSender sender, int count, boolean commit)
          Construct an instance with the session, sender, the number of messages to send when onMessage(javax.jms.Message) is invoked.
 
Method Summary
 void onMessage(javax.jms.Message message)
          Invoked when the consumer asynchronously receives a message
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EchoListener

public EchoListener(MessageSender sender,
                    int count)
Construct an instance with the sender, the number of messages to send when onMessage(javax.jms.Message) is invoked
Parameters:
sender - the message sender
count - the number of messages to send

EchoListener

public EchoListener(javax.jms.Session session,
                    MessageSender sender,
                    int count,
                    boolean commit)
Construct an instance with the session, sender, the number of messages to send when onMessage(javax.jms.Message) is invoked.
Parameters:
session - the underlying session
sender - the message sender
count - the number of messages to send
commit - if true and the session is transacted, commit the session after sending the messages
Method Detail

onMessage

public void onMessage(javax.jms.Message message)
Invoked when the consumer asynchronously receives a message
Specified by:
onMessage in interface javax.jms.MessageListener
Parameters:
message - the received message


Copyright © 2001-2004 JMS CTS Team. All Rights Reserved.