Constructor and Description |
---|
BackoffBehavior(long millis)
Creates a behavior that is executed after a specified backoff.
|
BackoffBehavior(long millis,
java.lang.Runnable runnable)
Creates a behavior that is executed after a specified backoff.
|
Modifier and Type | Method and Description |
---|---|
void |
action()
This method calls
onExpiry() when the specified backoff period expires. |
protected void |
backoff(long millis)
This method is called from
onExpiry() if the backoff
is to be extended. |
boolean |
done()
Returns true once
stop() is called, false otherwise. |
void |
onExpiry()
This method is called when the specified backoff period expires.
|
void |
onStart()
Computes the wakeup time for the first execution of this behavior.
|
void |
reset()
Resets the behavior, allowing it to be used again.
|
void |
stop()
Terminates the behavior.
|
agent, agentForService, agentForService, agentsForService, agentsForService, block, block, compareTo, getPriority, isBlocked, onEnd, println, restart
public BackoffBehavior(long millis)
millis
- backoff in milliseconds.public BackoffBehavior(long millis, java.lang.Runnable runnable)
millis
- backoff in milliseconds.runnable
- Runnable to run.public final void stop()
protected void backoff(long millis)
onExpiry()
if the backoff
is to be extended.millis
- backoff in milliseconds.public void onExpiry()
public void onStart()
onStart
in class Behavior
Behavior.onStart()
public final void action()
onExpiry()
when the specified backoff period expires.action
in class Behavior
Behavior.action()
public final boolean done()
stop()
is called, false otherwise.done
in class Behavior
stop()
is called, false otherwise.Behavior.done()
public void reset()
reset
in class Behavior
Behavior.reset()