Package org.eclipse.ease
Class AbstractReplScriptEngine
java.lang.Object
org.eclipse.core.runtime.PlatformObject
org.eclipse.core.internal.jobs.InternalJob
org.eclipse.core.runtime.jobs.Job
org.eclipse.ease.AbstractScriptEngine
org.eclipse.ease.AbstractReplScriptEngine
- All Implemented Interfaces:
Comparable<org.eclipse.core.internal.jobs.InternalJob>
,org.eclipse.core.runtime.IAdaptable
,IReplEngine
,IScriptEngine
- Direct Known Subclasses:
JythonScriptEngine
,NashornScriptEngine
,Py4jScriptEngine
,RhinoScriptEngine
Adds generic REPL support to the AbstractScriptEngine.
-
Field Summary
Fields inherited from class org.eclipse.core.runtime.jobs.Job
ASYNC_FINISH, BUILD, DECORATE, INTERACTIVE, LONG, NONE, RUNNING, SHORT, SLEEPING, WAITING
Fields inherited from interface org.eclipse.ease.IScriptEngine
TRACE_SCRIPT_ENGINE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet variables defined on the top level scope of the script engine.Get the result of the last script execution.boolean
Get termination condition when engine is idle.Get type information on a given script object.final void
setTerminateOnIdle
(boolean terminate) Set a marker that the interpreter should terminate instead entering IDLE mode.void
Terminate this interpreter.Get the String representation of a script object.Methods inherited from class org.eclipse.ease.AbstractScriptEngine
addExecutionListener, addSecurityCheck, execute, getCurrentScriptEngine, getDescription, getErrorStream, getExecutedFile, getInputStream, getLaunch, getOutputStream, getStackTrace, getVariable, getVariables, hasVariable, inject, isFinished, joinEngine, joinEngine, removeExecutionListener, setCloseStreamsOnTerminate, setEngineDescription, setErrorStream, setExecutionRootFile, setInputStream, setLaunch, setOutputStream, setVariable
Methods inherited from class org.eclipse.core.runtime.jobs.Job
addJobChangeListener, belongsTo, cancel, create, create, createSystem, createSystem, done, getJobGroup, getJobManager, getName, getPriority, getProperty, getResult, getRule, getState, getThread, isBlocking, isSystem, isUser, join, join, removeJobChangeListener, schedule, schedule, setJobGroup, setName, setPriority, setProgressGroup, setProperty, setRule, setSystem, setThread, setUser, shouldRun, shouldSchedule, sleep, toString, wakeUp, wakeUp, yieldRule
Methods inherited from class org.eclipse.core.internal.jobs.InternalJob
compareTo
Methods inherited from class org.eclipse.core.runtime.PlatformObject
getAdapter
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.ease.IScriptEngine
addExecutionListener, addSecurityCheck, execute, getDescription, getErrorStream, getExecutedFile, getInputStream, getLaunch, getName, getOutputStream, getVariable, getVariables, hasVariable, inject, isFinished, joinEngine, joinEngine, registerJar, removeExecutionListener, schedule, setCloseStreamsOnTerminate, setErrorStream, setInputStream, setOutputStream, setVariable, terminateCurrent
-
Constructor Details
-
AbstractReplScriptEngine
Constructor. Sets the name for the underlying job.- Parameters:
name
- name of script engine job
-
-
Method Details
-
setTerminateOnIdle
public final void setTerminateOnIdle(boolean terminate) Description copied from interface:IReplEngine
Set a marker that the interpreter should terminate instead entering IDLE mode. If set, the interpreter will execute all pending requests and terminate afterwards.- Specified by:
setTerminateOnIdle
in interfaceIReplEngine
- Parameters:
terminate
-true
to request termination
-
getTerminateOnIdle
public boolean getTerminateOnIdle()Description copied from interface:IReplEngine
Get termination condition when engine is idle.- Specified by:
getTerminateOnIdle
in interfaceIReplEngine
- Returns:
true
when engine is terminated when idle
-
terminate
public void terminate()Description copied from interface:IScriptEngine
Terminate this interpreter. Addresses a request to terminate current script execution. When the request will be handled is implementation specific.- Specified by:
terminate
in interfaceIScriptEngine
- Overrides:
terminate
in classAbstractScriptEngine
-
getDefinedVariables
Description copied from interface:IReplEngine
Get variables defined on the top level scope of the script engine.- Specified by:
getDefinedVariables
in interfaceIReplEngine
- Returns:
- defined variables
-
getType
Description copied from interface:IReplEngine
Get type information on a given script object.- Specified by:
getType
in interfaceIReplEngine
- Parameters:
object
- object to inspect- Returns:
- object type
-
toString
Description copied from interface:IReplEngine
Get the String representation of a script object. A script object can be an execution result or a variable content.- Specified by:
toString
in interfaceIReplEngine
- Parameters:
object
- script object- Returns:
- String representation
-
getLastExecutionResult
Description copied from interface:IReplEngine
Get the result of the last script execution.- Specified by:
getLastExecutionResult
in interfaceIReplEngine
- Returns:
- script result of last execution
-