public abstract class NonBlockingClientAdapter<T> extends Object implements NonBlockingClientListener<T>
NonBlockingClientListener
object and override the methods for the events of interest.
(If you implement the NonBlockingClientListener
interface, you have to define all of the methods in it.
This abstract class defines null methods for them all, so you can only have to define methods for
events you care about.)Constructor and Description |
---|
NonBlockingClientAdapter() |
Modifier and Type | Method and Description |
---|---|
void |
onDrain(NonBlockingClient client,
T context)
Called as a notification when the client has flushed any buffered messages to the network.
|
void |
onRestarted(NonBlockingClient client,
T context)
Called as a notification when the client transitions into restarting state.
|
void |
onRetrying(NonBlockingClient client,
T context,
ClientException throwable)
Called as a notification when the client transitions into retrying state.
|
void |
onStarted(NonBlockingClient client,
T context)
Called as a notification when the client transitions into started state.
|
void |
onStopped(NonBlockingClient client,
T context,
ClientException throwable)
Called as a notification when the client transitions into stopped state.
|
public void onStarted(NonBlockingClient client, T context)
NonBlockingClientListener
onStarted
in interface NonBlockingClientListener<T>
client
- a reference to the client that the listener was registered for and
this notification pertains to.context
- the context object that was specified when the listener was registered.public void onStopped(NonBlockingClient client, T context, ClientException throwable)
NonBlockingClientListener
onStopped
in interface NonBlockingClientListener<T>
client
- a reference to the client that the listener was registered for and
this notification pertains to.context
- the context object that was specified when the listener was registered.throwable
- indicates why the client transitioned into stopped state. This will be
null
when the client transitions into stopped state because
the stop()
method is called on the client.
This exception can be one of the following client type exceptions:
NetworkException
indicates a non-recoverable network type error.SecurityException
indicates a security related error.ReplacedException
indicates that the client has been replaced by another instance
of itself.ClientException
a general client type exception, usually caused by another
exception.public void onRestarted(NonBlockingClient client, T context)
NonBlockingClientListener
onRestarted
in interface NonBlockingClientListener<T>
client
- a reference to the client that the listener was registered for and
this notification pertains to.context
- the context object that was specified when the listener was registered.public void onRetrying(NonBlockingClient client, T context, ClientException throwable)
NonBlockingClientListener
onRetrying
in interface NonBlockingClientListener<T>
client
- a reference to the client that the listener was registered for and
this notification pertains to.context
- the context object that was specified when the listener was registered.throwable
- indicates why the client transitioned (or remains) in the retrying state.
This exception can be one of the following client type exceptions:
NetworkException
indicates a network type error.ClientException
a general client type exception, usually caused by another exception.public void onDrain(NonBlockingClient client, T context)
NonBlockingClientListener
NonBlockingClient.send(java.lang.String, java.lang.String, java.util.Map<java.lang.String, java.lang.Object>, com.ibm.mqlight.api.SendOptions, com.ibm.mqlight.api.CompletionListener<T>, T)
method to efficiently
send messages without buffering a large number of messages in memory allocated by the client.onDrain
in interface NonBlockingClientListener<T>
client
- a reference to the client that the listener was registered for and this notification pertains to.context
- the context object that was specified when the listener was registered.Copyright © 2015 International Business Machines Corporation. All rights reserved.