|
Brooklyn | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbrooklyn.entity.basic.AbstractEntity
brooklyn.entity.basic.AbstractGroupImpl
public abstract class AbstractGroupImpl extends AbstractEntity
Represents a group of entities - sub-classes can support dynamically changing membership, ad hoc groupings, etc.
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.
Field Summary |
---|
Fields inherited from class AbstractEntity | |
---|---|
EFFECTOR_ADDED, EFFECTOR_CHANGED, EFFECTOR_REMOVED, LOG, POLICY_ADDED, POLICY_REMOVED, SENSOR_ADDED, SENSOR_REMOVED, _subscriptionTracker, managementSupport, tempWorkings |
Constructor Summary | |
AbstractGroupImpl()
|
Method Summary | |
---|---|
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 |
java.lang.Integer
|
getCurrentSize()
|
java.util.Collection
|
getMembers()
|
boolean
|
hasMember(Entity e)
|
void
|
init()
|
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 m)
|
void
|
setMembers(java.util.Collection mm, Predicate filter)
|
Constructor Detail |
---|
public AbstractGroupImpl()
Method Detail |
---|
log.debug("Group {} got new member {}", this, member); public boolean addMember(Entity member)
public java.lang.Integer getCurrentSize()
public boolean hasMember(Entity e) { public java.util.Collection getMembers()
public Integer getCurrentSize() { public boolean hasMember(Entity e)
/** public void init()
emit(MEMBER_REMOVED, member); public boolean removeMember(Entity member)
@Override public void setManagementContext(ManagementContextInternal managementContext)
public void setMembers(Collectionmm, Predicate filter) { public void setMembers(java.util.Collection m)
if (!(mm.contains(m) && (filter==null || filter.apply(m)))) public void setMembers(java.util.Collection mm, Predicate filter)
Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.