Event Handling

The replication system is capable of reporting a great many events to which your code might need to respond. To track and respond to these events, you implement a class whose function it is to respond to events that happen within the DB library.

In order to respond to events, you must write your application as an implementation of com.sleepycat.db.EventHandler. This class gives you a series of methods within which you can detect and respond to various events that occur in your DB code. Note that some of these are necessary for events beyond those required for replication. In this section, however, we only discuss some of the replication-specific events.

Some of the more commonly handled replication events are described below. For a complete list of events, see the com.sleepycat.db.EventHandler javadoc page.

For an example of how to use this callback, see Determining State