Brooklyn

brooklyn.event.adapter
[Groovy] Class SensorRegistry

java.lang.Object
  brooklyn.event.adapter.SensorRegistry

@Deprecated
@SuppressWarnings("deprecation")
class SensorRegistry

This class manages the periodic polling of a set of sensors, to update the attribute values of a particular Entity. When a "sensor adapter" is registered, it is immediately activated which will cause it to begin polling. When the registry is closed (e.g. on entity-stop), all registered sensor-adapters will automatically be de-activated. It is strongly recommended to not modify a sensor-adapter while concurrently registering it (e.g. adding additional sensors to it in a separate thread).

deprecated:
since 0.5; see brooklyn.event.feed.*


Property Summary
boolean activated

EntityLocal entity

static Logger log

java.util.Map properties

@deprecated in 0.4. use new SensorAdapter model.

 
Constructor Summary
SensorRegistry(EntityLocal entity, java.util.Map properties = [:])

 
Method Summary
void activateAdapters()

@deprecated activated automatically, as soon as constructed.

void addActivationLifecycleListeners(java.lang.Runnable onUp, java.lang.Runnable onDown)

TODO If called in separate thread concurrently with activateAdapters or deactivateAdapters/close, then listener could be called twice.

void addSensor(AttributeSensor sensor, ValueProvider provider)

@deprecated in 0.4. use new SensorAdapter model.

void addSensor(AttributeSensor sensor, ValueProvider provider, long period)

@deprecated in 0.4. use new SensorAdapter model.

void close()

void deactivateAdapters()

java.util.concurrent.ScheduledExecutorService getExec()

java.lang.Object register(java.lang.Object adapter)

records an adapter that has been created for use with this registry; implementations may return a compatible adapter if one is already registered

void removeSensor(AttributeSensor sensor)

@deprecated in 0.4. use new SensorAdapter model.

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

Property Detail

activated

boolean activated


entity

final EntityLocal entity


log

static final Logger log


properties

@Deprecated
final java.util.Map properties
deprecated:
in 0.4. use new SensorAdapter model.


 
Constructor Detail

SensorRegistry

SensorRegistry(EntityLocal entity, java.util.Map properties = [:])


 
Method Detail

activateAdapters

@Deprecated
void activateAdapters()
deprecated:
activated automatically, as soon as constructed.


addActivationLifecycleListeners

void addActivationLifecycleListeners(java.lang.Runnable onUp, java.lang.Runnable onDown)
TODO If called in separate thread concurrently with activateAdapters or deactivateAdapters/close, then listener could be called twice. Recommend not adding activation listeners like that!


addSensor

@Deprecated
void addSensor(AttributeSensor sensor, ValueProvider provider)
deprecated:
in 0.4. use new SensorAdapter model.


addSensor

@Deprecated
void addSensor(AttributeSensor sensor, ValueProvider provider, long period)
deprecated:
in 0.4. use new SensorAdapter model.


close

void close()


deactivateAdapters

void deactivateAdapters()


getExec

java.util.concurrent.ScheduledExecutorService getExec()


register

java.lang.Object register(java.lang.Object adapter)
records an adapter that has been created for use with this registry; implementations may return a compatible adapter if one is already registered


removeSensor

@Deprecated
void removeSensor(AttributeSensor sensor)
deprecated:
in 0.4. use new SensorAdapter model.


 

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