public abstract class DefaultComponentContext<T extends ComponentContext<T>> extends BaseContext<T> implements ComponentContext<T>
BaseContext.Builder<T extends BaseContext.Builder<T,U>,U extends BaseContext>| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Object> |
config |
protected String |
group |
protected List<ComponentHook> |
hooks |
protected List<InstanceContext> |
instances |
protected String |
name |
protected String |
status |
address, observers, version| Constructor and Description |
|---|
DefaultComponentContext() |
| Modifier and Type | Method and Description |
|---|---|
String |
address()
Gets the unique component address.
|
ModuleContext |
asModule()
Returns the component context as a module context.
|
VerticleContext |
asVerticle()
Returns the component context as a verticle context.
|
org.vertx.java.core.json.JsonObject |
config()
Gets the component configuration.
|
static <T extends DefaultComponentContext<T>> |
fromJson(org.vertx.java.core.json.JsonObject context)
Creates a component context from JSON.
|
String |
group()
Returns the component deployment group.
|
List<ComponentHook> |
hooks()
Returns a list of component hooks.
|
InstanceContext |
instance(int instanceNumber)
Gets a component instance context by instance ID.
|
InstanceContext |
instance(String address)
Gets a component instance context by instance address.
|
List<InstanceContext> |
instances()
Gets a list of all component instance contexts.
|
boolean |
isModule()
Returns a boolean indicating whether the component is a module.
|
boolean |
isVerticle()
Returns a boolean indicating whether the component is a verticle.
|
String |
name()
Reurns the component name.
|
DefaultNetworkContext |
network()
Returns the parent network context.
|
void |
notify(T update) |
int |
numInstances()
Returns the number of component instances.
|
T |
setNetworkContext(DefaultNetworkContext network)
Sets the component parent.
|
String |
status()
Returns the component status address.
|
static org.vertx.java.core.json.JsonObject |
toJson(ComponentContext context)
Serializes a component context to JSON.
|
String |
toString() |
protected abstract String |
type()
Returns the component deployment type.
|
copy, equals, hashCode, registerObserver, unregisterObserverclone, finalize, getClass, notify, notifyAll, wait, wait, waitregisterObserver, unregisterObserverprotected String name
protected String status
protected String group
protected List<InstanceContext> instances
protected List<ComponentHook> hooks
public static <T extends DefaultComponentContext<T>> T fromJson(org.vertx.java.core.json.JsonObject context)
context - A JSON representation of the component context.MalformedContextException - If the context is malformed.public static org.vertx.java.core.json.JsonObject toJson(ComponentContext context)
context - The component context to serialize.protected abstract String type()
public T setNetworkContext(DefaultNetworkContext network)
public String name()
ComponentContextname in interface ComponentContext<T extends ComponentContext<T>>public String address()
ComponentContextaddress in interface ComponentContext<T extends ComponentContext<T>>address in interface Context<T extends ComponentContext<T>>public String status()
ComponentContextstatus in interface ComponentContext<T extends ComponentContext<T>>public boolean isModule()
ComponentContextisModule in interface ComponentContext<T extends ComponentContext<T>>public boolean isVerticle()
ComponentContextisVerticle in interface ComponentContext<T extends ComponentContext<T>>public org.vertx.java.core.json.JsonObject config()
ComponentContextconfig in interface ComponentContext<T extends ComponentContext<T>>public List<InstanceContext> instances()
ComponentContextinstances in interface ComponentContext<T extends ComponentContext<T>>public int numInstances()
ComponentContextnumInstances in interface ComponentContext<T extends ComponentContext<T>>public InstanceContext instance(int instanceNumber)
ComponentContextinstance in interface ComponentContext<T extends ComponentContext<T>>null if the instance doesn't exist.public InstanceContext instance(String address)
ComponentContextinstance in interface ComponentContext<T extends ComponentContext<T>>address - The instance address.null if the instance doesn't exist.public String group()
ComponentContextgroup in interface ComponentContext<T extends ComponentContext<T>>public List<ComponentHook> hooks()
ComponentContexthooks in interface ComponentContext<T extends ComponentContext<T>>public ModuleContext asModule()
ComponentContextasModule in interface ComponentContext<T extends ComponentContext<T>>public VerticleContext asVerticle()
ComponentContextasVerticle in interface ComponentContext<T extends ComponentContext<T>>public DefaultNetworkContext network()
network in interface ComponentContext<T extends ComponentContext<T>>public void notify(T update)
notify in interface Observable<T extends ComponentContext<T>>notify in class BaseContext<T extends ComponentContext<T>>public String toString()
toString in class BaseContext<T extends ComponentContext<T>>Copyright © 2013-2014. All Rights Reserved.