|
Brooklyn | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbrooklyn.policy.basic.AbstractEntityAdjunct
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 AdjunctType |
adjunctType
|
protected ConfigMapImpl |
configsInternal
The config values of this entity. |
protected EntityLocal |
entity
|
protected ExecutionContext |
execution
|
protected java.lang.String |
id
|
protected java.util.Map |
leftoverProperties
|
protected java.lang.String |
name
|
Constructor Summary | |
AbstractEntityAdjunct()
|
|
AbstractEntityAdjunct(java.util.Map flags)
|
Method Summary | |
---|---|
protected boolean
|
check(Entity producer)
|
protected void
|
configure()
will set fields from flags, and put the remaining ones into the 'leftovers' map. |
void
|
configure(java.util.Map flags)
|
void
|
destroy()
|
protected void
|
doReconfigureConfig(ConfigKey key, java.lang.Object val)
|
protected AdjunctType
|
getAdjunctType()
|
java.util.Map
|
getAllConfig()
|
protected java.util.Collection
|
getAllSubscriptions()
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 |
java.lang.Object
|
getConfig(ConfigKey key)
|
ConfigMap
|
getConfigMap()
for inspection only |
java.lang.String
|
getId()
|
protected ManagementContext
|
getManagementContext()
|
java.lang.String
|
getName()
|
protected SubscriptionTracker
|
getSubscriptionTracker()
@see SubscriptionContext#subscribe(Entity, Sensor, SensorEventListener) |
void
|
init()
|
boolean
|
isDestroyed()
|
protected boolean
|
isLegacyConstruction()
|
boolean
|
isRunning()
|
java.lang.Object
|
setConfig(ConfigKey key, java.lang.Object val)
|
void
|
setEntity(EntityLocal entity)
|
void
|
setId(java.lang.String id)
|
void
|
setManagementContext(ManagementContext managementContext)
|
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)
returns false if deleted, throws exception if invalid state, otherwise true. |
protected SubscriptionHandle
|
subscribeToMembers(Group producerGroup, Sensor sensor, SensorEventListener listener)
@see SubscriptionContext#subscribe(Entity, Sensor, SensorEventListener) |
java.lang.String
|
toString()
|
protected boolean
|
unsubscribe(Entity producer)
|
protected boolean
|
unsubscribe(Entity producer, SubscriptionHandle handle)
@return a list of all subscription handles |
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 |
---|
protected SubscriptionTracker _subscriptionTracker
protected final AdjunctType adjunctType
protected final ConfigMapImpl configsInternal
protected EntityLocal entity
protected ExecutionContext execution
@SetFromFlag protected java.lang.String id
protected java.util.Map leftoverProperties
@SetFromFlag protected java.lang.String name
Constructor Detail |
---|
public AbstractEntityAdjunct()
public AbstractEntityAdjunct(java.util.Map flags)
Method Detail |
---|
protected boolean check(Entity producer)
protected void configure()
if you require fields to be initialized you must do that in this method. You must *not* rely on field initializers because they may not run until *after* this method (this method is invoked by the constructor in this class, so initializers in subclasses will not have run when this overridden method is invoked.)
@SuppressWarnings("unchecked") public void configure(java.util.Map flags)
public void destroy()
protected void doReconfigureConfig(ConfigKey key, java.lang.Object val)
protected AdjunctType getAdjunctType()
public java.util.Map getAllConfig()
protected java.util.Collection getAllSubscriptions()
public java.lang.Object getConfig(ConfigKey key)
protected AdjunctType getAdjunctType() { public ConfigMap getConfigMap()
public java.lang.String getId()
protected ManagementContext getManagementContext()
public String getId() { return id; } public java.lang.String getName()
protected SubscriptionTracker getSubscriptionTracker()
public void init()
public boolean isDestroyed()
protected boolean isLegacyConstruction()
.add("running", isRunning()) public boolean isRunning()
// TODO make immutable public java.lang.Object setConfig(ConfigKey key, java.lang.Object val)
public void setEntity(EntityLocal entity)
public void setId(java.lang.String id)
public void setManagementContext(ManagementContext managementContext)
public void setName(java.lang.String name)
protected SubscriptionHandle subscribe(Entity producer, Sensor sensor, SensorEventListener listener)
protected SubscriptionHandle subscribeToChildren(Entity producerParent, Sensor sensor, SensorEventListener listener)
protected SubscriptionHandle subscribeToMembers(Group producerGroup, Sensor sensor, SensorEventListener listener)
public java.lang.String toString()
protected boolean unsubscribe(Entity producer)
protected boolean unsubscribe(Entity producer, SubscriptionHandle handle)
Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.