Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package brooklyn.policy.loadbalancing;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import brooklyn.entity.Entity;
import brooklyn.entity.Group;
import brooklyn.entity.basic.AbstractGroup;
import brooklyn.entity.basic.DynamicGroupImpl;
import brooklyn.event.Sensor;
import brooklyn.event.SensorEvent;
import brooklyn.event.SensorEventListener;
import brooklyn.util.MutableMap;
import brooklyn.util.flags.SetFromFlag;
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
/**
* A group of items that are contained within a given (dynamically changing) set of containers.
*
* The {@link setContainers(Group)} sets the group of containers. The membership of that group
* is dynamically tracked.
*
* When containers are added/removed, or when an items is added/removed, or when an {@link Moveable} item
* is moved then the membership of this group of items is automatically updated accordingly.
*
* For example: in Monterey, this could be used to track the actors that are within a given cluster of venues.
*/
public class ItemsInContainersGroup extends DynamicGroupImpl {
// TODO Inefficient: will not scale to many 1000s of items
private static final Logger LOG = LoggerFactory.getLogger(ItemsInContainersGroup.class);
// FIXME Can't set default value in fiel declaration, because super sets it before this class initializes the field values!
@SetFromFlag
Predicate itemFilter;
private Group containerGroup;
private final SensorEventListener