Brooklyn

brooklyn.policy.basic
[Java] Class AbstractEntityAdjunct

java.lang.Object
  brooklyn.policy.basic.AbstractEntityAdjunct
All Implemented Interfaces:
EntityAdjunct

public abstract class AbstractEntityAdjunct

Common functionality for policies and enrichers


Field Summary
protected SubscriptionTracker _subscriptionTracker

not for direct access; refer to as 'subscriptionTracker' via getter so that it is initialized

protected EntityLocal entity

protected java.lang.String id

protected java.lang.String name

 
Method Summary
protected boolean check(Entity producer)

returns false if deleted, throws exception if invalid state, otherwise true

void destroy()

Unsubscribes and clears all managed subscriptions; is called by the owning entity when a policy is removed and should always be called by any subclasses overriding this method

protected java.util.Collection getAllSubscriptions()

@return a list of all subscription handles

java.lang.String getId()

protected ManagementContext getManagementContext()

java.lang.String getName()

protected SubscriptionTracker getSubscriptionTracker()

boolean isDestroyed()

boolean isRunning()

void setEntity(EntityLocal entity)

void setId(java.lang.String id)

void setName(java.lang.String name)

protected SubscriptionHandle subscribe(Entity producer, Sensor sensor, SensorEventListener listener)

@see SubscriptionContext#subscribe(Entity, Sensor, SensorEventListener)

protected SubscriptionHandle subscribeToChildren(Entity producerParent, Sensor sensor, SensorEventListener listener)

@see SubscriptionContext#subscribe(Entity, Sensor, SensorEventListener)

protected SubscriptionHandle subscribeToMembers(Group producerGroup, Sensor sensor, SensorEventListener listener)

@see SubscriptionContext#subscribe(Entity, Sensor, SensorEventListener)

protected boolean unsubscribe(Entity producer)

Unsubscribes the given producer.

protected boolean unsubscribe(Entity producer, SubscriptionHandle handle)

Unsubscribes the given producer.

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Field Detail

_subscriptionTracker

protected SubscriptionTracker _subscriptionTracker
not for direct access; refer to as 'subscriptionTracker' via getter so that it is initialized


entity

protected EntityLocal entity


id

@SetFromFlag
protected java.lang.String id


name

@SetFromFlag
protected java.lang.String name


 
Method Detail

check

protected boolean check(Entity producer)
returns false if deleted, throws exception if invalid state, otherwise true


destroy

public void destroy()
Unsubscribes and clears all managed subscriptions; is called by the owning entity when a policy is removed and should always be called by any subclasses overriding this method


getAllSubscriptions

protected java.util.Collection getAllSubscriptions()
Returns:
a list of all subscription handles


getId

public java.lang.String getId()


getManagementContext

protected ManagementContext getManagementContext()


getName

public java.lang.String getName()


getSubscriptionTracker

protected SubscriptionTracker getSubscriptionTracker()


isDestroyed

@Override
public boolean isDestroyed()


isRunning

@Override
public boolean isRunning()


setEntity

public void setEntity(EntityLocal entity)


setId

public void setId(java.lang.String id)


setName

public void setName(java.lang.String name)


subscribe

protected SubscriptionHandle subscribe(Entity producer, Sensor sensor, SensorEventListener listener)
See Also:
SubscriptionContext#subscribe(Entity, Sensor, SensorEventListener)#subscribe(Entity, Sensor, SensorEventListener)


subscribeToChildren

protected SubscriptionHandle subscribeToChildren(Entity producerParent, Sensor sensor, SensorEventListener listener)
See Also:
SubscriptionContext#subscribe(Entity, Sensor, SensorEventListener)#subscribe(Entity, Sensor, SensorEventListener)


subscribeToMembers

protected SubscriptionHandle subscribeToMembers(Group producerGroup, Sensor sensor, SensorEventListener listener)
See Also:
SubscriptionContext#subscribe(Entity, Sensor, SensorEventListener)#subscribe(Entity, Sensor, SensorEventListener)


unsubscribe

protected boolean unsubscribe(Entity producer)
Unsubscribes the given producer.
See Also:
SubscriptionContext#unsubscribe(SubscriptionHandle)#unsubscribe(SubscriptionHandle)


unsubscribe

protected boolean unsubscribe(Entity producer, SubscriptionHandle handle)
Unsubscribes the given producer.
See Also:
SubscriptionContext#unsubscribe(SubscriptionHandle)#unsubscribe(SubscriptionHandle)


 

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