public final class ScriptEngineConfiguration extends Object
StandardScriptEngineManager as an
atomic action and will be picked up by new script executions, while existing executions will continue using the old
configuration. This ensures consistency of configuration parameters during script execution.| Modifier and Type | Class and Description |
|---|---|
static class |
ScriptEngineConfiguration.Builder
Builder pattern for constructing immutable script configuration instances using a fluent API.
|
| Modifier and Type | Field and Description |
|---|---|
static long |
NO_TIMEOUT
Constant to indicate no script timeout should be used.
|
static int |
UNBOUNDED_QUEUE_SIZE
Constant to indicate that the thread pool queue should be unbounded.
|
| Modifier and Type | Method and Description |
|---|---|
static ScriptEngineConfiguration.Builder |
builder()
Creates a fresh configuration builder.
|
boolean |
equals(Object o) |
List<Pattern> |
getClassBlackList()
Gets the current Java class name blacklist patterns.
|
List<Pattern> |
getClassWhiteList()
Gets the current Java class name whitelist patterns.
|
long |
getScriptExecutionTimeout()
Returns the maximum script execution time limit, in seconds.
|
SecurityManager |
getSecurityManager()
Gets the Java SecurityManager to use when checking if a Java class or package should be exposed to a script.
|
int |
getThreadPoolCoreSize()
The number of threads to keep in the thread pool used to service script execution requests.
|
long |
getThreadPoolIdleTimeoutSeconds()
The number of seconds to wait before terminating additional threads (beyond core pool size, up to max pool size)
that were started to service a full task queue.
|
int |
getThreadPoolMaxSize()
The maximum number of threads to use to service script execution requests once the task queue has reached
capacity.
|
int |
getThreadPoolQueueSize()
The size of the queue to use for buffering tasks when all threads in the thread pool are in use.
|
int |
hashCode() |
String |
toString() |
public static final long NO_TIMEOUT
public static final int UNBOUNDED_QUEUE_SIZE
public long getScriptExecutionTimeout()
NO_TIMEOUT to indicate no timeout.public List<Pattern> getClassWhiteList()
public List<Pattern> getClassBlackList()
public SecurityManager getSecurityManager()
SecurityManager.checkPackageAccess(String) method will be called for every Java class that is
accessed by the script.public int getThreadPoolCoreSize()
public int getThreadPoolMaxSize()
public int getThreadPoolQueueSize()
UNBOUNDED_QUEUE_SIZE to specify an unbounded queue (this disables the threadPoolMaxSize option). There
is a trade-off between queue size and maximum pool size. For long-running I/O-bound scripts (e.g., those making
REST calls) it is better to have a larger maximum pool size and a smaller queue size so that other threads can
run while some are blocked in I/O calls. The short queue size ensures that new requests do not wait too long to
be serviced. For scripts that are short-running and CPU-bound then the reverse is true: use a smaller pool size
to minimise thread scheduling and context-switching overhead, with a longer queue to avoid rejected execution
exceptions.public long getThreadPoolIdleTimeoutSeconds()
public static ScriptEngineConfiguration.Builder builder()
Copyright © 2010–2024 Open Identity Platform Community. All rights reserved.