Brooklyn

brooklyn.entity.basic
[Java] Class EntityDynamicType

java.lang.Object
  brooklyn.entity.basic.EntityDynamicType

public class EntityDynamicType

This is the actual type of an entity instance at runtime, which can change from the static EntityType, and can change over time; for this reason it does *not* implement EntityType, but callers can call getSnapshot() to get a snapshot such instance


Constructor Summary
EntityDynamicType(AbstractEntity entity)

protected EntityDynamicType(java.lang.Class clazz)

 
Method Summary
void addEffector(Effector newEffector)

Adds the given Effector to this entity.

void addEffector(Effector effector, EffectorTaskFactory body)

Adds an effector with an explicit body

void addEffector(Effector effector, EffectorBody body)

Adds an effector with an explicit body

void addSensor(Sensor newSensor)

Adds the given Sensor to this entity.

void addSensorIfAbsent(Sensor newSensor)

Sensor addSensorIfAbsentWithoutPublishing(Sensor newSensor)

void addSensors(java.lang.Iterable newSensors)

Adds the given Sensors to this entity.

protected static void buildConfigKeys(java.lang.Class clazz, AbstractEntity optionalEntity, java.util.Map configKeys)

Finds the config keys defined on the entity's class, statics and optionally any non-static (discouraged).

protected static java.util.Map findEffectors(java.lang.Class clazz, Entity optionalEntity)

Finds the effectors defined on the entity's class, statics and optionally any non-static (discouraged).

protected static java.util.Map findSensors(java.lang.Class clazz, Entity optionalEntity)

Finds the sensors defined on the entity's class, statics and optionally any non-static (discouraged).

ConfigKey getConfigKey(java.lang.String keyName)

field where a config key is defined, for use getting annotations. note annotations are not inherited.

java.lang.reflect.Field getConfigKeyField(java.lang.String keyName)

java.util.Map getConfigKeys()

ConfigKeys available on this entity.

Effector getEffector(java.lang.String name)

@return the effector with the given name, or null if not found

java.util.Map getEffectors()

Effectors available on this entity.

java.lang.Class getEntityClass()

Sensor getSensor(java.lang.String sensorName)

Convenience for finding named sensor.

java.util.Map getSensors()

Sensors available on this entity.

EntityType getSnapshot()

Sensor removeSensor(java.lang.String sensorName)

Removes the named Sensor from this entity.

boolean removeSensor(Sensor sensor)

Removes the named Sensor from this entity.

void setName(java.lang.String name)

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Constructor Detail

EntityDynamicType

public EntityDynamicType(AbstractEntity entity)


EntityDynamicType

protected EntityDynamicType(java.lang.Class clazz)


 
Method Detail

addEffector

Effector oldEffector = effectors.put(newEffector.getName(), newEffector);
public void addEffector(Effector newEffector)
Adds the given Effector to this entity.


addEffector

addEffector(new EffectorAndBody(effector, body));
public void addEffector(Effector effector, EffectorTaskFactory body)
Adds an effector with an explicit body


addEffector

addEffector(effector, new EffectorBodyTaskFactory(body));
public void addEffector(Effector effector, EffectorBody body)
Adds an effector with an explicit body


addSensor

public void addSensor(Sensor newSensor)
Adds the given Sensor to this entity.


addSensorIfAbsent

public void addSensorIfAbsent(Sensor newSensor)


addSensorIfAbsentWithoutPublishing

public Sensor addSensorIfAbsentWithoutPublishing(Sensor newSensor)


addSensors

public void addSensors(java.lang.Iterable newSensors)
Adds the given Sensors to this entity.


buildConfigKeys

protected static void buildConfigKeys(java.lang.Class clazz, AbstractEntity optionalEntity, java.util.Map configKeys)
Finds the config keys defined on the entity's class, statics and optionally any non-static (discouraged). Prefers keys which overwrite other keys, and prefers keys which are lower in the hierarchy; logs warnings if there are two conflicting keys which don't have an overwriting relationship.


findEffectors

protected static java.util.Map findEffectors(java.lang.Class clazz, Entity optionalEntity)
Finds the effectors defined on the entity's class, statics and optionally any non-static (discouraged).


findSensors

protected static java.util.Map findSensors(java.lang.Class clazz, Entity optionalEntity)
Finds the sensors defined on the entity's class, statics and optionally any non-static (discouraged).


getConfigKey

public ConfigKey getConfigKey(java.lang.String keyName)
field where a config key is defined, for use getting annotations. note annotations are not inherited.


getConfigKeyField

public java.lang.reflect.Field getConfigKeyField(java.lang.String keyName)


getConfigKeys

public java.util.Map getConfigKeys()
ConfigKeys available on this entity.


getEffector

public Effector getEffector(java.lang.String name)
Returns:
the effector with the given name, or null if not found


getEffectors

public java.util.Map getEffectors()
Effectors available on this entity.


getEntityClass

public java.lang.Class getEntityClass()


getSensor

public Sensor getSensor(java.lang.String sensorName)
Convenience for finding named sensor.


getSensors

public java.util.Map getSensors()
Sensors available on this entity.


getSnapshot

public EntityType getSnapshot()


removeSensor

public Sensor removeSensor(java.lang.String sensorName)
Removes the named Sensor from this entity.


removeSensor

public boolean removeSensor(Sensor sensor)
Removes the named Sensor from this entity.


setName

public void setName(java.lang.String name)


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.