public abstract class Action extends Object
| Constructor and Description |
|---|
Action() |
| Modifier and Type | Method and Description |
|---|---|
void |
execute(Object... parameters)
Executes run() method of this
Action, saving the duration of its execution and storing any
RuntimeException and Error which may occur during its work.
|
boolean |
failed()
Indicates whether action invocation failed.
|
long |
getAllowedTime() |
long |
getEndTime() |
long |
getStartTime() |
Throwable |
getThrowable()
Returns throwable that occurred during run() invocation.
|
void |
interrupt() |
boolean |
isInterrupted() |
abstract void |
run(Object... parameters) |
void |
setAllowedTime(long allowedTime) |
String |
toString()
Override this method to provide action description which
will be printed into output.
|
protected boolean |
withinAllowedTime()
Should be used from run() method
to check whether execution time is withing allowed time
|
public final void execute(Object... parameters)
parameters - Parameters to pass to run() methodgetThrowable(),
failed()public long getEndTime()
public long getStartTime()
protected boolean withinAllowedTime()
public long getAllowedTime()
public void setAllowedTime(long allowedTime)
public boolean isInterrupted()
public void interrupt()
public Throwable getThrowable()
public boolean failed()
Copyright © 2018. All rights reserved.