public class HazelcastClusterManager extends Object implements io.vertx.core.spi.cluster.ClusterManager, com.hazelcast.core.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 |
|---|---|
<K,V> void |
getAsyncMap(String name,
io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.shareddata.AsyncMap<K,V>>> resultHandler) |
<K,V> void |
getAsyncMultiMap(String name,
io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.spi.cluster.AsyncMultiMap<K,V>>> resultHandler)
Every eventbus handler has an ID.
|
com.hazelcast.config.Config |
getConfig()
Get the Hazelcast config.
|
void |
getCounter(String name,
io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.shareddata.Counter>> resultHandler) |
com.hazelcast.core.HazelcastInstance |
getHazelcastInstance() |
void |
getLockWithTimeout(String name,
long timeout,
io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.shareddata.Lock>> resultHandler) |
String |
getNodeID() |
List<String> |
getNodes() |
<K,V> Map<K,V> |
getSyncMap(String name) |
boolean |
isActive() |
void |
join(io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> resultHandler) |
void |
leave(io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> resultHandler) |
com.hazelcast.config.Config |
loadConfig()
Load Hazelcast config XML and transform it into a
Config object. |
void |
memberAdded(com.hazelcast.core.MembershipEvent membershipEvent) |
void |
memberAttributeChanged(com.hazelcast.core.MemberAttributeEvent memberAttributeEvent) |
void |
memberRemoved(com.hazelcast.core.MembershipEvent membershipEvent) |
void |
nodeListener(io.vertx.core.spi.cluster.NodeListener listener) |
void |
setConfig(com.hazelcast.config.Config config)
Set the Hazelcast config.
|
void |
setVertx(io.vertx.core.Vertx vertx) |
void |
stateChanged(com.hazelcast.core.LifecycleEvent lifecycleEvent) |
public HazelcastClusterManager()
public HazelcastClusterManager(com.hazelcast.config.Config conf)
conf - Hazelcast config, not nullpublic HazelcastClusterManager(com.hazelcast.core.HazelcastInstance instance)
public void setVertx(io.vertx.core.Vertx vertx)
setVertx in interface io.vertx.core.spi.cluster.ClusterManagerpublic void join(io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> resultHandler)
join in interface io.vertx.core.spi.cluster.ClusterManagerpublic <K,V> void getAsyncMultiMap(String name, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.spi.cluster.AsyncMultiMap<K,V>>> resultHandler)
getAsyncMultiMap in interface io.vertx.core.spi.cluster.ClusterManagername - A unique name by which the the MultiMap can be identified within the cluster.
See the cluster config file (e.g. cluster.xml in case of HazelcastClusterManager) for
additional MultiMap config parameters.resultHandler - handler receiving the multimappublic String getNodeID()
getNodeID in interface io.vertx.core.spi.cluster.ClusterManagerpublic List<String> getNodes()
getNodes in interface io.vertx.core.spi.cluster.ClusterManagerpublic void nodeListener(io.vertx.core.spi.cluster.NodeListener listener)
nodeListener in interface io.vertx.core.spi.cluster.ClusterManagerpublic <K,V> void getAsyncMap(String name, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.shareddata.AsyncMap<K,V>>> resultHandler)
getAsyncMap in interface io.vertx.core.spi.cluster.ClusterManagerpublic <K,V> Map<K,V> getSyncMap(String name)
getSyncMap in interface io.vertx.core.spi.cluster.ClusterManagerpublic void getLockWithTimeout(String name, long timeout, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.shareddata.Lock>> resultHandler)
getLockWithTimeout in interface io.vertx.core.spi.cluster.ClusterManagerpublic void getCounter(String name, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.shareddata.Counter>> resultHandler)
getCounter in interface io.vertx.core.spi.cluster.ClusterManagerpublic void leave(io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> resultHandler)
leave in interface io.vertx.core.spi.cluster.ClusterManagerpublic void memberAdded(com.hazelcast.core.MembershipEvent membershipEvent)
memberAdded in interface com.hazelcast.core.MembershipListenerpublic void memberRemoved(com.hazelcast.core.MembershipEvent membershipEvent)
memberRemoved in interface com.hazelcast.core.MembershipListenerpublic void stateChanged(com.hazelcast.core.LifecycleEvent lifecycleEvent)
stateChanged in interface com.hazelcast.core.LifecycleListenerpublic boolean isActive()
isActive in interface io.vertx.core.spi.cluster.ClusterManagerpublic void memberAttributeChanged(com.hazelcast.core.MemberAttributeEvent memberAttributeEvent)
memberAttributeChanged in interface com.hazelcast.core.MembershipListenerpublic 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 © 2019 Eclipse. All rights reserved.