public class DefaultVerticleConfig extends Object implements VerticleConfig
ComponentConfig.TypeVERTICLE_IS_MULTI_THREADED, VERTICLE_IS_WORKER, VERTICLE_MAINCOMPONENT_CONFIG, COMPONENT_GROUP, COMPONENT_HOOKS, COMPONENT_NAME, COMPONENT_NUM_INSTANCES, COMPONENT_TYPE, COMPONENT_TYPE_MODULE, COMPONENT_TYPE_VERTICLE| Constructor and Description |
|---|
DefaultVerticleConfig() |
DefaultVerticleConfig(String name,
String main,
NetworkConfig network) |
| Modifier and Type | Method and Description |
|---|---|
VerticleConfig |
addHook(ComponentHook hook)
Adds a hook to the component.
|
org.vertx.java.core.json.JsonObject |
getConfig()
Returns the component configuration.
|
String |
getGroup()
Returns the component deployment group.
|
List<ComponentHook> |
getHooks()
Returns a list of component hooks.
|
int |
getInstances()
Returns the number of component instances to deploy within the network.
|
String |
getMain()
Gets the verticle main.
|
String |
getName()
Returns the component name.
|
ComponentConfig.Type |
getType()
Returns the component type.
|
boolean |
isMultiThreaded()
Returns a boolean indicating whether the verticle is a worker and is multi-threaded.
|
boolean |
isWorker()
Returns a boolean indicating whether the verticle is a worker.
|
VerticleConfig |
setConfig(org.vertx.java.core.json.JsonObject config)
Sets the component configuration.
|
VerticleConfig |
setGroup(String group)
Sets the component deployment group.
|
VerticleConfig |
setInstances(int instances)
Sets the number of component instances to deploy within the network.
|
VerticleConfig |
setMain(String main)
Sets the verticle main.
|
VerticleConfig |
setMultiThreaded(boolean isMultiThreaded)
Sets the verticle multi-threaded option.
|
VerticleConfig |
setWorker(boolean isWorker)
Sets the verticle worker option.
|
public DefaultVerticleConfig()
public DefaultVerticleConfig(String name, String main, NetworkConfig network)
public ComponentConfig.Type getType()
ComponentConfiggetType in interface ComponentConfig<VerticleConfig>public String getName()
ComponentConfiggetName in interface ComponentConfig<VerticleConfig>public org.vertx.java.core.json.JsonObject getConfig()
ComponentConfiggetConfig in interface ComponentConfig<VerticleConfig>public VerticleConfig setConfig(org.vertx.java.core.json.JsonObject config)
ComponentConfigThis configuration will be passed to component implementations as the verticle or module configuration when the component is started.
setConfig in interface ComponentConfig<VerticleConfig>config - The component configuration.public int getInstances()
ComponentConfiggetInstances in interface ComponentConfig<VerticleConfig>public VerticleConfig setInstances(int instances)
ComponentConfigsetInstances in interface ComponentConfig<VerticleConfig>instances - The number of component instances.public VerticleConfig setGroup(String group)
ComponentConfigsetGroup in interface ComponentConfig<VerticleConfig>group - The component deployment group.public String getGroup()
ComponentConfiggetGroup in interface ComponentConfig<VerticleConfig>public VerticleConfig addHook(ComponentHook hook)
ComponentConfigaddHook in interface ComponentConfig<VerticleConfig>hook - The hook to add.public List<ComponentHook> getHooks()
ComponentConfiggetHooks in interface ComponentConfig<VerticleConfig>public VerticleConfig setMain(String main)
VerticleConfigsetMain in interface VerticleConfigmain - The verticle main.public String getMain()
VerticleConfiggetMain in interface VerticleConfigpublic VerticleConfig setWorker(boolean isWorker)
VerticleConfigsetWorker in interface VerticleConfigisWorker - Indicates whether the verticle should be deployed as a worker.public boolean isWorker()
VerticleConfigisWorker in interface VerticleConfigpublic VerticleConfig setMultiThreaded(boolean isMultiThreaded)
VerticleConfigsetMultiThreaded in interface VerticleConfigisMultiThreaded - Indicates whether the worker verticle is multi-threaded.public boolean isMultiThreaded()
VerticleConfigisMultiThreaded in interface VerticleConfigfalse will be returned.Copyright © 2013-2014. All Rights Reserved.