-
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 JMS 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 JMS provider calls theonException(Exception)
method of the specified completion listener.- Since:
- JMS 2.0
- Version:
- JMS 2.0
- See Also:
MessageProducer.send(javax.jms.Message,int,int,long,javax.jms.CompletionListener)
,MessageProducer.send(javax.jms.Destination,javax.jms.Message,javax.jms.CompletionListener)
,MessageProducer.send(javax.jms.Destination,javax.jms.Message,int,int,long,javax.jms.CompletionListener)
,JMSProducer.setAsync(javax.jms.CompletionListener)
,JMSProducer.getAsync()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and 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
-
-
Document created the 11/06/2005, last modified the 18/08/2025
Source of the printed document:https://www.gaudry.be/en/java-api-javaee-rf-javax/jms/completionlistener.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author of this site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.