public abstract class AbstractGroupImpl extends AbstractEntity implements AbstractGroup
Synchronization model. When changing and reading the group membership, this class uses internal synchronization to ensure atomic operations and the "happens-before" relationship for reads/updates from different threads. Sub-classes should not use this same synchronization mutex when doing expensive operations - e.g. if resizing a cluster, don't block everyone else from asking for the current number of members.
AbstractEntity.BasicConfigurationSupport, AbstractEntity.BasicEnricherSupport, AbstractEntity.BasicGroupSupport, AbstractEntity.BasicPolicySupport, AbstractEntity.BasicSensorSupport, AbstractEntity.BasicSubscriptionSupportEntity.AdjunctSupport<T extends EntityAdjunct>, Entity.EnricherSupport, Entity.GroupSupport, Entity.PolicySupport, Entity.SensorSupportBrooklynObject.RelationSupport<T extends BrooklynObject>, BrooklynObject.SubscriptionSupport, BrooklynObject.TagSupportConfigurable.ConfigurationSupportEntityInternal.EnricherSupportInternal, EntityInternal.EntitySubscriptionSupportInternal, EntityInternal.FeedSupport, EntityInternal.GroupSupportInternal, EntityInternal.PolicySupportInternal, EntityInternal.SensorSupportInternalBrooklynObjectInternal.ConfigurationSupportInternal, BrooklynObjectInternal.RelationSupportInternal<T extends BrooklynObject>, BrooklynObjectInternal.SubscriptionSupportInternalAPPLICATION_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_REMOVEDFIRST, GROUP_MEMBERS, MEMBER_DELEGATE_CHILDREN, MEMBER_DELEGATE_NAME_FORMAT, RUNNING_QUORUM_CHECK, UP_QUORUM_CHECKGROUP_SIZE, MEMBER_ADDED, MEMBER_REMOVED| Constructor and Description |
|---|
AbstractGroupImpl() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addMember(Entity member)
Adds the given entity as a member of this group and this group as one of the groups of the child
|
<T extends Entity> |
addMemberChild(EntitySpec<T> spec)
As
Group.addChild(EntitySpec) followed by Group.addMember(Entity) |
<T extends Entity> |
addMemberChild(T child)
As
Group.addChild(Entity) followed by Group.addMember(Entity) |
boolean |
addMemberInternal(Entity member) |
java.lang.Integer |
getCurrentSize() |
java.util.Collection<Entity> |
getMembers()
Return the entities that are members of this group.
|
boolean |
hasMember(Entity e) |
void |
init()
Default entity initialization sets ID sensors and calls
AbstractEntity.initEnrichers(). |
boolean |
removeMember(Entity member)
Returns
true if the group was changed as a result of the call. |
void |
setManagementContext(ManagementContextInternal managementContext) |
void |
setMembers(java.util.Collection<Entity> m) |
void |
setMembers(java.util.Collection<Entity> mm,
<any> filter)
Removes any existing members that do not match the given filter, and adds those entities in
the given collection that match the predicate.
|
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, onManagementBecomingMaster, onManagementNoLongerMaster, onManagementStarted, onManagementStarting, onManagementStopped, policies, relations, removeChild, removeLocations, requestPersist, resetProxy, sensors, setConfigEvenIfOwned, setConfigEvenIfOwned, setDisplayName, setParent, setProxy, subscriptions, toMetadataRecord, toStringaddSearchPath, getCatalogItemId, getCatalogItemIdSearchPath, getId, rebind, setCatalogItemId, setCatalogItemIdAndSearchPath, stackCatalogItemId, tagsgetFirstaddFeed, clearParent, enrichers, getApplication, getApplicationId, getAttribute, getChildren, getConfig, getCreationTime, getDisplayName, getEntityType, getIconUrl, getId, getLocations, getParent, groups, invoke, policies, relations, removeChild, sensors, setDisplayName, setParentgetCatalogItemId, getCatalogItemIdSearchPath, subscriptions, tagsconfig, getConfigaddSearchPath, setCatalogItemId, setCatalogItemIdAndSearchPath, stackCatalogItemIdpublic void setManagementContext(ManagementContextInternal managementContext)
setManagementContext in class AbstractEntitypublic void init()
AbstractEntityAbstractEntity.initEnrichers().init in class AbstractEntitypublic boolean addMember(Entity member)
public boolean addMemberInternal(Entity member)
public boolean removeMember(Entity member)
true if the group was changed as a result of the call.removeMember in interface Grouppublic void setMembers(java.util.Collection<Entity> m)
setMembers in interface AbstractGrouppublic void setMembers(java.util.Collection<Entity> mm, <any> filter)
AbstractGroupsetMembers in interface AbstractGroupmm - Entities to test against the filter, and to addfilter - Filter for entities that are to be members (or null for "all")public java.util.Collection<Entity> getMembers()
GroupgetMembers in interface Grouppublic boolean hasMember(Entity e)
public java.lang.Integer getCurrentSize()
getCurrentSize in interface Grouppublic <T extends Entity> T addMemberChild(EntitySpec<T> spec)
GroupGroup.addChild(EntitySpec) followed by Group.addMember(Entity)addMemberChild in interface Grouppublic <T extends Entity> T addMemberChild(T child)
GroupGroup.addChild(Entity) followed by Group.addMember(Entity)addMemberChild in interface Group