public final class ScriptEngineDriver
extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ScriptEngineDriver.CompileTask
Compile task.
|
static class |
ScriptEngineDriver.EvalTask
Eval task.
|
static class |
ScriptEngineDriver.ExecuteException
Execute exception.
|
static class |
ScriptEngineDriver.Task
Task.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_ENGINE_NAME
Default engine name.
|
| Modifier and Type | Method and Description |
|---|---|
void |
bind(Map<String,Object> bindings)
Binds all from additional bindings.
|
void |
bind(String key,
Object value)
Binds a key to a value.
|
Optional<Object> |
bound(String key)
Returns the bound value for a key.
|
ScriptEngineFactory |
getEngineFactory()
Gets the script engine.
|
boolean |
isRunning()
Asks if running.
|
static ScriptEngineDriver |
newInstance(Optional<String> optionalEngineName)
Returns a new instance.
|
void |
start(String threadName)
Starts the background thread.
|
void |
stop()
Stops the background thread.
|
boolean |
submit(ScriptEngineDriver.Task task)
Submits a task.
|
void |
unbind(Map<String,Object> bindings)
Unbinds all from additional bindings.
|
void |
unbind(String key)
Unbinds a key.
|
public static final String DEFAULT_ENGINE_NAME
@Nullable @CheckReturnValue public static ScriptEngineDriver newInstance(@Nonnull Optional<String> optionalEngineName)
optionalEngineName - The optional engine name.public void bind(@Nonnull
Map<String,Object> bindings)
bindings - The bindings to be added.public void bind(@Nonnull
String key,
@Nonnull
Object value)
key - The key.value - The value.@Nonnull
@CheckReturnValue
public Optional<Object> bound(@Nonnull
String key)
key - The key.@Nonnull @CheckReturnValue public ScriptEngineFactory getEngineFactory()
@CheckReturnValue public boolean isRunning()
public void start(@Nonnull
String threadName)
threadName - The name of the thread.public void stop()
@CheckReturnValue
public boolean submit(@Nonnull
ScriptEngineDriver.Task task)
task - The task.public void unbind(@Nonnull
Map<String,Object> bindings)
bindings - The bindings to be removed.public void unbind(@Nonnull
String key)
key - The key.Copyright © 2003-2019 Serge Brisson. All Rights Reserved.