public static final class ScriptEngineConfiguration.Builder extends Object
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
ScriptEngineConfiguration |
build()
Builds the script engine configuration object from the specified parameters.
|
ScriptEngineConfiguration.Builder |
withBlackList(List<Pattern> blackList)
Sets the Java class black-list for classes that a script should be forbidden from accessing.
|
ScriptEngineConfiguration.Builder |
withSecurityManager(SecurityManager securityManager)
Sets the security manager to use when checking access to Java packages in script execution.
|
ScriptEngineConfiguration.Builder |
withSystemSecurityManager()
Sets the security manager to use when checking access to Java packages to the configured system security
manager (if enabled).
|
ScriptEngineConfiguration.Builder |
withThreadPoolCoreSize(int coreSize)
Sets the core size of the thread pool to use for executing scripts (see
ThreadPoolScriptEvaluator). |
ScriptEngineConfiguration.Builder |
withThreadPoolIdleTimeout(long timeout,
TimeUnit units)
Sets the timeout after which additional threads (beyond the core pool size) will be terminated once pending
requests on the queue have been satisfied.
|
ScriptEngineConfiguration.Builder |
withThreadPoolMaxSize(int maxSize)
Sets the maximum size of the thread pool to use for executing scripts (see
ThreadPoolScriptEvaluator). |
ScriptEngineConfiguration.Builder |
withThreadPoolQueueSize(int queueSize)
Sets the size of the queue to use for buffering requests for script execution once all core threads are in
use.
|
ScriptEngineConfiguration.Builder |
withTimeout(long timeout,
TimeUnit unit)
Sets the maximum amount of time (in seconds) to allow a script to execute before interrupting it.
|
ScriptEngineConfiguration.Builder |
withWhiteList(List<Pattern> whiteList)
Sets the Java class white-list for classes that a script should be allowed to access.
|
public ScriptEngineConfiguration.Builder withTimeout(long timeout, TimeUnit unit)
ScriptEngineConfiguration.NO_TIMEOUT for no timeout.timeout - the script execution timeout. Must be >= 0.unit - the time units of the timeout.public ScriptEngineConfiguration.Builder withWhiteList(List<Pattern> whiteList)
whiteList - the class white list. Must not be null.public ScriptEngineConfiguration.Builder withBlackList(List<Pattern> blackList)
blackList - the class black list. Must not be null.public ScriptEngineConfiguration.Builder withSecurityManager(SecurityManager securityManager)
securityManager - the security manager to use. Use null to disable.public ScriptEngineConfiguration.Builder withSystemSecurityManager()
System.getSecurityManager()public ScriptEngineConfiguration.Builder withThreadPoolCoreSize(int coreSize)
ThreadPoolScriptEvaluator). This is the number of threads that will
be created to service requests before new requests are queued.coreSize - the number of threads to keep in the thread pool. Must be >= 1.public ScriptEngineConfiguration.Builder withThreadPoolMaxSize(int maxSize)
ThreadPoolScriptEvaluator). This is the maximum number of threads that
will be created once the queue reaches capacity.maxSize - the maximum number of threads to use in the thread pool.public ScriptEngineConfiguration.Builder withThreadPoolQueueSize(int queueSize)
ScriptEngineConfiguration.UNBOUNDED_QUEUE_SIZE for no limit (in which case the maximum pool size option has no
effect). Once the core thread pool is at capacity then new script execution requests will be queued up to
this limit. Once this limit is reached, then additional threads will be created to service the queue, up to
the maximum queue size.queueSize - the maximum queue size or ScriptEngineConfiguration.UNBOUNDED_QUEUE_SIZE for no limit. Cannot be negative if
specified.public ScriptEngineConfiguration.Builder withThreadPoolIdleTimeout(long timeout, TimeUnit units)
timeout - the thread idle timeout.units - the time unit of the timeout.public ScriptEngineConfiguration build()
IllegalStateException - if inconsistent parameters have been specified.Copyright © 2010–2024 Open Identity Platform Community. All rights reserved.