public class

DefaultNodeStateManager

extends Object
implements NodeStateManager
java.lang.Object
   ↳ com.atlassian.jira.cluster.DefaultNodeStateManager

Class Overview

Manage the state of the current node. The activate() and deactivate() methods are synchronised as we should only ever be running one of those methods at a time to avoid weird race conditions that would be possible if we tried to go from active to passive and vice-versa at the same time.

Summary

Public Constructors
DefaultNodeStateManager(OfBizClusterNodeStore ofBizClusterNodeStore, ClusterNodeProperties clusterNodeProperties, LifecycleAwareSchedulerService schedulerService, ComponentFactory componentFactory, MailQueue mailQueue, EventPublisher eventPublisher, JiraSystemRestarter jiraSystemRestarter, CacheManager cacheManager)
Public Methods
synchronized void activate()
Activate the node.
@EventListener void clearCache(ClearCacheEvent event)
synchronized void deactivate()
Deactivate the node.
Set<Node> getAllNodes()
Returns all the known nodes JIRA node.
Node getNode()
Returns the current JIRA node.
Node getNodeWithRefresh()
Returns the current JIRA node, first refreshing its state from the database.
synchronized void quiesce()
There are times when you want the server to go into a deep sleep mode, such as when an import is taking place on the cluster.
void restart()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.cluster.NodeStateManager

Public Constructors

public DefaultNodeStateManager (OfBizClusterNodeStore ofBizClusterNodeStore, ClusterNodeProperties clusterNodeProperties, LifecycleAwareSchedulerService schedulerService, ComponentFactory componentFactory, MailQueue mailQueue, EventPublisher eventPublisher, JiraSystemRestarter jiraSystemRestarter, CacheManager cacheManager)

Public Methods

public synchronized void activate ()

Activate the node. This method will block until the node becomes active.

@EventListener public void clearCache (ClearCacheEvent event)

public synchronized void deactivate ()

Deactivate the node. This method will block until the node becomes inactive (passive).

public Set<Node> getAllNodes ()

Returns all the known nodes JIRA node. If not clustered this will return an empty set.

Returns
  • a collection of Nodes in a cluster

public Node getNode ()

Returns the current JIRA node.

Returns
  • a non-null instance; call isClustered() to see if it's part of a cluster

public Node getNodeWithRefresh ()

Returns the current JIRA node, first refreshing its state from the database.

Returns
  • a non-null instance; call isClustered() to see if it's part of a cluster

public synchronized void quiesce ()

There are times when you want the server to go into a deep sleep mode, such as when an import is taking place on the cluster.

public void restart ()