MonitorChangeListener (Oracle - Berkeley DB Java Edition API)
Date: 2014-12-16

com.sleepycat.je.rep.monitor

## Interface MonitorChangeListener

-     public interface MonitorChangeListener

  Applications can register for Monitor event notification through `Monitor.startListener(com.sleepycat.je.rep.monitor.MonitorChangeListener)`. The interface defines an overloaded notify event for each event supported by the Monitor.

  Changes in the composition of the replication group, or in the dynamic state of a member, are communicated to the listener as events that are represented as subclasses of `MonitorChangeEvent`. Classes implementing this interface supply implementations for a `notify` associated with each type of event, so they can respond with some application-specific course of action.

  See Replication Guide, Writing Monitor Nodes

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `notify(GroupChangeEvent groupChangeEvent)` The method is invoked whenever there is a change in the composition of the replication group.
    `void` | `notify(JoinGroupEvent joinGroupEvent)` The method is invoked whenever a node joins the group, by successfully opening its first `ReplicatedEnvironment` handle.
    `void` | `notify(LeaveGroupEvent leaveGroupEvent)` The method is invoked whenever a node leaves the group by closing its last `ReplicatedEnvironment` handle.
    `void` | `notify(NewMasterEvent newMasterEvent)` The method is invoked whenever there is new master associated with the replication group.

- - ### Method Detail

    - #### notify

          void notify(NewMasterEvent newMasterEvent)

      The method is invoked whenever there is new master associated with the replication group. If the method throws an exception, JE will log the exception as a trace message, which will be propagated through the usual channels.
      Parameters:
        `newMasterEvent` - the event that resulted in the notify. It identifies the new master.

    - #### notify

          void notify(GroupChangeEvent groupChangeEvent)

      The method is invoked whenever there is a change in the composition of the replication group. That is, a new node has been added to the group or an existing member has been removed from the group. Note that SECONDARY nodes do not produce these events. If the method throws an exception, JE will log the exception as a trace message, which will be propagated through the usual channels.
      Parameters:
        `groupChangeEvent` - the event that resulted in the notify. It describes the new group composition and identifies the node that provoked the change.

    - #### notify

          void notify(JoinGroupEvent joinGroupEvent)

      The method is invoked whenever a node joins the group, by successfully opening its first `ReplicatedEnvironment` handle.
      Parameters:
        `joinGroupEvent` - the event that resulted in the notify. It identifies the node that joined the group.

    - #### notify

          void notify(LeaveGroupEvent leaveGroupEvent)

      The method is invoked whenever a node leaves the group by closing its last `ReplicatedEnvironment` handle.
      Parameters:
        `leaveGroupEvent` - the event that resulted in the notify. It identifies the node that left the group.

Copyright (c) 2004, 2014 Oracle and/or its affiliates. All rights reserved.