Brooklyn

brooklyn.enricher.basic
[Java] Class AbstractCombiningEnricher

java.lang.Object
  brooklyn.policy.basic.AbstractEntityAdjunct
      brooklyn.enricher.basic.AbstractEnricher
          brooklyn.enricher.basic.AbstractCombiningEnricher

public abstract class AbstractCombiningEnricher
extends AbstractEnricher

Convenience base for transforming multiple sensors into a single new sensor. Usage:


Field Summary
static Logger log

protected AttributeSensor target

 
Fields inherited from class AbstractEnricher
leftoverProperties
 
Fields inherited from class AbstractEntityAdjunct
_subscriptionTracker, entity, id, name
 
Method Summary
java.lang.Object AbstractCombiningEnricher(AttributeSensor target)

java.lang.Object compute()

supply the computation in terms of subscribed variables; by default this is only invoked once all fields have been set at least once, then subsequently on any change to either of them

void setEntity(EntityLocal entity)

protected void subscribe(java.lang.String varName, AttributeSensor sensor)

subscribes to a given sensor on the entity where this enricher is attached, setting the value in the variable name indicated, which must be a field in this class

protected void subscribe(java.lang.reflect.Field field, AttributeSensor sensor)

@see #subscribe(String, AttributeSensor)

protected void subscribe(java.lang.String varName, Entity source, AttributeSensor sensor)

subscribes to a given sensor on the given entity, setting the value in the variable name indicated, which must be a field in this class

protected void subscribe(java.lang.reflect.Field field, Entity source, AttributeSensor sensor)

@see #subscribe(String, AttributeSensor)

void update()

 
Methods inherited from class AbstractEnricher
configure
 
Methods inherited from class AbstractEntityAdjunct
check, destroy, getAllSubscriptions, getId, getManagementContext, getName, getSubscriptionTracker, isDestroyed, isRunning, setEntity, setId, setName, subscribe, subscribeToChildren, subscribeToMembers, unsubscribe, unsubscribe
 

Field Detail

log

public static final Logger log


target

protected AttributeSensor target


 
Method Detail

AbstractCombiningEnricher

public java.lang.Object AbstractCombiningEnricher(AttributeSensor target)


compute

public java.lang.Object compute()
supply the computation in terms of subscribed variables; by default this is only invoked once all fields have been set at least once, then subsequently on any change to either of them


setEntity

@Override
public void setEntity(EntityLocal entity)


subscribe

protected void subscribe(java.lang.String varName, AttributeSensor sensor)
subscribes to a given sensor on the entity where this enricher is attached, setting the value in the variable name indicated, which must be a field in this class


subscribe

protected void subscribe(java.lang.reflect.Field field, AttributeSensor sensor)
See Also:
subscribe(String, AttributeSensor)


subscribe

protected void subscribe(java.lang.String varName, Entity source, AttributeSensor sensor)
subscribes to a given sensor on the given entity, setting the value in the variable name indicated, which must be a field in this class


subscribe

protected void subscribe(java.lang.reflect.Field field, Entity source, AttributeSensor sensor)
See Also:
subscribe(String, AttributeSensor)


update

public void update()


 

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