Class ClusterServiceImpl

java.lang.Object
org.nuxeo.runtime.model.DefaultComponent
org.nuxeo.runtime.cluster.ClusterServiceImpl
All Implemented Interfaces:
ClusterService, Adaptable, Component, Extensible, TimestampedService

public class ClusterServiceImpl extends DefaultComponent implements ClusterService
Implementation for the Cluster Service.
Since:
11.1
  • Field Details

  • Constructor Details

    • ClusterServiceImpl

      public ClusterServiceImpl()
  • Method Details

    • getApplicationStartedOrder

      public int getApplicationStartedOrder()
      Description copied from interface: Component
      The component notification order for Component.start(ComponentContext).

      Components are notified in increasing order. Order 1000 is the default order for components that don't care. Order 100 is the repository initialization.

      Specified by:
      getApplicationStartedOrder in interface Component
      Returns:
      the order, 1000 by default
    • start

      public void start(ComponentContext context)
      Description copied from interface: Component
      Start the component. This method is called after all the components were resolved and activated
      Specified by:
      start in interface Component
      Overrides:
      start in class DefaultComponent
    • isEnabled

      public boolean isEnabled()
      Description copied from interface: ClusterService
      Checks if cluster mode is enabled.
      Specified by:
      isEnabled in interface ClusterService
      Returns:
      true if cluster mode is enabled, false if not
    • getNodeId

      public String getNodeId()
      Description copied from interface: ClusterService
      Returns the node id. This is never null.
      Specified by:
      getNodeId in interface ClusterService
      Returns:
      the node id
    • setNodeId

      public void setNodeId(String nodeId)
      Allows tests to set the node id without a reload.
    • runAtomically

      public void runAtomically(String key, Duration duration, Duration pollDelay, Runnable runnable)
      Description copied from interface: ClusterService
      Runs a Runnable atomically in a cluster-wide critical section, outside a transaction.
      Specified by:
      runAtomically in interface ClusterService
      Parameters:
      key - the key used to determine atomicity
      duration - the duration during which we attempt to acquire the lock
      pollDelay - the delay between two subsequent polls of the lock
      runnable - the runnable