public interface AMQMethodListener
AMQMethodEvent
.
An event listener may be associated with a particular context, usually an AMQP channel, and in addition to receiving method events will be notified of errors on that context. This enables listeners to perform any clean up that they need to do before the context is closed or retried.
TODO Document why the exception is passed to the error method. Is it so that the exception can be passed from the event handling thread to another thread and rethown from there? It is unusual to pass exceptions as method arguments, because they have their own mechanism for propagating through the call stack, so some explanation ought to be provided.
Modifier and Type | Method and Description |
---|---|
void |
error(Exception e)
Notifies the listener of an error on the event context to which it is listening.
|
<B extends AMQMethodBody> |
methodReceived(AMQMethodEvent<B> evt)
Notifies the listener that an AMQP method event has occurred.
|
<B extends AMQMethodBody> boolean methodReceived(AMQMethodEvent<B> evt) throws QpidException
evt
- The AMQP method event (contains the method and channel).QpidException
- if an error has occurred. This exception may be delivered to all registered listeners using
the error() method (see below) allowing them to perform cleanup if necessary.
TODO Consider narrowing the exception.
void error(Exception e)
e
- The underlying exception that is the source of the error.Copyright © 2006–2016 The Apache Software Foundation. All rights reserved.