Class InfinispanClusterManager
java.lang.Object
io.vertx.ext.cluster.infinispan.InfinispanClusterManager
- All Implemented Interfaces:
ClusteredNode, ClusterManager, VertxServiceProvider
- Author:
- Thomas Segismont
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new cluster manager configured withinfinispan.xmlandjgroups.xmlfiles.InfinispanClusterManager(org.infinispan.manager.DefaultCacheManager cacheManager) Creates a new cluster manager with an existingDefaultCacheManager. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRegistration(String address, RegistrationInfo registrationInfo, Completable<Void> promise) Share a new messaging handler registration with other nodes in the cluster.If the cluster manager has its own server for data/membership, this returns the host it is listening to.If the cluster manager has its own server for data/membership, this returns the host it advertises to other nodes.<K,V> void getAsyncMap(String name, Completable<AsyncMap<K, V>> promise) Return anAsyncMapfor the givenname.org.infinispan.commons.api.BasicCacheContainervoidgetCounter(String name, Completable<Counter> promise) Return aCounterfor the givenname.voidgetLockWithTimeout(String name, long timeout, Completable<Lock> prom) Return the unique node identifier for this node.Get details about this clustered node.voidgetNodeInfo(String nodeId, Completable<NodeInfo> promise) Get details about a specific node in the cluster.getNodes()Return a list of node identifiers corresponding to the nodes in the cluster.voidgetRegistrations(String address, Completable<List<RegistrationInfo>> promise) Get the messaging handler currently registered in the cluster.<K,V> Map <K, V> getSyncMap(String name) Return a synchronous map for the givenname.voidInvoked before this cluster node tries to join the cluster.booleanisActive()Is the cluster manager active?voidjoin(Completable<Void> promise) Join the cluster.voidleave(Completable<Void> promise) Leave the cluster.voidnodeListener(NodeListener nodeListener) Set a listener that will be called when a node joins or leaves the cluster.voidregistrationListener(RegistrationListener registrationListener) Implementations must signal the providedregistrationListenerwhen messaging handler registrations are added or removed by sending aRegistrationUpdateEventwithRegistrationListener.registrationsUpdated(RegistrationUpdateEvent).voidremoveRegistration(String address, RegistrationInfo registrationInfo, Completable<Void> promise) Signal removal of a messaging handler registration to other nodes in the cluster.voidsetNodeInfo(NodeInfo nodeInfo, Completable<Void> promise) Store the details about this clustered node.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ClusterManager
init
-
Constructor Details
-
InfinispanClusterManager
public InfinispanClusterManager()Creates a new cluster manager configured withinfinispan.xmlandjgroups.xmlfiles. -
InfinispanClusterManager
public InfinispanClusterManager(org.infinispan.manager.DefaultCacheManager cacheManager) Creates a new cluster manager with an existingDefaultCacheManager. It is your responsibility to start/stop the cache manager when the Vert.x instance joins/leaves the cluster.- Parameters:
cacheManager- the existing cache manager
-
-
Method Details
-
init
Description copied from interface:ClusterManagerInvoked before this cluster node tries to join the cluster.- Specified by:
initin interfaceClusterManager- Parameters:
vertx- the Vert.x instance
-
getCacheContainer
public org.infinispan.commons.api.BasicCacheContainer getCacheContainer() -
getAsyncMap
Description copied from interface:ClusterManagerReturn anAsyncMapfor the givenname.- Specified by:
getAsyncMapin interfaceClusterManager
-
getSyncMap
Description copied from interface:ClusterManagerReturn a synchronous map for the givenname.- Specified by:
getSyncMapin interfaceClusterManager
-
getLockWithTimeout
Description copied from interface:ClusterManager- Specified by:
getLockWithTimeoutin interfaceClusterManager
-
getCounter
Description copied from interface:ClusterManagerReturn aCounterfor the givenname.- Specified by:
getCounterin interfaceClusterManager
-
getNodeId
Description copied from interface:ClusteredNodeReturn the unique node identifier for this node.- Specified by:
getNodeIdin interfaceClusteredNode
-
getNodes
Description copied from interface:ClusteredNodeReturn a list of node identifiers corresponding to the nodes in the cluster.- Specified by:
getNodesin interfaceClusteredNode
-
registrationListener
Description copied from interface:ClusterManagerImplementations must signal the providedregistrationListenerwhen messaging handler registrations are added or removed by sending aRegistrationUpdateEventwithRegistrationListener.registrationsUpdated(RegistrationUpdateEvent).- Specified by:
registrationListenerin interfaceClusterManager- Parameters:
registrationListener- the registration listener
-
nodeListener
Description copied from interface:ClusterManagerSet a listener that will be called when a node joins or leaves the cluster.- Specified by:
nodeListenerin interfaceClusterManager
-
setNodeInfo
Description copied from interface:ClusterManagerStore the details about this clustered node.- Specified by:
setNodeInfoin interfaceClusterManager
-
getNodeInfo
Description copied from interface:ClusteredNodeGet details about this clustered node.- Specified by:
getNodeInfoin interfaceClusteredNode
-
getNodeInfo
Description copied from interface:ClusteredNodeGet details about a specific node in the cluster.- Specified by:
getNodeInfoin interfaceClusteredNode- Parameters:
nodeId- the clustered node id
-
join
Description copied from interface:ClusterManagerJoin the cluster.- Specified by:
joinin interfaceClusterManager
-
leave
Description copied from interface:ClusterManagerLeave the cluster.- Specified by:
leavein interfaceClusterManager
-
isActive
public boolean isActive()Description copied from interface:ClusterManagerIs the cluster manager active?- Specified by:
isActivein interfaceClusterManager- Returns:
- true if active, false otherwise
-
addRegistration
public void addRegistration(String address, RegistrationInfo registrationInfo, Completable<Void> promise) Description copied from interface:ClusterManagerShare a new messaging handler registration with other nodes in the cluster.- Specified by:
addRegistrationin interfaceClusterManager
-
removeRegistration
public void removeRegistration(String address, RegistrationInfo registrationInfo, Completable<Void> promise) Description copied from interface:ClusterManagerSignal removal of a messaging handler registration to other nodes in the cluster.- Specified by:
removeRegistrationin interfaceClusterManager
-
getRegistrations
Description copied from interface:ClusteredNodeGet the messaging handler currently registered in the cluster.- Specified by:
getRegistrationsin interfaceClusteredNode
-
clusterHost
Description copied from interface:ClusterManagerIf the cluster manager has its own server for data/membership, this returns the host it is listening to. When users don't configure the eventbus cluster host, the value will serve as a default.- Specified by:
clusterHostin interfaceClusterManager- Returns:
- null if the cluster manager does not start a server or the host couldn't be determined
-
clusterPublicHost
Description copied from interface:ClusterManagerIf the cluster manager has its own server for data/membership, this returns the host it advertises to other nodes. When users don't configure the eventbus cluster public host, the value will serve as a default.- Specified by:
clusterPublicHostin interfaceClusterManager- Returns:
- null if the cluster manager does not advertise a host that is different from the cluster host or the public host couldn't be determined
-