Brooklyn

brooklyn.event.adapter
[Groovy] Class AbstractSensorEvaluationContext

java.lang.Object
  brooklyn.event.adapter.AbstractSensorEvaluationContext

abstract class AbstractSensorEvaluationContext

provides fields and methods that are brought into scope when executing closures submitted by an entity developer for evaluating a sensor; fields can be made explicit, to be shared among multiple sensors; and specific per-sensor evaluation properties can be passed as "extraProperties" which exist only for that evaluation context duration


Field Summary
static java.lang.Object UNSET

may throw exception, or return UNSET to not change

static Logger log

 
Property Summary
java.lang.Exception error

exception returned by call, or null if no error

java.util.Map extraProperties

 
Method Summary
java.lang.Object evaluate(Entity entity, Sensor sensor, groovy.lang.Closure c)

evaluate the closure in the (resolve) context of the implementing class (e.g. a specific HTTP response), so that methods and variables in the class are available to the closure; entity and sensor available for inspection but can be null during testing; default values are specified by the response context; return value is normally adapted by the caller (e.g. the sensor adapter) to suit the sensor; this method (and thus the closure) may return UNSET to indicate the adapter should not update the sensor

java.lang.Object evaluate(java.util.Map properties = [:], groovy.lang.Closure c)

protected java.lang.Object getDefaultValue()

java.lang.Object propertyMissing(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

UNSET

public static final java.lang.Object UNSET
may throw exception, or return UNSET to not change


log

public static final Logger log


 
Property Detail

error

@Nullable
java.lang.Exception error
exception returned by call, or null if no error


extraProperties

final java.util.Map extraProperties


 
Method Detail

evaluate

java.lang.Object evaluate(Entity entity, Sensor sensor, groovy.lang.Closure c)
evaluate the closure in the (resolve) context of the implementing class (e.g. a specific HTTP response), so that methods and variables in the class are available to the closure; entity and sensor available for inspection but can be null during testing; default values are specified by the response context; return value is normally adapted by the caller (e.g. the sensor adapter) to suit the sensor; this method (and thus the closure) may return UNSET to indicate the adapter should not update the sensor


evaluate

java.lang.Object evaluate(java.util.Map properties = [:], groovy.lang.Closure c)


getDefaultValue

protected java.lang.Object getDefaultValue()


propertyMissing

java.lang.Object propertyMissing(java.lang.String name)


 

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