org.eclipse.emf.cdo.server.net4j

## Class FailoverMonitor

- java.lang.Object
- - org.eclipse.net4j.util.event.Notifier
  - - org.eclipse.net4j.util.lifecycle.Lifecycle
    - - org.eclipse.net4j.util.lifecycle.ShareableLifecycle
      - - org.eclipse.net4j.util.container.Container<FailoverMonitor.AgentProtocol>
        - - org.eclipse.emf.cdo.server.net4j.FailoverMonitor

- All Implemented Interfaces:
    IContainer<FailoverMonitor.AgentProtocol>, INotifier, IDeactivateable, ILifecycle, ILifecycle.DeferrableActivation

      public class FailoverMonitor
      extends Container<FailoverMonitor.AgentProtocol>

  A facility for monitoring a variable set of `fail-over participant` repositories and electing, as well as promoting, a `master` repository among them.
  Since:
    4.0
  Author:
    Eike Stepper

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `FailoverMonitor.AbstractServerProtocolFactory` An abstract base class for the `server-side protocol factories` required by a `fail-over monitor`.
    `static class` | `FailoverMonitor.AgentProtocol` The monitor-side implementation of the `fail-over monitor` agent protocol.
    `static class` | `FailoverMonitor.ClientProtocol` The monitor-side implementation of the `fail-over monitor` client protocol.
    `static class` | `FailoverMonitor.Factory` Creates `fail-over monitor` instances.
    `static interface` | `FailoverMonitor.Provider` Provides a `fail-over monitor` for a given named fail-over group.

    - ### Nested classes/interfaces inherited from interface org.eclipse.net4j.util.container.IContainer

      `IContainer.Modifiable<E>, IContainer.Persistable<E>, IContainer.Persistence<E>`

    - ### Nested classes/interfaces inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycle

      `ILifecycle.DeferrableActivation`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `PRODUCT_GROUP`
    `static java.lang.String` | `PROTOCOL_NAME`
    `static short` | `SIGNAL_PUBLISH_MASTER`

    - ### Fields inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle

      `USE_LABEL`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FailoverMonitor()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `deregisterAgent(FailoverMonitor.AgentProtocol agent)`
    `protected void` | `doBeforeActivate()`
    `protected FailoverMonitor.AgentProtocol` | `electNewMaster(java.util.List<FailoverMonitor.AgentProtocol> agents)`
    `FailoverMonitor.AgentProtocol[]` | `getElements()`
    `java.lang.String` | `getGroup()`
    `FailoverMonitor.AgentProtocol` | `getMasterAgent()`
    `boolean` | `isEmpty()`
    `void` | `registerAgent(FailoverMonitor.AgentProtocol agent)`
    `void` | `setGroup(java.lang.String group)`

    - ### Methods inherited from class org.eclipse.net4j.util.container.Container

      `fireContainerEvent, fireContainerEvent, fireContainerEvent, fireElementAddedEvent, fireElementRemovedEvent, fireElementsAddedEvent, fireElementsRemovedEvent, fireEvent, newContainerEvent, newContainerEvent`

    - ### Methods inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle

      `activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doActivate, doAfterActivate, doBeforeDeactivate, doDeactivate, dump, getLifecycleState, isActive, isDeferredActivation, toString`

    - ### Methods inherited from class org.eclipse.net4j.util.event.Notifier

      `addListener, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListeners, lastListenerRemoved, removeListener`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.eclipse.net4j.util.event.INotifier

      `addListener, getListeners, hasListeners, removeListener`

- - ### Field Detail

    - #### PRODUCT_GROUP

          public static final java.lang.String PRODUCT_GROUP

      See Also:
        Constant Field Values

    - #### PROTOCOL_NAME

          public static final java.lang.String PROTOCOL_NAME

      See Also:
        Constant Field Values

    - #### SIGNAL_PUBLISH_MASTER

          public static final short SIGNAL_PUBLISH_MASTER

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### FailoverMonitor

          public FailoverMonitor()

  - ### Method Detail

    - #### getGroup

          public java.lang.String getGroup()

    - #### setGroup

          public void setGroup(java.lang.String group)

    - #### isEmpty

          public boolean isEmpty()

      Specified by:
        `isEmpty` in interface `IContainer<FailoverMonitor.AgentProtocol>`
      Overrides:
        `isEmpty` in class `Container<FailoverMonitor.AgentProtocol>`

    - #### getElements

          public FailoverMonitor.AgentProtocol[] getElements()

    - #### getMasterAgent

          public FailoverMonitor.AgentProtocol getMasterAgent()

    - #### registerAgent

          public void registerAgent(FailoverMonitor.AgentProtocol agent)

    - #### deregisterAgent

          public void deregisterAgent(FailoverMonitor.AgentProtocol agent)

    - #### doBeforeActivate

          protected void doBeforeActivate()
                                   throws java.lang.Exception

      Overrides:
        `doBeforeActivate` in class `Lifecycle`
      Throws:
        `java.lang.Exception`

    - #### electNewMaster

          protected FailoverMonitor.AgentProtocol electNewMaster(java.util.List<FailoverMonitor.AgentProtocol> agents)

Copyright (c) 2004-2019 Eike Stepper (Loehne, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html