public class InfinispanClusterManager extends Object implements io.vertx.core.spi.cluster.ClusterManager
Constructor and Description |
---|
InfinispanClusterManager()
Creates a new cluster manager configured with
infinispan.xml and jgroups.xml files. |
InfinispanClusterManager(org.infinispan.manager.DefaultCacheManager cacheManager)
Creates a new cluster manager with an existing
DefaultCacheManager . |
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) |
org.infinispan.commons.api.BasicCacheContainer |
getCacheContainer() |
void |
getCounter(String name,
io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.shareddata.Counter>> resultHandler) |
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) |
void |
nodeListener(io.vertx.core.spi.cluster.NodeListener nodeListener) |
void |
setVertx(io.vertx.core.Vertx vertx) |
public InfinispanClusterManager()
infinispan.xml
and jgroups.xml
files.public InfinispanClusterManager(org.infinispan.manager.DefaultCacheManager cacheManager)
DefaultCacheManager
.
It is your responsibility to start/stop the cache manager when the Vert.x instance joins/leaves the cluster.cacheManager
- the existing cache managerpublic void setVertx(io.vertx.core.Vertx vertx)
setVertx
in interface io.vertx.core.spi.cluster.ClusterManager
public org.infinispan.commons.api.BasicCacheContainer getCacheContainer()
public <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.ClusterManager
public <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.ClusterManager
public <K,V> Map<K,V> getSyncMap(String name)
getSyncMap
in interface io.vertx.core.spi.cluster.ClusterManager
public 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.ClusterManager
public 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.ClusterManager
public String getNodeID()
getNodeID
in interface io.vertx.core.spi.cluster.ClusterManager
public List<String> getNodes()
getNodes
in interface io.vertx.core.spi.cluster.ClusterManager
public void nodeListener(io.vertx.core.spi.cluster.NodeListener nodeListener)
nodeListener
in interface io.vertx.core.spi.cluster.ClusterManager
public void join(io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> resultHandler)
join
in interface io.vertx.core.spi.cluster.ClusterManager
public void leave(io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> resultHandler)
leave
in interface io.vertx.core.spi.cluster.ClusterManager
public boolean isActive()
isActive
in interface io.vertx.core.spi.cluster.ClusterManager
Copyright © 2020 Eclipse. All rights reserved.