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


Field Summary
protected static Logger LOG

 
Constructor Summary
EntityDynamicType(AbstractEntity entity)

protected EntityDynamicType(java.lang.Class clazz)

 
Method Summary
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, java.util.Map configKeyFields)

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)

ConfigKeys available on this entity.

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

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

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.

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()
 

Field Detail

LOG

protected static final Logger LOG


 
Constructor Detail

EntityDynamicType

public EntityDynamicType(AbstractEntity entity)


EntityDynamicType

protected EntityDynamicType(java.lang.Class clazz)


 
Method Detail

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, java.util.Map configKeyFields)
Finds the config keys defined on the entity's class, statics and optionally any non-static (discouraged).


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)
ConfigKeys available on this entity.


getConfigKeyField

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


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. NB no work has been done supporting changing this after initialization, but the idea of these so-called "dynamic effectors" has been discussed and it might be supported in future...


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.