Package com.kristensoft.kdc
Class TcpClientEventAdapter
- java.lang.Object
-
- com.kristensoft.kdc.TcpClientEventAdapter
-
- All Implemented Interfaces:
TcpClientEventHandler
public abstract class TcpClientEventAdapter extends Object implements TcpClientEventHandler
Provides a convenience adapter for receivingTcpClientevents.This class provides empty implementations of all methods defined by
TcpClientEventHandler, allowing subclasses to override only the event methods they are interested in.- Author:
- Charles B. Kozoyed
- See Also:
TcpClientEventHandler,TcpClient
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonConnecting(TcpClient tcpClient)Called when the TCP client begins attempting to establish a connection.voidonConnectionAttemptAborted(TcpClient tcpClient)Called when a TCP connection attempt is aborted.voidonConnectionClosed(TcpClient tcpClient)Called when the TCP client's connection is closed.voidonConnectionDropped(TcpClient tcpClient, String msg, Exception ex)Called when an established TCP connection is dropped.voidonConnectionEstablished(TcpClient tcpClient)Called when the TCP client establishes a connection.voidonConnectionFailed(TcpClient tcpClient)Called when a TCP connection attempt fails.voidonReceivedAgent(Agent agent)Called when an agent is received by the TCP client.voidonReceivedReply(Reply reply)Called when a reply is received by the TCP client.voidonReconnecting(TcpClient tcpClient)Called when the TCP client begins attempting to reconnect.voidonSendingAsyncAgent(Agent agent)Called when the TCP client is sending an asynchronous agent.voidonSendingSyncAgent(Agent agent)Called when the TCP client is sending a synchronous agent.voidonSocketCreated(TcpClient tcpClient)Called when a socket has been created for the TCP client.voidonWaitingToReconnect(TcpClient tcpClient, long waitTime)Called when the TCP client is waiting before another reconnection attempt.
-
-
-
Method Detail
-
onSocketCreated
public void onSocketCreated(TcpClient tcpClient)
Called when a socket has been created for the TCP client.- Specified by:
onSocketCreatedin interfaceTcpClientEventHandler- Parameters:
tcpClient- the TCP client for which the socket was created
-
onConnecting
public void onConnecting(TcpClient tcpClient)
Called when the TCP client begins attempting to establish a connection.- Specified by:
onConnectingin interfaceTcpClientEventHandler- Parameters:
tcpClient- the TCP client attempting to connect
-
onReconnecting
public void onReconnecting(TcpClient tcpClient)
Called when the TCP client begins attempting to reconnect.- Specified by:
onReconnectingin interfaceTcpClientEventHandler- Parameters:
tcpClient- the TCP client attempting to reconnect
-
onConnectionEstablished
public void onConnectionEstablished(TcpClient tcpClient)
Called when the TCP client establishes a connection.- Specified by:
onConnectionEstablishedin interfaceTcpClientEventHandler- Parameters:
tcpClient- the TCP client that established the connection
-
onConnectionFailed
public void onConnectionFailed(TcpClient tcpClient)
Called when a TCP connection attempt fails.- Specified by:
onConnectionFailedin interfaceTcpClientEventHandler- Parameters:
tcpClient- the TCP client whose connection attempt failed
-
onConnectionDropped
public void onConnectionDropped(TcpClient tcpClient, String msg, Exception ex)
Called when an established TCP connection is dropped.- Specified by:
onConnectionDroppedin interfaceTcpClientEventHandler- Parameters:
tcpClient- the TCP client whose connection was droppedmsg- the message describing the connection dropex- the exception associated with the connection drop
-
onConnectionClosed
public void onConnectionClosed(TcpClient tcpClient)
Called when the TCP client's connection is closed.- Specified by:
onConnectionClosedin interfaceTcpClientEventHandler- Parameters:
tcpClient- the TCP client whose connection was closed
-
onConnectionAttemptAborted
public void onConnectionAttemptAborted(TcpClient tcpClient)
Called when a TCP connection attempt is aborted.- Specified by:
onConnectionAttemptAbortedin interfaceTcpClientEventHandler- Parameters:
tcpClient- the TCP client whose connection attempt was aborted
-
onReceivedAgent
public void onReceivedAgent(Agent agent)
Called when an agent is received by the TCP client.This callback provides notification of received agents independently of normal agent dispatch to registered API implementations.
- Specified by:
onReceivedAgentin interfaceTcpClientEventHandler- Parameters:
agent- the agent received by the TCP client
-
onSendingSyncAgent
public void onSendingSyncAgent(Agent agent)
Called when the TCP client is sending a synchronous agent.- Specified by:
onSendingSyncAgentin interfaceTcpClientEventHandler- Parameters:
agent- the synchronous agent being sent
-
onReceivedReply
public void onReceivedReply(Reply reply)
Called when a reply is received by the TCP client.- Specified by:
onReceivedReplyin interfaceTcpClientEventHandler- Parameters:
reply- the reply received by the TCP client
-
onSendingAsyncAgent
public void onSendingAsyncAgent(Agent agent)
Called when the TCP client is sending an asynchronous agent.- Specified by:
onSendingAsyncAgentin interfaceTcpClientEventHandler- Parameters:
agent- the asynchronous agent being sent
-
onWaitingToReconnect
public void onWaitingToReconnect(TcpClient tcpClient, long waitTime)
Called when the TCP client is waiting before another reconnection attempt.- Specified by:
onWaitingToReconnectin interfaceTcpClientEventHandler- Parameters:
tcpClient- the TCP client waiting to reconnectwaitTime- the reconnect delay in milliseconds
-
-