public class DefaultNodeStateManager extends Object implements NodeStateManager
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.| Constructor and Description |
|---|
DefaultNodeStateManager(OfBizClusterNodeStore ofBizClusterNodeStore,
ClusterNodes clusterNodes,
ClusterNodeProperties clusterNodeProperties,
com.atlassian.scheduler.core.LifecycleAwareSchedulerService schedulerService,
ComponentFactory componentFactory,
com.atlassian.mail.queue.MailQueue mailQueue,
com.atlassian.event.api.EventPublisher eventPublisher,
JiraSystemRestarter jiraSystemRestarter,
com.atlassian.cache.CacheManager cacheManager,
BuildUtilsInfo buildUtilsInfo,
ClusterNodeAuditHandler clusterNodeAuditHandler) |
| Modifier and Type | Method and Description |
|---|---|
void |
activate()
Activate the node.
|
void |
clearCache(ClearCacheEvent event) |
void |
deactivate()
Deactivate the node.
|
protected Long |
getCacheListenerPort() |
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() |
void |
shutdownNode()
We are going to change the state when the component manager stops so the other nodes do not get alerts about this
node
|
protected boolean |
stateHasChanged(Node node)
We validate if the state of the node has changed.
|
public DefaultNodeStateManager(OfBizClusterNodeStore ofBizClusterNodeStore, ClusterNodes clusterNodes, ClusterNodeProperties clusterNodeProperties, com.atlassian.scheduler.core.LifecycleAwareSchedulerService schedulerService, ComponentFactory componentFactory, com.atlassian.mail.queue.MailQueue mailQueue, com.atlassian.event.api.EventPublisher eventPublisher, JiraSystemRestarter jiraSystemRestarter, com.atlassian.cache.CacheManager cacheManager, BuildUtilsInfo buildUtilsInfo, ClusterNodeAuditHandler clusterNodeAuditHandler)
@EventListener public void clearCache(ClearCacheEvent event)
public void shutdownNode()
shutdownNode in interface NodeStateManagerpublic void activate()
throws ClusterStateException
NodeStateManageractivate in interface NodeStateManagerClusterStateException - when we can't become active as requestedpublic void quiesce()
throws NotClusteredException
quiesce in interface NodeStateManagerNotClusteredExceptionpublic void restart()
restart in interface NodeStateManagerpublic void deactivate()
throws NotClusteredException
NodeStateManagerdeactivate in interface NodeStateManagerNotClusteredException - if the instance is not clusteredprotected boolean stateHasChanged(Node node)
1) if the node is in offline state in the db, and we are initializing it. 2) if the node has a different IP address. 3) if the port of multicasting has changed
node - the nodeprotected Long getCacheListenerPort()
Copyright © 2002-2024 Atlassian. All Rights Reserved.