-
public interface CompletionListener
ACompletionListener
is implemented by the application and may be specified when a message is sent asynchronously.When the sending of the message is complete, the Jakarta Messaging provider notifies the application by calling the
onCompletion(Message)
method of the specified completion listener. If the sending if the message fails for any reason, and an exception cannot be thrown by thesend
method, then the Jakarta Messaging provider calls theonException(Exception)
method of the specified completion listener.- Since:
- JMS 2.0
- Version:
- Jakarta Messaging 2.0
- See Also:
MessageProducer.send(jakarta.jms.Message,int,int,long,jakarta.jms.CompletionListener)
,MessageProducer.send(jakarta.jms.Destination,jakarta.jms.Message,jakarta.jms.CompletionListener)
,MessageProducer.send(jakarta.jms.Destination,jakarta.jms.Message,int,int,long,jakarta.jms.CompletionListener)
,JMSProducer.setAsync(jakarta.jms.CompletionListener)
,JMSProducer.getAsync()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
onCompletion(Message message)
Notifies the application that the message has been successfully sentvoid
onException(Message message, Exception exception)
Notifies user that the specified exception was thrown while attempting to send the specified message.
-
-
-
Method Detail
-
onCompletion
void onCompletion(Message message)
Notifies the application that the message has been successfully sent- Parameters:
message
- the message that was sent.
-
onException
void onException(Message message, Exception exception)
Notifies user that the specified exception was thrown while attempting to send the specified message. If an exception occurs it is undefined whether or not the message was successfully sent.- Parameters:
message
- the message that was sent.exception
- the exception
-
-