public class DefaultComponentCoordinator extends Object implements ComponentCoordinator
This coordinator implementation uses the current Vertigo cluster facility to coordinate with the network manager using event-based cluster-wide shared data keys.
| Constructor and Description |
|---|
DefaultComponentCoordinator(InstanceContext context,
org.vertx.java.core.Vertx vertx,
org.vertx.java.platform.Container container) |
| Modifier and Type | Method and Description |
|---|---|
String |
address()
Returns the instance address.
|
ComponentCoordinator |
pause()
Notifies the network that the component is not ready for operation.
|
ComponentCoordinator |
pause(org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
Notifies the network that the component is not ready for operation.
|
ComponentCoordinator |
pauseHandler(org.vertx.java.core.Handler<Void> handler)
Sets a pause handler on the coordinator.
|
ComponentCoordinator |
resume()
Notifies the network that the component is ready to resume.
|
ComponentCoordinator |
resume(org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
Notifies the network that the component is ready to resume.
|
ComponentCoordinator |
resumeHandler(org.vertx.java.core.Handler<Void> handler)
Sets a resume handler on the coordinator.
|
ComponentCoordinator |
start(org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<InstanceContext>> doneHandler)
Starts the coordinator.
|
void |
stop(org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
Stops the coordinator.
|
public DefaultComponentCoordinator(InstanceContext context, org.vertx.java.core.Vertx vertx, org.vertx.java.platform.Container container)
public String address()
ComponentCoordinatoraddress in interface ComponentCoordinatorpublic ComponentCoordinator start(org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<InstanceContext>> doneHandler)
ComponentCoordinatorWhen the coordinator is started the instance context is retrieved from the fault-tolerant cluster. Prior to setup, the component only knows its own address, thus starting the coordinator is essential to component setup.
start in interface ComponentCoordinatordoneHandler - An asynchronous handler to be called once complete.
The handler will be called with the current instance context.public ComponentCoordinator resume()
ComponentCoordinatorresume in interface ComponentCoordinatorpublic ComponentCoordinator resume(org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
ComponentCoordinatorresume in interface ComponentCoordinatordoneHandler - An asynchronous handler to be called once the network has been notified.public ComponentCoordinator pause()
ComponentCoordinatorpause in interface ComponentCoordinatorpublic ComponentCoordinator pause(org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
ComponentCoordinatorpause in interface ComponentCoordinatordoneHandler - An asynchronous handler to be called once the network has been notified.public ComponentCoordinator resumeHandler(org.vertx.java.core.Handler<Void> handler)
ComponentCoordinatorThis handler will be called when all components in the network are setup and ready to begin processing messages. The network coordinator will make this determination by evaluating component status keys in the cluster.
resumeHandler in interface ComponentCoordinatorhandler - A handler to be called when the component should resume operation.public ComponentCoordinator pauseHandler(org.vertx.java.core.Handler<Void> handler)
ComponentCoordinatorThis handler will be called when some component somewhere in the network has been paused. When a component is paused, the network manager will notify all component instances that the network is paused until resume.
pauseHandler in interface ComponentCoordinatorhandler - A handler to be called when the component should pause operation.public void stop(org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
ComponentCoordinatorstop in interface ComponentCoordinatordoneHandler - An asynchronous handler to be called once complete.Copyright © 2013-2014. All Rights Reserved.