public class DynamicGroupImpl extends AbstractGroupImpl implements DynamicGroup
BrooklynObject.TagSupport
Configurable.ConfigurationSupport
EntityInternal.FeedSupport
BrooklynObjectInternal.ConfigurationSupportInternal
CHILD_ADDED, CHILD_REMOVED, EFFECTOR_ADDED, EFFECTOR_CHANGED, EFFECTOR_REMOVED, LOCATION_ADDED, LOCATION_REMOVED, POLICY_ADDED, POLICY_REMOVED, SENSOR_ADDED, SENSOR_REMOVED
ENTITY_FILTER, RESCAN_EFFECTOR, RUNNING
FIRST, FIRST_MEMBER, GROUP_MEMBERS, MEMBER_DELEGATE_CHILDREN, MEMBER_DELEGATE_NAME_FORMAT, RUNNING_QUORUM_CHECK, UP_QUORUM_CHECK
GROUP_SIZE, MEMBER_ADDED, MEMBER_REMOVED
Constructor and Description |
---|
DynamicGroupImpl() |
DynamicGroupImpl(java.util.Map flags,
Entity parent)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
<T> void |
addSubscription(Entity producer,
Sensor<T> sensor)
Indicates an entity and/or sensor this group should monitor
|
<T> void |
addSubscription(Entity producer,
Sensor<T> sensor,
com.google.common.base.Predicate<? super SensorEvent<? super T>> filter)
As
DynamicGroup.addSubscription(Entity, Sensor) but with an additional filter. |
com.google.common.base.Predicate<? super Entity> |
entityFilter() |
void |
init()
Default entity initialization, just calls
AbstractEntity.initEnrichers() . |
void |
onManagementBecomingMaster()
Invoked by
ManagementContext when this entity becomes managed at a particular management node,
including the initial management started and subsequent management node master-change for this entity. |
void |
onManagementNoLongerMaster()
Invoked by
ManagementContext when this entity becomes mastered at a particular management node,
including the final management end and subsequent management node master-change for this entity. |
void |
rescanEntities()
Rescans all entities to determine whether they match the filter.
|
void |
setEntityFilter(groovy.lang.Closure<java.lang.Boolean> filter)
Deprecated.
|
void |
setEntityFilter(com.google.common.base.Predicate<? super Entity> filter)
Sets
DynamicGroup.ENTITY_FILTER , overriding (and rescanning all) if already set. |
void |
stop()
Stops this group.
|
addMember, addMemberChild, addMemberChild, addMemberInternal, getCurrentSize, getMembers, hasMember, removeMember, setManagementContext, setMembers, setMembers
addChild, addChild, addEnricher, addEnricher, addFeed, addGroup, addLocations, addPolicy, addPolicy, addTag, clearLocations, clearParent, config, configure, configure, configure, configure, configure, containsTag, destroy, emit, emitInternal, equals, feeds, firstLocation, getAllAttributes, getAllConfig, getAllConfigBag, getApplication, getApplicationId, getAttribute, getAttributeByNameParts, getChildren, getConfig, getConfig, getConfig, getConfig, getConfigMap, getConfigRaw, getConfigRaw, getCreationTime, getDisplayName, getEffector, getEnrichers, getEntityType, getExecutionContext, getFeedSupport, getGroups, getIconUrl, getLocalConfigBag, getLocations, getManagementContext, getManagementSupport, getMutableEntityType, getParent, getPolicies, getProxy, getProxyIfAvailable, getRebindSupport, getSubscriptionContext, getTags, hashCode, invalidateReferences, invoke, invoke, invoke, modifyAttribute, onManagementStarted, onManagementStarting, onManagementStopped, refreshInheritedConfig, removeAllEnrichers, removeAllPolicies, removeAttribute, removeChild, removeEnricher, removeGroup, removeLocations, removePolicy, removeTag, requestPersist, resetProxy, setAttribute, setAttribute, setAttributeWithoutPublishing, setConfig, setConfig, setConfig, setConfig, setConfig, setConfig, setConfigEvenIfOwned, setConfigEvenIfOwned, setDisplayName, setParent, setProxy, subscribe, subscribeToChildren, subscribeToMembers, toMetadataRecord, toString, unsubscribe, unsubscribe
getCatalogItemId, getId, getTagSupport, rebind, setCatalogItemId, tags
setMembers, setMembers
addChild, addChild, addMember, addMemberChild, addMemberChild, getCurrentSize, getMembers, hasMember, removeMember
addEnricher, addEnricher, addFeed, addGroup, addPolicy, addPolicy, addTag, clearParent, containsTag, getApplication, getApplicationId, getAttribute, getChildren, getConfig, getConfig, getConfigRaw, getConfigRaw, getCreationTime, getDisplayName, getEnrichers, getEntityType, getGroups, getIconUrl, getId, getLocations, getParent, getPolicies, getTags, invoke, removeChild, removeEnricher, removeGroup, removePolicy, removeTag, setParent
getCatalogItemId, getTagSupport, tags
config, setConfig
setCatalogItemId
public DynamicGroupImpl()
@Deprecated public DynamicGroupImpl(java.util.Map flags, Entity parent)
public void init()
AbstractEntity
AbstractEntity.initEnrichers()
.init
in class AbstractGroupImpl
public void setEntityFilter(com.google.common.base.Predicate<? super Entity> filter)
DynamicGroup
DynamicGroup.ENTITY_FILTER
, overriding (and rescanning all) if already set.setEntityFilter
in interface DynamicGroup
@Deprecated public void setEntityFilter(groovy.lang.Closure<java.lang.Boolean> filter)
setEntityFilter
in interface DynamicGroup
public com.google.common.base.Predicate<? super Entity> entityFilter()
entityFilter
in interface DynamicGroup
public void stop()
DynamicGroup
Does not stop any of its members. De-activates the filter and unsubscribes to entity-updates, so the membership of the group will not change.
stop
in interface DynamicGroup
public <T> void addSubscription(Entity producer, Sensor<T> sensor, com.google.common.base.Predicate<? super SensorEvent<? super T>> filter)
DynamicGroup
DynamicGroup.addSubscription(Entity, Sensor)
but with an additional filter.addSubscription
in interface DynamicGroup
public <T> void addSubscription(Entity producer, Sensor<T> sensor)
DynamicGroup
Setting either to null indicates everything should be monitored. Note that subscriptions
do not restrict what can be added, they merely ensure prompt membership checking (via
DynamicGroup.ENTITY_FILTER
) for those entities so subscribed.
addSubscription
in interface DynamicGroup
public void onManagementBecomingMaster()
AbstractEntity
ManagementContext
when this entity becomes managed at a particular management node,
including the initial management started and subsequent management node master-change for this entity.onManagementBecomingMaster
in class AbstractEntity
public void onManagementNoLongerMaster()
AbstractEntity
ManagementContext
when this entity becomes mastered at a particular management node,
including the final management end and subsequent management node master-change for this entity.onManagementNoLongerMaster
in class AbstractEntity
public void rescanEntities()
DynamicGroup
rescanEntities
in interface DynamicGroup