public class LocalClusterManager extends Object
The local cluster manager is backed by LocalCluster which is simply
an interface to the Vert.x Container and SharedData. Thus,
deployments and coordination via the LocalClusterManager is
is inherently done within a single Vert.x instance.
| Modifier and Type | Field and Description |
|---|---|
protected Cluster |
cluster |
protected org.vertx.java.platform.Container |
container |
protected org.vertx.java.core.eventbus.EventBus |
eventBus |
protected org.vertx.java.core.Vertx |
vertx |
| Constructor and Description |
|---|
LocalClusterManager(org.vertx.java.platform.Verticle verticle) |
LocalClusterManager(org.vertx.java.core.Vertx vertx,
org.vertx.java.platform.Container container) |
| Modifier and Type | Method and Description |
|---|---|
ClusterManager |
deployNetwork(NetworkConfig network)
Deploys a network to the cluster.
|
ClusterManager |
deployNetwork(NetworkConfig network,
org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<ActiveNetwork>> doneHandler)
Deploys a network to the cluster.
|
static LocalClusterManager |
factory(String address,
org.vertx.java.core.Vertx vertx,
org.vertx.java.platform.Container container) |
ClusterManager |
getNetwork(String name,
org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<ActiveNetwork>> resultHandler)
Gets a network reference for a deployed network.
|
ClusterManager |
isRunning(String name,
org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Boolean>> resultHandler)
Checks whether a network is running in the cluster.
|
ClusterScope |
scope()
Returns the cluster manager scope.
|
ClusterManager |
undeployNetwork(NetworkConfig network)
Undeploys a network from the cluster.
|
ClusterManager |
undeployNetwork(NetworkConfig network,
org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
Undeploys a network from the cluster.
|
ClusterManager |
undeployNetwork(String name)
Undeploys a complete network from the cluster.
|
ClusterManager |
undeployNetwork(String name,
org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
Undeploys a complete network from the cluster.
|
protected final org.vertx.java.core.Vertx vertx
protected final org.vertx.java.platform.Container container
protected final org.vertx.java.core.eventbus.EventBus eventBus
protected final Cluster cluster
public LocalClusterManager(org.vertx.java.platform.Verticle verticle)
public LocalClusterManager(org.vertx.java.core.Vertx vertx,
org.vertx.java.platform.Container container)
public static LocalClusterManager factory(String address, org.vertx.java.core.Vertx vertx, org.vertx.java.platform.Container container)
public ClusterScope scope()
ClusterManagerpublic ClusterManager getNetwork(String name, org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<ActiveNetwork>> resultHandler)
ClusterManager
If the network is running in the cluster then an ActiveNetwork
instance will be returned to the asynchronous handler. The ActiveNetwork
can be used to arbitrarily and asynchronously alter the structure of the
running network.
getNetwork in interface ClusterManagername - The name of the network to get.resultHandler - An asynchronous handler to be called with the result. If the
network exists then an ActiveNetwork instance which references the
running network will be provided, otherwise, the result will be nullpublic ClusterManager isRunning(String name, org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Boolean>> resultHandler)
ClusterManagerIn order to check whether a network is running, the cluster manager attempts to load the network's configuration from the internal Vertigo coordination cluster. If the configuration exists then the cluster manager then checks to see if the network is actually running.
isRunning in interface ClusterManagername - The name of the network to check.resultHandler - An asynchronous handler to be called with the result.public ClusterManager deployNetwork(NetworkConfig network)
ClusterManagerIf the given network configuration's name matches the name of a network that is already running in the cluster then the given configuration will be merged with the running network's configuration. This allows networks to be dynamically updated with partial configurations. If the configuration matches the already running configuration then no changes will occur, so it's not necessary to check whether a network is already running if the configuration has not been altered.
deployNetwork in interface ClusterManagernetwork - The configuration of the network to deploy.public ClusterManager deployNetwork(NetworkConfig network, org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<ActiveNetwork>> doneHandler)
ClusterManagerIf the given network configuration's name matches the name of a network that is already running in the cluster then the given configuration will be merged with the running network's configuration. This allows networks to be dynamically updated with partial configurations. If the configuration matches the already running configuration then no changes will occur, so it's not necessary to check whether a network is already running if the configuration has not been altered.
deployNetwork in interface ClusterManagernetwork - The configuration of the network to deploy.doneHandler - An asynchronous handler to be called once the deployment is complete.
The handler will be called with an ActiveNetwork instance that references
the running network. The ActiveNetwork can be used to arbitrarily
and asynchronously update the live network configuration.public ClusterManager undeployNetwork(String name)
ClusterManagerThis method does not require a network configuration for undeployment. Vertigo will load the configuration from the fault-tolerant data store and undeploy components internally. This allows networks to be undeployed without the network configuration.
undeployNetwork in interface ClusterManagername - The name of the network to undeploy.public ClusterManager undeployNetwork(String name, org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
ClusterManagerThis method does not require a network configuration for undeployment. Vertigo will load the configuration from the fault-tolerant data store and undeploy components internally. This allows networks to be undeployed without the network configuration.
undeployNetwork in interface ClusterManagername - The name of the network to undeploy.doneHandler - An asynchronous handler to be called once the network is undeployed.public ClusterManager undeployNetwork(NetworkConfig network)
ClusterManager
This method supports both partial and complete undeployment of networks. When
undeploying networks by specifying a NetworkConfig, the network configuration
should contain all components and connections that are being undeployed. If the
configuration's components and connections match all deployed components and
connections then the entire network will be undeployed.
undeployNetwork in interface ClusterManagernetwork - The network configuration to undeploy.public ClusterManager undeployNetwork(NetworkConfig network, org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
ClusterManager
This method supports both partial and complete undeployment of networks. When
undeploying networks by specifying a NetworkConfig, the network configuration
should contain all components and connections that are being undeployed. If the
configuration's components and connections match all deployed components and
connections then the entire network will be undeployed.
undeployNetwork in interface ClusterManagernetwork - The network configuration to undeploy.doneHandler - An asynchronous handler to be called once the network is undeployed.Copyright © 2013-2014. All Rights Reserved.