Brooklyn

brooklyn.enricher.basic
[Java] Class AbstractAggregatingEnricher

java.lang.Object
  brooklyn.policy.basic.AbstractEntityAdjunct
      brooklyn.enricher.basic.AbstractEnricher
          brooklyn.enricher.basic.AbstractAggregatingEnricher
All Implemented Interfaces:
SensorEventListener

public abstract class AbstractAggregatingEnricher
extends AbstractEnricher

AggregatingEnrichers implicitly subscribes to the same sensor on all entities inside an Group and should emit an aggregate on the target sensor


Field Summary
protected S defaultValue

protected AttributeSensor target

protected java.util.Map values

Users of values should either on it synchronize when iterating over its entries or use copyOfValues to obtain an immutable copy of the map.

 
Fields inherited from class AbstractEnricher
leftoverProperties
 
Fields inherited from class AbstractEntityAdjunct
_subscriptionTracker, entity, id, name
 
Constructor Summary
AbstractAggregatingEnricher(java.util.Map flags, AttributeSensor source, AttributeSensor target)

AbstractAggregatingEnricher(java.util.Map flags, AttributeSensor source, AttributeSensor target, S defaultValue)

AbstractAggregatingEnricher(java.util.List producers, AttributeSensor source, AttributeSensor target)

deprecated:
will be deleted in 0.5.

AbstractAggregatingEnricher(java.util.List producers, AttributeSensor source, AttributeSensor target, S defaultValue)

 
Method Summary
void addProducer(Entity producer)

protected java.util.Map copyOfValues()

void onEvent(SensorEvent event)

protected void onUpdated()

Called whenever the values for the set of producers changes (e.g. on an event, or on a member added/removed).

S removeProducer(Entity producer)

void setEntity(EntityLocal entity)

 
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

defaultValue

protected S defaultValue


target

protected AttributeSensor target


values

protected final java.util.Map values
Users of values should either on it synchronize when iterating over its entries or use copyOfValues to obtain an immutable copy of the map.


 
Constructor Detail

AbstractAggregatingEnricher

public AbstractAggregatingEnricher(java.util.Map flags, AttributeSensor source, AttributeSensor target)


AbstractAggregatingEnricher

@SuppressWarnings("unchecked")
public AbstractAggregatingEnricher(java.util.Map flags, AttributeSensor source, AttributeSensor target, S defaultValue)


AbstractAggregatingEnricher

@Deprecated
public AbstractAggregatingEnricher(java.util.List producers, AttributeSensor source, AttributeSensor target)
deprecated:
will be deleted in 0.5. Instead use AbstractAggregatingEnricher(source, target, defaultValue, producers:producers, allMembers:true)


AbstractAggregatingEnricher

@Deprecated
public AbstractAggregatingEnricher(java.util.List producers, AttributeSensor source, AttributeSensor target, S defaultValue)


 
Method Detail

addProducer

public void addProducer(Entity producer)


copyOfValues

protected java.util.Map copyOfValues()


onEvent

@Override
public void onEvent(SensorEvent event)


onUpdated

protected void onUpdated()
Called whenever the values for the set of producers changes (e.g. on an event, or on a member added/removed). Defaults to no-op


removeProducer

public S removeProducer(Entity producer)


setEntity

@Override
public void setEntity(EntityLocal entity)


 

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