public abstract class Plan extends AbstractPlan implements ISuspendable
Modifier and Type | Class and Description |
---|---|
class |
Plan.SyncResultListener
Listener that uses the suspend/resume capability of threaded plans.
|
planinit
SUSPENDABLE
Constructor and Description |
---|
Plan() |
Modifier and Type | Method and Description |
---|---|
void |
aborted()
The plan was aborted (because of conditional goal
success or termination from outside).
|
abstract void |
body()
The body method is called on the
instantiated plan instance from the scheduler.
|
IWaitAbstraction |
createWaitAbstraction()
Create a new wait abstraction.
|
void |
dispatchSubgoalAndWait(IGoal subgoal)
A shortcut for dispatching a goal as subgoal of the active goal,,
and waiting for the subgoal to be finished (without timout).
|
void |
dispatchSubgoalAndWait(IGoal subgoal,
long timeout)
A shortcut for dispatching a goal as subgoal of the active goal
and waiting for the subgoal to be finished.
|
void |
failed()
The failed method is called on plan failure/abort.
|
Object |
getMonitor()
Get the monitor for waiting.
|
boolean |
isEventRegisteredInWaitqueue(Object rmevent)
Test if a message event has been registered at the waitqueue.
|
void |
passed()
The passed method is called on plan success.
|
void |
resume(Future<?> future)
Resume the execution of the plan.
|
IMessageEvent |
sendMessageAndWait(IMessageEvent me)
Send a message and wait for the answer.
|
IMessageEvent |
sendMessageAndWait(IMessageEvent me,
long timeout)
Send a message and wait for the answer.
|
IMessageEvent |
sendMessageAndWait(IMessageEvent me,
long timeout,
byte[] codecids)
Send a message and wait for the answer.
|
void |
suspend(Future<?> future,
long timeout)
Suspend the execution of the plan.
|
void |
waitFor(long duration)
Wait for a some time.
|
void |
waitForCondition(String condition)
Wait for a condition to be satisfied.
|
void |
waitForCondition(String condition,
long timeout)
Wait for a condition to be satisfied.
|
void |
waitForEver()
Halt the plan.
|
void |
waitForExternalCondition(IExternalCondition condition)
Wait for an external condition
|
void |
waitForExternalCondition(IExternalCondition condition,
long timeout)
Wait for an external condition
|
Object |
waitForFactAdded(String beliefset)
Wait for a belief set fact addition.
|
Object |
waitForFactAdded(String beliefset,
long timeout)
Wait for a belief (set) fact change.
|
Object |
waitForFactAddedOrRemoved(String beliefset)
Wait for a belief set fact addition or removal.
|
Object |
waitForFactAddedOrRemoved(String beliefset,
long timeout)
Wait for a belief (set) fact addition or removal.
|
Object |
waitForFactChanged(String belief)
Wait for a belief (set) fact change.
|
Object |
waitForFactChanged(String belief,
long timeout)
Wait for a belief (set) fact change.
|
Object |
waitForFactRemoved(String beliefset)
Wait for a belief set fact removal.
|
Object |
waitForFactRemoved(String beliefset,
long timeout)
Wait for a belief (set) fact change.
|
void |
waitForGoal(IGoal goal)
Wait for a goal.
|
void |
waitForGoal(IGoal goal,
long timeout)
Wait for a goal.
|
IGoal |
waitForGoal(String type)
Wait for a goal.
|
IGoal |
waitForGoal(String type,
long timeout)
Wait for a goal.
|
IInternalEvent |
waitForInternalEvent(String type)
Wait for an internal event.
|
IInternalEvent |
waitForInternalEvent(String type,
long timeout)
Wait for an internal event.
|
IMessageEvent |
waitForMessageEvent(String type)
Wait for a message event.
|
IMessageEvent |
waitForMessageEvent(String type,
long timeout)
Wait for a message event.
|
IMessageEvent |
waitForReply(IMessageEvent msgevent)
Wait for a message.
|
IMessageEvent |
waitForReply(IMessageEvent msgevent,
long timeout)
Wait for a message.
|
void |
waitForTick()
Wait for a clock tick.
|
void |
waitForWaitAbstraction(IWaitAbstraction waitabs)
Wait for a wait abstraction.
|
Object |
waitForWaitAbstraction(IWaitAbstraction waitabs,
long timeout)
Wait for a wait abstraction.
|
createExpression, createExpression, createGoal, createInternalEvent, createMessageEvent, createResultListener, createResultListener, dispatchInternalEvent, dispatchSubgoal, dispatchTopLevelGoal, endAtomic, fail, fail, fail, getBeliefbase, getBody, getClock, getComponentDescription, getComponentIdentifier, getComponentName, getDispatchedElement, getEventbase, getException, getExpression, getExpressionbase, getExternalAccess, getGoalbase, getInterpreter, getLifecycleState, getLogger, getParameter, getParameters, getParameterSet, getParameterSets, getPlanbase, getPlanElement, getReason, getScope, getServiceContainer, getState, getTime, getType, getWaitqueue, hasParameter, hasParameterSet, killAgent, sendMessage, sendMessage, startAtomic, toString
public abstract void body()
public void passed()
public void failed()
public void aborted()
public IWaitAbstraction createWaitAbstraction()
public void waitFor(long duration)
duration
- The duration.public void waitForWaitAbstraction(IWaitAbstraction waitabs)
public void waitForEver()
public void waitForTick()
public void waitForCondition(String condition)
condition
- The condition.public void waitForCondition(String condition, long timeout)
condition
- The condition.public void dispatchSubgoalAndWait(IGoal subgoal)
subgoal
- The new subgoal.GoalFailureException
- when the goal fails.public void dispatchSubgoalAndWait(IGoal subgoal, long timeout)
subgoal
- The new subgoal.timeout
- The timeout.GoalFailureException
- when the goal fails.public IInternalEvent waitForInternalEvent(String type)
type
- The internal event type.public IInternalEvent waitForInternalEvent(String type, long timeout)
type
- The internal event type.timeout
- The timeout.public IMessageEvent sendMessageAndWait(IMessageEvent me)
me
- The message event.public IMessageEvent sendMessageAndWait(IMessageEvent me, long timeout)
me
- The message event.timeout
- The timeout.public IMessageEvent sendMessageAndWait(IMessageEvent me, long timeout, byte[] codecids)
me
- The message event.timeout
- The timeout.public IMessageEvent waitForMessageEvent(String type)
type
- The message event type.public IMessageEvent waitForMessageEvent(String type, long timeout)
type
- The message event type.timeout
- The timeout.public IMessageEvent waitForReply(IMessageEvent msgevent)
msgevent
- The message event.public IMessageEvent waitForReply(IMessageEvent msgevent, long timeout)
msgevent
- The message event.public IGoal waitForGoal(String type, long timeout)
type
- The goal type.timeout
- The timeout.public void waitForGoal(IGoal goal)
goal
- The goal.public void waitForGoal(IGoal goal, long timeout)
goal
- The goal.timeout
- The timeout.public Object waitForFactChanged(String belief)
belief
- The belief (set) type.public Object waitForFactChanged(String belief, long timeout)
belief
- The belief (set) type.timeout
- The timeout.public Object waitForFactAdded(String beliefset)
beliefset
- The belief set type.public Object waitForFactAdded(String beliefset, long timeout)
beliefset
- The belief (set) type.timeout
- The timeout.public Object waitForFactRemoved(String beliefset)
beliefset
- The belief set type.public Object waitForFactRemoved(String beliefset, long timeout)
beliefset
- The belief (set) type.timeout
- The timeout.public Object waitForFactAddedOrRemoved(String beliefset)
beliefset
- The belief set type.public Object waitForFactAddedOrRemoved(String beliefset, long timeout)
beliefset
- The belief (set) type.timeout
- The timeout.public void waitForExternalCondition(IExternalCondition condition)
condition
- The external condition.public void waitForExternalCondition(IExternalCondition condition, long timeout)
condition
- The external condition.timeout
- The timeout.public boolean isEventRegisteredInWaitqueue(Object rmevent)
msgevent
- The message event.public Object waitForWaitAbstraction(IWaitAbstraction waitabs, long timeout)
public void suspend(Future<?> future, long timeout)
suspend
in interface ISuspendable
timeout
- The timeout.future
- The future to wait for.public void resume(Future<?> future)
resume
in interface ISuspendable
future
- The future that issues the resume.public Object getMonitor()
getMonitor
in interface ISuspendable
Copyright © 2013. All Rights Reserved.