public abstract class AbstractScheduledEffectorPolicy extends AbstractPolicy implements java.lang.Runnable, SensorEventListener<java.lang.Object>
AbstractEntityAdjunct.AdjunctTagSupport, AbstractEntityAdjunct.BasicSubscriptionSupportBrooklynObject.RelationSupport<T extends BrooklynObject>, BrooklynObject.SubscriptionSupport, BrooklynObject.TagSupportConfigurable.ConfigurationSupportBrooklynObjectInternal.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_TRIGGERSNOOP| 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, toStringconfig, configure, getAdjunctType, getConfig, getDisplayName, getEntity, getExecutionContext, getHighlights, getManagementContext, getUniqueTag, isDestroyed, setDisplayName, setHighlights, subscriptions, tagsaddSearchPath, getCatalogItemId, getCatalogItemIdSearchPath, getId, setCatalogItemId, setCatalogItemIdAndSearchPath, setManagementContext, stackCatalogItemIdequals, getClass, hashCode, notify, notifyAll, wait, wait, waitgetHighlights, getUniqueTag, isDestroyedgetCatalogItemId, getCatalogItemIdSearchPath, getDisplayName, subscriptions, tagsconfig, getConfigaddSearchPath, setCatalogItemId, setCatalogItemIdAndSearchPath, stackCatalogItemIdpublic 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()
AbstractBrooklynObjectTo 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 AbstractBrooklynObjectpublic void rebind()
AbstractBrooklynObjectAbstractBrooklynObject.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 AbstractBrooklynObjectpublic void setup()
public void setEntity(EntityLocal entity)
setEntity in class AbstractEntityAdjunctpublic void resume()
Policyresume in interface Policyresume in class AbstractPolicypublic void destroy()
AbstractEntityAdjunctdestroy in class AbstractPolicypublic abstract void start()
public void run()
run in interface java.lang.Runnablepublic void onEvent(SensorEvent<java.lang.Object> event)
SensorEventListenerSensorEvent handler method.onEvent in interface SensorEventListener<java.lang.Object>public java.util.concurrent.ScheduledExecutorService getExecutor()