Package com.github.shyiko.mysql.binlog
Class BinaryLogClient.AbstractLifecycleListener
- java.lang.Object
-
- com.github.shyiko.mysql.binlog.BinaryLogClient.AbstractLifecycleListener
-
- All Implemented Interfaces:
BinaryLogClient.LifecycleListener
- Enclosing class:
- BinaryLogClient
public abstract static class BinaryLogClient.AbstractLifecycleListener extends Object implements BinaryLogClient.LifecycleListener
Default (no-op) implementation ofBinaryLogClient.LifecycleListener.
-
-
Constructor Summary
Constructors Constructor Description AbstractLifecycleListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonCommunicationFailure(BinaryLogClient client, Exception ex)It's guarantied to be called beforeBinaryLogClient.LifecycleListener.onDisconnect(BinaryLogClient)) in case of communication failure.voidonConnect(BinaryLogClient client)Called once client has successfully logged in but before started to receive binlog events.voidonDisconnect(BinaryLogClient client)Called upon disconnect (regardless of the reason).voidonEventDeserializationFailure(BinaryLogClient client, Exception ex)Called in case of failed event deserialization.
-
-
-
Method Detail
-
onConnect
public void onConnect(BinaryLogClient client)
Description copied from interface:BinaryLogClient.LifecycleListenerCalled once client has successfully logged in but before started to receive binlog events.- Specified by:
onConnectin interfaceBinaryLogClient.LifecycleListener- Parameters:
client- the client that logged in
-
onCommunicationFailure
public void onCommunicationFailure(BinaryLogClient client, Exception ex)
Description copied from interface:BinaryLogClient.LifecycleListenerIt's guarantied to be called beforeBinaryLogClient.LifecycleListener.onDisconnect(BinaryLogClient)) in case of communication failure.- Specified by:
onCommunicationFailurein interfaceBinaryLogClient.LifecycleListener- Parameters:
client- the client that triggered the communication failureex- The exception that triggered the communication failutre
-
onEventDeserializationFailure
public void onEventDeserializationFailure(BinaryLogClient client, Exception ex)
Description copied from interface:BinaryLogClient.LifecycleListenerCalled in case of failed event deserialization. Note this type of error does NOT cause client to disconnect. If you wish to stop receiving events you'll need to fire client.disconnect() manually.- Specified by:
onEventDeserializationFailurein interfaceBinaryLogClient.LifecycleListener- Parameters:
client- the client that failed event deserializationex- The exception that triggered the failutre
-
onDisconnect
public void onDisconnect(BinaryLogClient client)
Description copied from interface:BinaryLogClient.LifecycleListenerCalled upon disconnect (regardless of the reason).- Specified by:
onDisconnectin interfaceBinaryLogClient.LifecycleListener- Parameters:
client- the client that disconnected
-
-