@IntegrationFeature(clazz=ClusteringFeature.class, name="clustering") public class ClusteringFeatureImpl extends org.adroitlogic.x.api.AbstractIntegrationFeature implements ClusteringFeature
XClusterManager
Constructor and Description |
---|
ClusteringFeatureImpl() |
Modifier and Type | Method and Description |
---|---|
org.adroitlogic.x.api.clustering.locks.XClusterLock |
getClusterLock(String lockPath)
Returns a distributed lock unique to the given path.
|
String |
getCommandSpace()
Name of the command space to which this cluster manager is listening to.
|
String |
getDomain()
Domain of this node.
|
Optional<Integer> |
getNextSequenceNumber(String path)
Generates a distributed sequence number which is the next in line of a distributed sequence.
|
String |
getNodeName()
Get the name of the cluster manager's node.
|
org.adroitlogic.x.api.Status |
getStatus()
Get the cluster manager's current
Status . |
void |
init(org.springframework.context.ApplicationContext context) |
boolean |
isClusteringEnabled()
API to check whether the clustering is enabled within the framework
|
String |
publishControlCommand(org.adroitlogic.x.api.clustering.XControlCommand command)
Publishes a command to the cluster.
|
public void init(org.springframework.context.ApplicationContext context)
init
in interface org.adroitlogic.x.api.dec.Initializable
init
in class org.adroitlogic.x.api.AbstractIntegrationFeature
public org.adroitlogic.x.api.clustering.locks.XClusterLock getClusterLock(String lockPath)
ClusteringFeature
XClusterLock
can be used to acquire a
lock which will guarantee a critical section between different instances of the cluster manager (project x/ultraESB)getClusterLock
in interface ClusteringFeature
lockPath
- lock pathpublic Optional<Integer> getNextSequenceNumber(String path)
ClusteringFeature
Optional
as the result. Users have to check whether the value is available.getNextSequenceNumber
in interface ClusteringFeature
path
- path to be used to generate the sequence numberpublic String publishControlCommand(org.adroitlogic.x.api.clustering.XControlCommand command)
ClusteringFeature
XControlCommand
instance should be provided as the command. The command
will be marshaled and sent to the zookeeper for publishing the command.publishControlCommand
in interface ClusteringFeature
command
- the command to be publishedpublic org.adroitlogic.x.api.Status getStatus()
ClusteringFeature
Status
.getStatus
in interface ClusteringFeature
public String getNodeName()
ClusteringFeature
getNodeName
in interface ClusteringFeature
public String getCommandSpace()
ClusteringFeature
getCommandSpace
in interface ClusteringFeature
public String getDomain()
ClusteringFeature
getDomain
in interface ClusteringFeature
public boolean isClusteringEnabled()
ClusteringFeature
isClusteringEnabled
in interface ClusteringFeature
Copyright © 2016–2019 AdroitLogic. All rights reserved.