Package com.github.shyiko.mysql.binlog
Interface BinaryLogClient.LifecycleListener
- All Known Implementing Classes:
BinaryLogClient.AbstractLifecycleListener,BinaryLogClientStatistics
- Enclosing class:
BinaryLogClient
public static interface BinaryLogClient.LifecycleListener
BinaryLogClient's lifecycle listener.-
Method Summary
Modifier and TypeMethodDescriptionvoidonCommunicationFailure(BinaryLogClient client, Exception ex) It's guarantied to be called beforeonDisconnect(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 Details
-
onConnect
Called once client has successfully logged in but before started to receive binlog events.- Parameters:
client- the client that logged in
-
onCommunicationFailure
It's guarantied to be called beforeonDisconnect(BinaryLogClient)) in case of communication failure.- Parameters:
client- the client that triggered the communication failureex- The exception that triggered the communication failutre
-
onEventDeserializationFailure
Called 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.- Parameters:
client- the client that failed event deserializationex- The exception that triggered the failutre
-
onDisconnect
Called upon disconnect (regardless of the reason).- Parameters:
client- the client that disconnected
-