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.runtime.IAdaptable,IReplEngine,IScriptEngine
- Direct Known Subclasses:
JythonScriptEngine,NashornScriptEngine,Py4jScriptEngine,RhinoScriptEngine
public abstract class AbstractReplScriptEngine extends AbstractScriptEngine implements IReplEngine
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, WAITINGFields inherited from interface org.eclipse.ease.IScriptEngine
TRACE_SCRIPT_ENGINE -
Constructor Summary
Constructors Constructor Description AbstractReplScriptEngine(String name)Constructor. -
Method Summary
Modifier and Type Method Description Collection<EaseDebugVariable>getDefinedVariables()Get variables defined on the top level scope of the script engine.EaseDebugVariablegetLastExecutionResult()Get the result of the last script execution.booleangetTerminateOnIdle()Get termination condition when engine is idle.ScriptObjectTypegetType(Object object)Get type information on a given script object.voidsetTerminateOnIdle(boolean terminate)Set a marker that the interpreter should terminate instead entering IDLE mode.voidterminate()Terminate this interpreter.StringtoString(Object object)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, getMonitor, getOutputStream, getStackTrace, getVariable, getVariables, hasVariable, inject, isFinished, joinEngine, joinEngine, removeExecutionListener, setCloseStreamsOnTerminate, setEngineDescription, setErrorStream, setExecutionRootFile, setInputStream, setLaunch, setOutputStream, setVariableMethods 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, yieldRuleMethods inherited from class org.eclipse.core.internal.jobs.InternalJob
compareToMethods inherited from class org.eclipse.core.runtime.PlatformObject
getAdapterMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.ease.IScriptEngine
addExecutionListener, addSecurityCheck, execute, getDescription, getErrorStream, getExecutedFile, getInputStream, getLaunch, getMonitor, 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:IReplEngineSet 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:
setTerminateOnIdlein interfaceIReplEngine- Parameters:
terminate-trueto request termination
-
getTerminateOnIdle
public boolean getTerminateOnIdle()Description copied from interface:IReplEngineGet termination condition when engine is idle.- Specified by:
getTerminateOnIdlein interfaceIReplEngine- Returns:
truewhen engine is terminated when idle
-
terminate
public void terminate()Description copied from interface:IScriptEngineTerminate this interpreter. Addresses a request to terminate current script execution. When the request will be handled is implementation specific.- Specified by:
terminatein interfaceIScriptEngine- Overrides:
terminatein classAbstractScriptEngine
-
getDefinedVariables
Description copied from interface:IReplEngineGet variables defined on the top level scope of the script engine.- Specified by:
getDefinedVariablesin interfaceIReplEngine- Returns:
- defined variables
-
getType
Description copied from interface:IReplEngineGet type information on a given script object.- Specified by:
getTypein interfaceIReplEngine- Parameters:
object- object to inspect- Returns:
- object type
-
toString
Description copied from interface:IReplEngineGet the String representation of a script object. A script object can be an execution result or a variable content.- Specified by:
toStringin interfaceIReplEngine- Parameters:
object- script object- Returns:
- String representation
-
getLastExecutionResult
Description copied from interface:IReplEngineGet the result of the last script execution.- Specified by:
getLastExecutionResultin interfaceIReplEngine- Returns:
- script result of last execution
-