Interface Sandbox


@ExperimentalApi public interface Sandbox
A sandbox is an object responsible for running java code in an isolated OS process. Sandbox is designed to run unsafe code which can timeout, run out of memory or take substantial CPU load. Any failures of sandbox process will not affect Confluence stability.

Sandbox objects are obtained from injected SandboxRegistry. For unit tests, com.atlassian.confluence.impl.util.sandbox.TestSandbox should be used.

Since:
6.9
  • Method Summary

    Modifier and Type
    Method
    Description
    <T, R> R
    execute(SandboxTask<T,R> task, T input)
    Run the given task with the given input in a process sandbox.
    <T, R> R
    execute(SandboxTask<T,R> task, T input, Duration timeLimit)
    Run the given task with the given input in a process sandbox and limit a call by a given time limit.