public abstract class AbstractScheduledEffectorPolicy extends AbstractPolicy implements java.lang.Runnable, SensorEventListener<java.lang.Object>
AbstractEntityAdjunct.AdjunctTagSupport, AbstractEntityAdjunct.BasicSubscriptionSupport
BrooklynObject.RelationSupport<T extends BrooklynObject>, BrooklynObject.SubscriptionSupport, BrooklynObject.TagSupport
Configurable.ConfigurationSupport
BrooklynObjectInternal.ConfigurationSupportInternal, BrooklynObjectInternal.RelationSupportInternal<T extends BrooklynObject>, BrooklynObjectInternal.SubscriptionSupportInternal
Modifier and Type | Field and Description |
---|---|
static ConfigKey<java.lang.String> |
EFFECTOR |
static ConfigKey<java.util.Map<java.lang.String,java.lang.Object>> |
EFFECTOR_ARGUMENTS |
static java.lang.String |
IMMEDIATELY |
static java.lang.String |
NOW |
static ConfigKey<java.lang.Boolean> |
RUNNING |
static ConfigKey<java.util.List<java.lang.Long>> |
SCHEDULED |
static ConfigKey<AttributeSensor<java.lang.Boolean>> |
START_SENSOR |
static ConfigKey<java.lang.String> |
TIME |
static java.lang.String |
TIME_FORMAT |
static ConfigKey<Duration> |
WAIT |
HIGHLIGHT_NAME_LAST_ACTION, HIGHLIGHT_NAME_LAST_CONFIRMATION, HIGHLIGHT_NAME_LAST_VIOLATION, HIGHLIGHT_NAME_TRIGGERS
NOOP
Constructor and Description |
---|
AbstractScheduledEffectorPolicy() |
Modifier and Type | Method and Description |
---|---|
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
|
java.util.concurrent.ScheduledExecutorService |
getExecutor() |
void |
init()
Called by framework (in new-style instances where spec was used) after configuring etc,
but before a reference to this instance is shared.
|
void |
onEvent(SensorEvent<java.lang.Object> event)
The
SensorEvent handler method. |
void |
rebind()
Called by framework on rebind (in new-style instances):
after configuring, but
before the instance is managed, and
before adjuncts are attached to entities, and
before a reference to an object is shared.
|
void |
resume()
Resume the policy
|
void |
run() |
void |
setEntity(EntityLocal entity) |
void |
setup() |
abstract void |
start() |
getPolicyType, getRebindSupport, isRunning, isSuspended, relations, suspend, toString
config, configure, getAdjunctType, getConfig, getDisplayName, getEntity, getExecutionContext, getHighlights, getManagementContext, getUniqueTag, isDestroyed, setDisplayName, setHighlights, subscriptions, tags
addSearchPath, getCatalogItemId, getCatalogItemIdSearchPath, getId, setCatalogItemId, setCatalogItemIdAndSearchPath, setManagementContext, stackCatalogItemId
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getHighlights, getUniqueTag, isDestroyed
getCatalogItemId, getCatalogItemIdSearchPath, getDisplayName, subscriptions, tags
config, getConfig
addSearchPath, setCatalogItemId, setCatalogItemIdAndSearchPath, stackCatalogItemId
public static final java.lang.String TIME_FORMAT
public static final java.lang.String NOW
public static final java.lang.String IMMEDIATELY
public static final ConfigKey<java.lang.String> EFFECTOR
public static final ConfigKey<java.util.Map<java.lang.String,java.lang.Object>> EFFECTOR_ARGUMENTS
public static final ConfigKey<java.lang.String> TIME
public static final ConfigKey<AttributeSensor<java.lang.Boolean>> START_SENSOR
public static final ConfigKey<java.lang.Boolean> RUNNING
public static final ConfigKey<java.util.List<java.lang.Long>> SCHEDULED
public void init()
AbstractBrooklynObject
To preserve backwards compatibility for if the instance is constructed directly, one can call the code below, but that means it will be called after references to this policy have been shared with other entities.
if (isLegacyConstruction()) {
init();
}
init
in class AbstractBrooklynObject
public void rebind()
AbstractBrooklynObject
AbstractBrooklynObject.init()
will not be called on rebind.
If you need to intercept behaviour after adjuncts are attached,
consider AbstractEntity.onManagementStarting()
(but probably worth raising a discussion on the mailing list!)
rebind
in class AbstractBrooklynObject
public void setup()
public void setEntity(EntityLocal entity)
setEntity
in class AbstractEntityAdjunct
public void resume()
Policy
resume
in interface Policy
resume
in class AbstractPolicy
public void destroy()
AbstractEntityAdjunct
destroy
in class AbstractPolicy
public abstract void start()
public void run()
run
in interface java.lang.Runnable
public void onEvent(SensorEvent<java.lang.Object> event)
SensorEventListener
SensorEvent
handler method.onEvent
in interface SensorEventListener<java.lang.Object>
public java.util.concurrent.ScheduledExecutorService getExecutor()