public class DynamicMultiGroupImpl extends DynamicGroupImpl implements DynamicMultiGroup
Modifier and Type | Class and Description |
---|---|
static class |
DynamicMultiGroupImpl.BucketFromAttribute
Function for deriving bucket names from a sensor value. |
AbstractEntity.BasicConfigurationSupport, AbstractEntity.BasicEnricherSupport, AbstractEntity.BasicGroupSupport, AbstractEntity.BasicPolicySupport, AbstractEntity.BasicSensorSupport, AbstractEntity.BasicSubscriptionSupport
Entity.AdjunctSupport<T extends EntityAdjunct>, Entity.EnricherSupport, Entity.GroupSupport, Entity.PolicySupport, Entity.SensorSupport
BrooklynObject.RelationSupport<T extends BrooklynObject>, BrooklynObject.SubscriptionSupport, BrooklynObject.TagSupport
Configurable.ConfigurationSupport
EntityInternal.EnricherSupportInternal, EntityInternal.EntitySubscriptionSupportInternal, EntityInternal.FeedSupport, EntityInternal.GroupSupportInternal, EntityInternal.PolicySupportInternal, EntityInternal.SensorSupportInternal
BrooklynObjectInternal.ConfigurationSupportInternal, BrooklynObjectInternal.RelationSupportInternal<T extends BrooklynObject>, BrooklynObjectInternal.SubscriptionSupportInternal
APPLICATION_ID, CATALOG_ID, CHILD_ADDED, CHILD_REMOVED, CONFIG_KEY_ADDED, CONFIG_KEY_REMOVED, DEFAULT_DISPLAY_NAME, EFFECTOR_ADDED, EFFECTOR_CHANGED, EFFECTOR_REMOVED, ENTITY_ID, GROUP_ADDED, GROUP_REMOVED, LOCATION_ADDED, LOCATION_REMOVED, POLICY_ADDED, POLICY_REMOVED, SENSOR_ADDED, SENSOR_REMOVED
BUCKET_FUNCTION, BUCKET_SPEC, BUCKETS, RESCAN, RESCAN_INTERVAL
ENTITY_FILTER, RESCAN_EFFECTOR, RUNNING
FIRST, GROUP_MEMBERS, MEMBER_DELEGATE_CHILDREN, MEMBER_DELEGATE_NAME_FORMAT, RUNNING_QUORUM_CHECK, UP_QUORUM_CHECK
GROUP_SIZE, MEMBER_ADDED, MEMBER_REMOVED
Constructor and Description |
---|
DynamicMultiGroupImpl() |
Modifier and Type | Method and Description |
---|---|
static <any> |
bucketFromAttribute(AttributeSensor<?> sensor)
Convenience factory method for the common use-case of deriving the bucket directly from a sensor value.
|
static <any> |
bucketFromAttribute(AttributeSensor<?> sensor,
java.lang.String defaultValue)
Convenience factory method for the common use-case of deriving the bucket directly from a sensor value.
|
void |
distributeEntities()
Distribute entities accepted by the
DynamicGroup.ENTITY_FILTER into uniquely-named
buckets according to the DynamicMultiGroup.BUCKET_FUNCTION . |
void |
init()
Default entity initialization sets ID sensors and calls
AbstractEntity.initEnrichers() . |
void |
rebind()
Called by framework on rebind (in new-style instances):
after configuring, but
before the instance is managed, and
before adjuncts are attached to entities, and
before a reference to an object is shared.
|
void |
rescanEntities()
Rescans all entities to determine whether they match the filter.
|
void |
stop()
Stops this group.
|
addSubscription, addSubscription, entityFilter, onManagementBecomingMaster, onManagementNoLongerMaster, setEntityFilter
addMember, addMemberChild, addMemberChild, addMemberInternal, getCurrentSize, getMembers, hasMember, removeMember, setManagementContext, setMembers, setMembers
addChild, addChild, addFeed, addLocations, addLocationsWithoutPublishing, clearLocations, clearParent, config, configure, configure, destroy, enrichers, equals, feeds, firstLocation, getApplication, getApplicationId, getAttribute, getChildren, getConfig, getConfig, getCreationTime, getDisplayName, getEffector, getEntityType, getExecutionContext, getIconUrl, getLocations, getManagementContext, getManagementSupport, getMutableEntityType, getParent, getProxy, getProxyIfAvailable, getRebindSupport, groups, hashCode, invalidateReferences, invoke, invoke, invoke, onManagementStarted, onManagementStarting, onManagementStopped, policies, relations, removeChild, removeLocations, requestPersist, resetProxy, sensors, setConfigEvenIfOwned, setConfigEvenIfOwned, setDisplayName, setParent, setProxy, subscriptions, toMetadataRecord, toString
addSearchPath, getCatalogItemId, getCatalogItemIdSearchPath, getId, setCatalogItemId, setCatalogItemIdAndSearchPath, stackCatalogItemId, tags
addSubscription, addSubscription, entityFilter, setEntityFilter
getFirst, setMembers, setMembers
addChild, addChild, addMember, addMemberChild, addMemberChild, getCurrentSize, getMembers, hasMember, removeMember
addFeed, clearParent, enrichers, getApplication, getApplicationId, getAttribute, getChildren, getConfig, getCreationTime, getDisplayName, getEntityType, getIconUrl, getId, getLocations, getParent, groups, invoke, policies, relations, removeChild, sensors, setDisplayName, setParent
getCatalogItemId, getCatalogItemIdSearchPath, subscriptions, tags
config, getConfig
addSearchPath, setCatalogItemId, setCatalogItemIdAndSearchPath, stackCatalogItemId
public static <any> bucketFromAttribute(AttributeSensor<?> sensor, java.lang.String defaultValue)
DynamicMultiGroup.BUCKET_FUNCTION
public static <any> bucketFromAttribute(AttributeSensor<?> sensor)
DynamicMultiGroup.BUCKET_FUNCTION
public void init()
AbstractEntity
AbstractEntity.initEnrichers()
.init
in class DynamicGroupImpl
public void rebind()
AbstractBrooklynObject
AbstractBrooklynObject.init()
will not be called on rebind.
If you need to intercept behaviour after adjuncts are attached,
consider AbstractEntity.onManagementStarting()
(but probably worth raising a discussion on the mailing list!)
rebind
in class AbstractBrooklynObject
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
stop
in class DynamicGroupImpl
public void rescanEntities()
DynamicGroup
rescanEntities
in interface DynamicGroup
rescanEntities
in class DynamicGroupImpl
public void distributeEntities()
DynamicMultiGroup
DynamicGroup.ENTITY_FILTER
into uniquely-named
buckets according to the DynamicMultiGroup.BUCKET_FUNCTION
.
A Group
entity is created for each required bucket and added as a managed child of
this component. Entities for a given bucket are added as members of the corresponding group.
By default BasicGroup
instances will be created for the buckets, however any group
entity can be used instead (e.g. with custom effectors) by specifying the relevant entity
spec via the DynamicMultiGroup.BUCKET_SPEC
config key.
Entities for which the bucket function returns null
are not allocated to any
bucket and are thus effectively excluded. Buckets that become empty following re-evaluation
are removed.
distributeEntities
in interface DynamicMultiGroup
DynamicGroup.ENTITY_FILTER
,
DynamicMultiGroup.BUCKET_FUNCTION
,
#GROUP_SPEC