org.exolab.jmscts.core
Class DelegatingListener

java.lang.Object
  |
  +--org.exolab.jmscts.core.DelegatingListener
All Implemented Interfaces:
javax.jms.MessageListener
Direct Known Subclasses:
WaitingListener

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

A listener which delegates to one or more registered listeners

Version:
$Revision: 1.2 $ $Date: 2004/01/31 13:44:24 $
Author:
Tim Anderson

Constructor Summary
DelegatingListener()
          Construct a new DelegatingListener
DelegatingListener(javax.jms.MessageListener listener)
          Construct a new DelegatingListener, and register an initial listener
 
Method Summary
 void addMessageListener(javax.jms.MessageListener listener)
          Register a message listener
 void onMessage(javax.jms.Message message)
          Invokes MessageListener.onMessage() for each of the registered listeners
 void removeMessageListener(javax.jms.MessageListener listener)
          Deregister a message listener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelegatingListener

public DelegatingListener()
Construct a new DelegatingListener

DelegatingListener

public DelegatingListener(javax.jms.MessageListener listener)
Construct a new DelegatingListener, and register an initial listener
Parameters:
listener - the listener to register
Method Detail

onMessage

public void onMessage(javax.jms.Message message)
Invokes MessageListener.onMessage() for each of the registered listeners
Specified by:
onMessage in interface javax.jms.MessageListener
Parameters:
message - the received message

addMessageListener

public void addMessageListener(javax.jms.MessageListener listener)
Register a message listener
Parameters:
listener - the listener to register

removeMessageListener

public void removeMessageListener(javax.jms.MessageListener listener)
Deregister a message listener
Parameters:
listener - the listener to deregister


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