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 InterpreterinterpreterThe actual interpreter.protected java.lang.ObjectresultUse interpreter as marker for not having run.
-
Constructor Summary
Constructors Modifier Constructor Description protectedCallable(Interpreter intrprtr)The base constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectcall()booleancancel()Soft cancel the execution.protected java.lang.Objectinterpret()Run the interpreter.booleanisCancellable()booleanisCancelled()
-
-
-
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:
callin 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 canceled, false otherwise
-
-