public abstract class ComponentVerticle
extends org.vertx.java.platform.Verticle
To create a Vertigo component simply extend this base class.
public class MyComponent extends ComponentVerticle {
public void start() {
output.port("out").send("Hello world!");
}
}
The component verticle works exactly the same way as all normal Vert.x
verticles. When the Verticle.start() method is called,
the the component and the network to which it belongs have been
completely started, so it's perfectly fine to begin sending messages.
The component also contains a reference to the Cluster
to which the network belongs. The cluster can be used to deploy
additional modules or verticles or access cluster-wide shared data.
If Vert.x is clustered then cluster deployments will be performed remotely
and shared data structures will be backed by Hazelcast.
The component also has a special logger which is a
PortLogger that is specific to
the component instance. The port logger will log any messages to
the underlying Vert.x Logger
as well as the corresponding output port.
| Modifier and Type | Field and Description |
|---|---|
protected Cluster |
cluster |
protected InstanceContext |
context |
protected InputCollector |
input |
protected org.vertx.java.core.logging.Logger |
logger |
protected OutputCollector |
output |
protected Vertigo |
vertigo |
| Constructor and Description |
|---|
ComponentVerticle() |
protected Vertigo vertigo
protected InstanceContext context
protected Cluster cluster
protected org.vertx.java.core.logging.Logger logger
protected InputCollector input
protected OutputCollector output
public void start(org.vertx.java.core.Future<Void> startResult)
start in class org.vertx.java.platform.VerticleCopyright © 2013-2014. All Rights Reserved.