@Internal public final class NonClusterManager extends Object implements ClusterManager, com.atlassian.beehive.ClusterLockService
ClusterManager for use when no clustering is configured. It provides sensible default
implementation of some methods where appropriate, emulating a "single node cluster".| Constructor and Description |
|---|
NonClusterManager(com.atlassian.config.ApplicationConfig applicationConfig) |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(ClusterConfig config)
Set a new cluster configuration.
|
Collection<ClusterNodeInformation> |
getAllNodesInformation() |
ClusteredLock |
getClusteredLock(String key)
Get a distributed lock -- getting the lock does *not* imply that it has been acquired.
|
ClusterInformation |
getClusterInformation()
Get information about the running cluster.
|
ClusterInvariants |
getClusterInvariants()
Get all attributes of the server that must be consistent between cluster nodes.
|
<T> com.atlassian.core.task.FifoBuffer<T> |
getFifoBuffer(String name)
Get a distributed FIFO buffer
|
Lock |
getLock(String name)
Get a lock -- getting the lock does *not* imply that it has been acquired.
|
com.atlassian.confluence.cluster.nonclustered.JvmDualLock |
getLockForName(String key) |
Map<Integer,NodeStatus> |
getNodeStatuses()
Gets status information from all members of the cluster.
|
Map<ClusterNodeInformation,NodeStatus> |
getNodeStatusMap()
Gets status information from all members of the cluster.
|
int |
getPermittedClusterNodes() |
Serializable |
getPublishedObject(String key)
Retrieve an object which another node in the cluster has shared, return null if no such object exists
|
ClusterNodeInformation |
getThisNodeInformation()
Get the identity of this node in the cluster.
|
void |
init() |
boolean |
isClustered() |
boolean |
isClusterSupported()
Check whether this Confluence distribution is capable of running in a cluster.
|
boolean |
isConfigured() |
void |
publishEvent(ConfluenceEvent event)
Publish an event as a ClusterEventWrapper to other nodes
This waits for any current transaction to be committed successfully before scheduling the event for publishing.
|
void |
publishEventImmediately(ConfluenceEvent event)
Publish immediately, an event as a ClusterEventWrapper to other nodes
This is done immediately regardless of the state of any current transactions.
|
void |
publishObject(String key,
Serializable object)
Publish the supplied object to the local Map maintained by this manager.
|
void |
reconfigure(ClusterConfig config)
Set a new cluster configuration and cycle the service
|
InetAddress |
resolveName(String name) |
void |
shutdown() |
void |
startCluster()
Start the clustering service
|
void |
stopCluster()
Stop the clustering service
|
public NonClusterManager(com.atlassian.config.ApplicationConfig applicationConfig)
public void init()
public void shutdown()
public void configure(ClusterConfig config)
ClusterManagerconfigure in interface ClusterManagerpublic ClusterInformation getClusterInformation()
ClusterManagergetClusterInformation in interface ClusterManagerpublic <T> com.atlassian.core.task.FifoBuffer<T> getFifoBuffer(String name)
ClusterManagergetFifoBuffer in interface ClusterManagerpublic int getPermittedClusterNodes()
getPermittedClusterNodes in interface ClusterManagerInteger.MAX_VALUE, otherwise
returns 0.public Serializable getPublishedObject(String key)
ClusterManagergetPublishedObject in interface ClusterManagerpublic ClusterNodeInformation getThisNodeInformation()
ClusterManagerGet the identity of this node in the cluster. ClusterNodeInformation implements equals().
getThisNodeInformation in interface ClusterManagerpublic Collection<ClusterNodeInformation> getAllNodesInformation()
getAllNodesInformation in interface ClusterManagerpublic boolean isClustered()
isClustered in interface ClusterManagerpublic boolean isConfigured()
isConfigured in interface ClusterManagerClusterManager.configure(ClusterConfig) has been called with a
valid configuration, otherwise false.public void publishEvent(ConfluenceEvent event)
ClusterManagerpublishEvent in interface ClusterManagerpublic void publishEventImmediately(ConfluenceEvent event)
ClusterManagerpublishEventImmediately in interface ClusterManagerpublic boolean isClusterSupported()
ClusterManagerClusterManager.isClustered() in that it will return true if the code to support clustering is present,
even if this instance does not have a clustered license or a current clustering configuration.isClusterSupported in interface ClusterManagerpublic void publishObject(String key, Serializable object)
publishObject in interface ClusterManagerpublic void reconfigure(ClusterConfig config)
ClusterManagerreconfigure in interface ClusterManagerpublic void startCluster()
ClusterManagerstartCluster in interface ClusterManagerpublic void stopCluster()
ClusterManagerstopCluster in interface ClusterManagerpublic InetAddress resolveName(String name)
resolveName in interface NameResolverpublic Map<Integer,NodeStatus> getNodeStatuses()
ClusterManagergetNodeStatuses in interface ClusterManagerpublic Map<ClusterNodeInformation,NodeStatus> getNodeStatusMap()
ClusterManagergetNodeStatusMap in interface ClusterManagerpublic ClusterInvariants getClusterInvariants()
ClusterManagergetClusterInvariants in interface ClusterManagerpublic com.atlassian.confluence.cluster.nonclustered.JvmDualLock getLockForName(@Nonnull String key)
getLockForName in interface com.atlassian.beehive.ClusterLockServicepublic ClusteredLock getClusteredLock(String key)
ClusterManagerLock.tryLock() or Lock.lock() on the returned object to
acquire the lock.getClusteredLock in interface ClusterManagerpublic Lock getLock(String name)
LockFactoryLock.tryLock() or Lock.lock() on the returned object to
acquire the lock.getLock in interface LockFactoryCopyright © 2003–2015 Atlassian. All rights reserved.