Class Script.Callable
- java.lang.Object
-
- org.apache.commons.jexl3.internal.Script.Callable
-
- All Implemented Interfaces:
java.util.concurrent.Callable<java.lang.Object>
- Enclosing class:
- Script
public class Script.Callable extends java.lang.Object implements java.util.concurrent.Callable<java.lang.Object>
Implements the Future and Callable interfaces to help delegation.
-
-
Field Summary
Fields Modifier and Type Field Description protected Interpreter
interpreter
The actual interpreter.protected java.lang.Object
result
Use interpreter as marker for not having run.
-
Constructor Summary
Constructors Modifier Constructor Description protected
Callable(Interpreter intrprtr)
The base constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
call()
boolean
cancel()
Soft cancel the execution.protected java.lang.Object
interpret()
Run the interpreter.boolean
isCancellable()
boolean
isCancelled()
-
-
-
Field Detail
-
interpreter
protected final Interpreter interpreter
The actual interpreter.
-
result
protected volatile java.lang.Object result
Use interpreter as marker for not having run.
-
-
Constructor Detail
-
Callable
protected Callable(Interpreter intrprtr)
The base constructor.- Parameters:
intrprtr
- the interpreter to use
-
-
Method Detail
-
call
public java.lang.Object call() throws java.lang.Exception
- Specified by:
call
in interfacejava.util.concurrent.Callable<java.lang.Object>
- Throws:
java.lang.Exception
-
cancel
public boolean cancel()
Soft cancel the execution.- Returns:
- true if cancel was successful, false otherwise
-
interpret
protected java.lang.Object interpret()
Run the interpreter.- Returns:
- the evaluation result
-
isCancellable
public boolean isCancellable()
- Returns:
- true if interruption will throw a JexlException.Cancel, false otherwise
-
isCancelled
public boolean isCancelled()
- Returns:
- true if evaluation was cancelled, false otherwise
-
-