public class HazelcastClusterManager extends Object implements ClusterManager, com.hazelcast.cluster.MembershipListener, com.hazelcast.core.LifecycleListener
Constructor and Description |
---|
HazelcastClusterManager()
Constructor - gets config from classpath
|
HazelcastClusterManager(com.hazelcast.config.Config conf)
Constructor - config supplied
|
HazelcastClusterManager(com.hazelcast.core.HazelcastInstance instance) |
Modifier and Type | Method and Description |
---|---|
void |
addRegistration(String address,
RegistrationInfo registrationInfo,
Promise<Void> promise) |
String |
clusterHost() |
String |
clusterPublicHost() |
<K,V> void |
getAsyncMap(String name,
Promise<AsyncMap<K,V>> promise) |
com.hazelcast.config.Config |
getConfig()
Get the Hazelcast config.
|
void |
getCounter(String name,
Promise<Counter> promise) |
com.hazelcast.core.HazelcastInstance |
getHazelcastInstance() |
void |
getLockWithTimeout(String name,
long timeout,
Promise<Lock> promise) |
String |
getNodeId() |
NodeInfo |
getNodeInfo() |
void |
getNodeInfo(String nodeId,
Promise<NodeInfo> promise) |
List<String> |
getNodes() |
void |
getRegistrations(String address,
Promise<List<RegistrationInfo>> promise) |
<K,V> Map<K,V> |
getSyncMap(String name) |
void |
init(Vertx vertx,
NodeSelector nodeSelector) |
boolean |
isActive() |
void |
join(Promise<Void> promise) |
void |
leave(Promise<Void> promise) |
com.hazelcast.config.Config |
loadConfig()
Load Hazelcast config XML and transform it into a
Config object. |
void |
memberAdded(com.hazelcast.cluster.MembershipEvent membershipEvent) |
void |
memberRemoved(com.hazelcast.cluster.MembershipEvent membershipEvent) |
void |
nodeListener(NodeListener listener) |
void |
removeRegistration(String address,
RegistrationInfo registrationInfo,
Promise<Void> promise) |
void |
setConfig(com.hazelcast.config.Config config)
Set the Hazelcast config.
|
void |
setNodeInfo(NodeInfo nodeInfo,
Promise<Void> promise) |
void |
stateChanged(com.hazelcast.core.LifecycleEvent lifecycleEvent) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
init
public HazelcastClusterManager()
public HazelcastClusterManager(com.hazelcast.config.Config conf)
conf
- Hazelcast config, not nullpublic HazelcastClusterManager(com.hazelcast.core.HazelcastInstance instance)
public void init(Vertx vertx, NodeSelector nodeSelector)
init
in interface ClusterManager
public void join(Promise<Void> promise)
join
in interface ClusterManager
public String getNodeId()
getNodeId
in interface ClusterManager
public List<String> getNodes()
getNodes
in interface ClusterManager
public void nodeListener(NodeListener listener)
nodeListener
in interface ClusterManager
public void setNodeInfo(NodeInfo nodeInfo, Promise<Void> promise)
setNodeInfo
in interface ClusterManager
public NodeInfo getNodeInfo()
getNodeInfo
in interface ClusterManager
public void getNodeInfo(String nodeId, Promise<NodeInfo> promise)
getNodeInfo
in interface ClusterManager
public <K,V> void getAsyncMap(String name, Promise<AsyncMap<K,V>> promise)
getAsyncMap
in interface ClusterManager
public <K,V> Map<K,V> getSyncMap(String name)
getSyncMap
in interface ClusterManager
public void getLockWithTimeout(String name, long timeout, Promise<Lock> promise)
getLockWithTimeout
in interface ClusterManager
public void getCounter(String name, Promise<Counter> promise)
getCounter
in interface ClusterManager
public void leave(Promise<Void> promise)
leave
in interface ClusterManager
public void memberAdded(com.hazelcast.cluster.MembershipEvent membershipEvent)
memberAdded
in interface com.hazelcast.cluster.MembershipListener
public void memberRemoved(com.hazelcast.cluster.MembershipEvent membershipEvent)
memberRemoved
in interface com.hazelcast.cluster.MembershipListener
public void stateChanged(com.hazelcast.core.LifecycleEvent lifecycleEvent)
stateChanged
in interface com.hazelcast.core.LifecycleListener
public boolean isActive()
isActive
in interface ClusterManager
public void addRegistration(String address, RegistrationInfo registrationInfo, Promise<Void> promise)
addRegistration
in interface ClusterManager
public void removeRegistration(String address, RegistrationInfo registrationInfo, Promise<Void> promise)
removeRegistration
in interface ClusterManager
public void getRegistrations(String address, Promise<List<RegistrationInfo>> promise)
getRegistrations
in interface ClusterManager
public String clusterHost()
clusterHost
in interface ClusterManager
public String clusterPublicHost()
clusterPublicHost
in interface ClusterManager
public com.hazelcast.config.Config getConfig()
public void setConfig(com.hazelcast.config.Config config)
config
- a config objectpublic com.hazelcast.config.Config loadConfig()
Config
object.
The content is read from:
vertx.hazelcast.config
sysprop, if present, orcluster.xml
file on the classpath, if present, orThe cluster manager uses this method to load the config when the node joins the cluster, if no config was provided upon creation.
You may use this method to get a base config and customize it before the node joins the cluster.
In this case, don't forget to invoke setConfig(Config)
after you applied your changes.
public com.hazelcast.core.HazelcastInstance getHazelcastInstance()
Copyright © 2021 Eclipse. All rights reserved.