Brooklyn

brooklyn.entity.basic
[Java] Class AbstractGroupImpl

java.lang.Object
  groovy.lang.GroovyObjectSupport
      brooklyn.entity.basic.AbstractEntity
          brooklyn.entity.basic.AbstractGroupImpl
All Implemented Interfaces:
AbstractGroup

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
LOG, POLICY_ADDED, POLICY_REMOVED, SENSOR_ADDED, SENSOR_REMOVED, _subscriptionTracker, attributesInternal, configsInternal, managementSupport, tempWorkings
 
Constructor Summary
AbstractGroupImpl()

AbstractGroupImpl(java.util.Map props)

AbstractGroupImpl(Entity parent)

AbstractGroupImpl(java.util.Map props, Entity parent)

 
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)

boolean removeMember(Entity member)

Returns true if the group was changed as a result of the call.

void setMembers(java.util.Collection m)

void setMembers(java.util.Collection mm, Predicate filter)

 
Methods inherited from class AbstractEntity
addChild, addChild, addEnricher, addGroup, addLocations, addOwnedChild, addPolicy, assertNotYetOwned, clearOwner, clearParent, configure, configure, configure, configure, configure, createManagementSupport, destroy, emit, emitInternal, equals, finalize, firstLocation, getAllAttributes, getAllConfig, getApplication, getApplicationId, getAttribute, getAttributeByNameParts, getChildren, getChildrenReference, getConfig, getConfig, getConfig, getConfig, getConfigMap, getDisplayName, getEffector, getEnrichers, getEntityManager, getEntityType, getEntityTypeName, getExecutionContext, getGroups, getId, getLocations, getManagementContext, getManagementSupport, getMutableEntityType, getOwnedChildren, getOwnedChildrenReference, getOwner, getParent, getPolicies, getProxy, getProxyIfAvailable, getRebindSupport, getSubscriptionContext, getSubscriptionTracker, hasEverBeenManaged, hashCode, init, invalidateReferences, invoke, invoke, invokeFromJava, invokeMethod, isLegacyConstruction, onManagementBecomingMaster, onManagementNoLongerMaster, onManagementStarted, onManagementStarting, refreshInheritedConfig, refreshInheritedConfigOfChildren, removeAllEnrichers, removeAllPolicies, removeAttribute, removeChild, removeEnricher, removeLocations, removeOwnedChild, removePolicy, setApplication, setAttribute, setAttribute, setAttributeWithoutPublishing, setBeingManaged, setConfig, setConfig, setConfig, setConfig, setConfig, setConfig, setConfigEvenIfOwned, setConfigEvenIfOwned, setConfigIfValNonNull, setConfigIfValNonNull, setDisplayName, setManagementContext, setOwner, setParent, setProxy, subscribe, subscribeToChildren, subscribeToMembers, toString, toStringFieldsToInclude, toStringHelper, unsubscribe, unsubscribe
 
Methods inherited from class groovy.lang.GroovyObjectSupport
groovy.lang.GroovyObjectSupport#setProperty(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#getProperty(java.lang.String), groovy.lang.GroovyObjectSupport#getMetaClass(), groovy.lang.GroovyObjectSupport#setMetaClass(groovy.lang.MetaClass), groovy.lang.GroovyObjectSupport#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#wait(), groovy.lang.GroovyObjectSupport#wait(long), groovy.lang.GroovyObjectSupport#wait(long, int), groovy.lang.GroovyObjectSupport#equals(java.lang.Object), groovy.lang.GroovyObjectSupport#toString(), groovy.lang.GroovyObjectSupport#hashCode(), groovy.lang.GroovyObjectSupport#getClass(), groovy.lang.GroovyObjectSupport#notify(), groovy.lang.GroovyObjectSupport#notifyAll()
 

Constructor Detail

AbstractGroupImpl

public AbstractGroupImpl()


AbstractGroupImpl

public AbstractGroupImpl(java.util.Map props)


AbstractGroupImpl

public AbstractGroupImpl(Entity parent)


AbstractGroupImpl

public AbstractGroupImpl(java.util.Map props, Entity parent)


 
Method Detail

addMember

@Override
public 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


getCurrentSize

@Override
public java.lang.Integer getCurrentSize()


getMembers

@Override
public java.util.Collection getMembers()


hasMember

@Override
public boolean hasMember(Entity e)


removeMember

@Override
public boolean removeMember(Entity member)
Returns true if the group was changed as a result of the call.


setMembers

public void setMembers(java.util.Collection m)


setMembers

public void setMembers(java.util.Collection mm, Predicate filter)


 

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