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 |
---|---|
void |
addRegistration(String address,
io.vertx.core.spi.cluster.RegistrationInfo registrationInfo,
io.vertx.core.Promise<Void> promise) |
String |
clusterHost() |
String |
clusterPublicHost() |
<K,V> void |
getAsyncMap(String name,
io.vertx.core.Promise<io.vertx.core.shareddata.AsyncMap<K,V>> promise) |
org.infinispan.commons.api.BasicCacheContainer |
getCacheContainer() |
void |
getCounter(String name,
io.vertx.core.Promise<io.vertx.core.shareddata.Counter> promise) |
void |
getLockWithTimeout(String name,
long timeout,
io.vertx.core.Promise<io.vertx.core.shareddata.Lock> promise) |
String |
getNodeId() |
io.vertx.core.spi.cluster.NodeInfo |
getNodeInfo() |
void |
getNodeInfo(String nodeId,
io.vertx.core.Promise<io.vertx.core.spi.cluster.NodeInfo> promise) |
List<String> |
getNodes() |
void |
getRegistrations(String address,
io.vertx.core.Promise<List<io.vertx.core.spi.cluster.RegistrationInfo>> promise) |
<K,V> Map<K,V> |
getSyncMap(String name) |
void |
init(io.vertx.core.Vertx vertx,
io.vertx.core.spi.cluster.NodeSelector nodeSelector) |
boolean |
isActive() |
void |
join(io.vertx.core.Promise<Void> promise) |
void |
leave(io.vertx.core.Promise<Void> promise) |
void |
nodeListener(io.vertx.core.spi.cluster.NodeListener nodeListener) |
void |
removeRegistration(String address,
io.vertx.core.spi.cluster.RegistrationInfo registrationInfo,
io.vertx.core.Promise<Void> promise) |
void |
setNodeInfo(io.vertx.core.spi.cluster.NodeInfo nodeInfo,
io.vertx.core.Promise<Void> promise) |
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 init(io.vertx.core.Vertx vertx, io.vertx.core.spi.cluster.NodeSelector nodeSelector)
init
in interface io.vertx.core.spi.cluster.ClusterManager
public org.infinispan.commons.api.BasicCacheContainer getCacheContainer()
public <K,V> void getAsyncMap(String name, io.vertx.core.Promise<io.vertx.core.shareddata.AsyncMap<K,V>> promise)
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.Promise<io.vertx.core.shareddata.Lock> promise)
getLockWithTimeout
in interface io.vertx.core.spi.cluster.ClusterManager
public void getCounter(String name, io.vertx.core.Promise<io.vertx.core.shareddata.Counter> promise)
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 setNodeInfo(io.vertx.core.spi.cluster.NodeInfo nodeInfo, io.vertx.core.Promise<Void> promise)
setNodeInfo
in interface io.vertx.core.spi.cluster.ClusterManager
public io.vertx.core.spi.cluster.NodeInfo getNodeInfo()
getNodeInfo
in interface io.vertx.core.spi.cluster.ClusterManager
public void getNodeInfo(String nodeId, io.vertx.core.Promise<io.vertx.core.spi.cluster.NodeInfo> promise)
getNodeInfo
in interface io.vertx.core.spi.cluster.ClusterManager
public void join(io.vertx.core.Promise<Void> promise)
join
in interface io.vertx.core.spi.cluster.ClusterManager
public void leave(io.vertx.core.Promise<Void> promise)
leave
in interface io.vertx.core.spi.cluster.ClusterManager
public boolean isActive()
isActive
in interface io.vertx.core.spi.cluster.ClusterManager
public void addRegistration(String address, io.vertx.core.spi.cluster.RegistrationInfo registrationInfo, io.vertx.core.Promise<Void> promise)
addRegistration
in interface io.vertx.core.spi.cluster.ClusterManager
public void removeRegistration(String address, io.vertx.core.spi.cluster.RegistrationInfo registrationInfo, io.vertx.core.Promise<Void> promise)
removeRegistration
in interface io.vertx.core.spi.cluster.ClusterManager
public void getRegistrations(String address, io.vertx.core.Promise<List<io.vertx.core.spi.cluster.RegistrationInfo>> promise)
getRegistrations
in interface io.vertx.core.spi.cluster.ClusterManager
public String clusterHost()
clusterHost
in interface io.vertx.core.spi.cluster.ClusterManager
public String clusterPublicHost()
clusterPublicHost
in interface io.vertx.core.spi.cluster.ClusterManager
Copyright © 2021 Eclipse. All rights reserved.