public RPCConnectionListener<I extends RPCOps>
A listener that can be attached to class MultiRPCClient
to be notified about important RPC connectivity events.
class MultiRPCClient
Modifier and Type | Method and Description |
---|---|
void |
onConnect(RPCConnectionListener.ConnectionContext<I> context)
This method will be called to inform that RPC connection is established.
RPCConnectionListener.ConnectionContext.getConnectionOpt will not be null . |
void |
onDisconnect(RPCConnectionListener.ConnectionContext<I> context)
This method will be called to inform about connection loss. Since given RPC client may produce multiple
interface RPCConnection s,
RPCConnectionListener.ConnectionContext.getConnectionOpt will specify which connection is interrupted. |
void |
onPermanentFailure(RPCConnectionListener.ConnectionContext<I> context)
This is a terminal notification to inform that:
|
void onConnect(RPCConnectionListener.ConnectionContext<I> context)
This method will be called to inform that RPC connection is established. RPCConnectionListener.ConnectionContext.getConnectionOpt
will not be null
.
If connection is lost RPC client will attempt to re-connect and if this is successful then this method will be called
again with the same reference of RPCConnectionListener.ConnectionContext.getConnectionOpt
as during initial connect. I.e. it is possible to say that once
established RPCConnectionListener.ConnectionContext.getConnectionOpt
stays constant during RPCConnectionListener.onConnect
/RPCConnectionListener.onDisconnect
cycles.
void onDisconnect(RPCConnectionListener.ConnectionContext<I> context)
This method will be called to inform about connection loss. Since given RPC client may produce multiple interface RPCConnection
s,
RPCConnectionListener.ConnectionContext.getConnectionOpt
will specify which connection is interrupted.
void onPermanentFailure(RPCConnectionListener.ConnectionContext<I> context)
This is a terminal notification to inform that:
it has never been possible to connect due to incorrect credentials or endpoints addresses supplied. In this case
RPCConnectionListener.ConnectionContext.getConnectionOpt
will be null
;
or
no further reconnection will be performed as maximum number of attempts has been reached. In this case
RPCConnectionListener.ConnectionContext.getConnectionOpt
may not be null
.