org.activemq.util
Class MessageListenerSupport
java.lang.Object
org.activemq.util.MessageListenerSupport
- All Implemented Interfaces:
- javax.jms.MessageListener
- public abstract class MessageListenerSupport
- extends java.lang.Object
- implements javax.jms.MessageListener
A helper base class which makes writing message listeners easier without
having to worry about handling the JMSException on the onMessage() method.
By default the JMS ExceptionListener will be used to handle any JMS exceptions
or if none is configured then a runtime exception will be generated.
- Version:
- $Revision: 1.1.1.1 $
- Author:
- James Strachan
Method Summary |
javax.jms.ExceptionListener |
getExceptionListener()
|
protected void |
onJMSException(javax.jms.JMSException e,
javax.jms.Message message)
Process the JMS exception either by calling an exception listener
which can contian custom logic or by throwing a runtime exception |
void |
onMessage(javax.jms.Message message)
|
protected abstract void |
processMessage(javax.jms.Message messsage)
This method processes the incoming message possibly throwing a JMSException
if the message could not be processed correctly. |
void |
setExceptionListener(javax.jms.ExceptionListener exceptionListener)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MessageListenerSupport
public MessageListenerSupport()
onMessage
public void onMessage(javax.jms.Message message)
- Specified by:
onMessage
in interface javax.jms.MessageListener
getExceptionListener
public javax.jms.ExceptionListener getExceptionListener()
setExceptionListener
public void setExceptionListener(javax.jms.ExceptionListener exceptionListener)
processMessage
protected abstract void processMessage(javax.jms.Message messsage)
throws java.lang.Exception
- This method processes the incoming message possibly throwing a JMSException
if the message could not be processed correctly.
- Parameters:
messsage
-
- Throws:
java.lang.Exception
onJMSException
protected void onJMSException(javax.jms.JMSException e,
javax.jms.Message message)
- Process the JMS exception either by calling an exception listener
which can contian custom logic or by throwing a runtime exception
- Parameters:
e
- message
-
Copyright © 2004-2005 Protique, Ltd.. All Rights Reserved.