Interface SandboxTask<T,R>
-
- Type Parameters:
T
- the type of the input to the taskR
- the type of the result of the task
@ExperimentalApi public interface SandboxTask<T,R>
Represents a task intended to be executed in a process sandbox. To run untrusted code, we need to wrap it in a class implementing this interface and call the task by passing it along with its input argument intoSandbox.execute(SandboxTask, Object)
. The class must be public and must have a public parameter less constructor.- Since:
- 6.9
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description R
apply(SandboxTaskContext context, T t)
Applies this task to the given argument.SandboxSerializer<T>
inputSerializer()
ReturnsSandboxSerializer
for the task input.SandboxSerializer<R>
outputSerializer()
ReturnsSandboxSerializer
for the task output.
-
-
-
Method Detail
-
apply
R apply(SandboxTaskContext context, T t)
Applies this task to the given argument.
-
inputSerializer
SandboxSerializer<T> inputSerializer()
ReturnsSandboxSerializer
for the task input.
-
outputSerializer
SandboxSerializer<R> outputSerializer()
ReturnsSandboxSerializer
for the task output.
-
-