TPTP 4.6.0 Platform Project
Public API Specification

org.eclipse.hyades.execution.core.impl
Class ProcessExecutorImpl

java.lang.Object
  extended by org.eclipse.hyades.execution.core.impl.ExecutionComponentImpl
      extended by org.eclipse.hyades.execution.core.impl.ProcessExecutorImpl
All Implemented Interfaces:
IExecutionComponent, IExecutor, IProcessConsole

public class ProcessExecutorImpl
extends ExecutionComponentImpl
implements IProcessConsole, IExecutor


Field Summary
 
Fields inherited from interface org.eclipse.hyades.execution.core.IExecutor
CONTROL_EVENT_RESUME, CONTROL_EVENT_SUSPEND
 
Fields inherited from interface org.eclipse.hyades.execution.core.IExecutionComponent
DEAD, INACTIVE, NOT_CONFIGURED, READY, SUSPENDED
 
Constructor Summary
ProcessExecutorImpl()
           
ProcessExecutorImpl(java.lang.String _name)
           
 
Method Summary
 IExecutableObject getCompatibleExecutableObject(java.lang.String classname)
          Returns an empty instance of an IExecutableObject that is compatible with this IExecutor.
 IExecutableObject getExecutableObject()
           
 java.lang.String getPid()
          Return the process id of the started process
 IProcessConsole getProcessConsole()
          Get the process console associated with the current executor
 int getProcessStatus(int pid)
          Get the process status
 java.io.InputStream getStandardErrorStream()
          Get the InputStream for reading from the process's stderr pipe.
 java.io.OutputStream getStandardInputStream()
          Get the OutputStream for writing to the process's stdin pipe.
 java.io.InputStream getStandardOutputStream()
          Get the InputStream for reading from the process's stdout pipe.
 void init()
          Initialization routine.
 void kill()
          Kill the active process (invoking a JNI call)
 void launch()
          Launch the process and start the console handlers threads.
 java.lang.String performControlEvent(java.lang.String controlEvent, java.lang.String[] params)
          Performs the control event specified.
 void setExecutableObject(IExecutableObject obj)
          Set the executable object for launch
 boolean supportsControlEvent(java.lang.String controlEvent)
          Returns a boolean specifying whether the control event specified is supported.
 
Methods inherited from class org.eclipse.hyades.execution.core.impl.ExecutionComponentImpl
addChild, addExecutionComponentStateChangeListener, fireStateChangeEvent, getChildById, getChildByName, getChildren, getId, getName, getNode, getParent, getState, getType, getVersion, handleMessage, removeChild, removeExecutionComponentStateChangeListener, sendMessage, setParent
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.hyades.execution.core.IExecutionComponent
addChild, addExecutionComponentStateChangeListener, fireStateChangeEvent, getChildById, getChildByName, getChildren, getId, getName, getNode, getParent, getState, getType, getVersion, handleMessage, removeChild, removeExecutionComponentStateChangeListener, sendMessage, setParent
 

Constructor Detail

ProcessExecutorImpl

public ProcessExecutorImpl()

ProcessExecutorImpl

public ProcessExecutorImpl(java.lang.String _name)
Method Detail

init

public void init()
Initialization routine.

Specified by:
init in interface IExecutionComponent
Overrides:
init in class ExecutionComponentImpl
See Also:
IExecutionComponent.init()

setExecutableObject

public void setExecutableObject(IExecutableObject obj)
Set the executable object for launch

Specified by:
setExecutableObject in interface IExecutor
Parameters:
obj - IExecutableObject

getExecutableObject

public IExecutableObject getExecutableObject()
Specified by:
getExecutableObject in interface IExecutor
See Also:
IExecutor.getExecutableObject()

launch

public void launch()
Launch the process and start the console handlers threads.

Specified by:
launch in interface IExecutor

kill

public void kill()
Kill the active process (invoking a JNI call)

Specified by:
kill in interface IExecutor

getStandardInputStream

public java.io.OutputStream getStandardInputStream()
                                            throws ExecutionComponentStateException
Get the OutputStream for writing to the process's stdin pipe. It is available after process is launched.

Specified by:
getStandardInputStream in interface IProcessConsole
Returns:
OutputStream
Throws:
ExecutionComponentStateException

getStandardOutputStream

public java.io.InputStream getStandardOutputStream()
                                            throws ExecutionComponentStateException
Get the InputStream for reading from the process's stdout pipe. It is available after process is launched.

Specified by:
getStandardOutputStream in interface IProcessConsole
Returns:
InputStream
Throws:
ExecutionComponentStateException

getStandardErrorStream

public java.io.InputStream getStandardErrorStream()
                                           throws ExecutionComponentStateException
Get the InputStream for reading from the process's stderr pipe. It is available after process is launched.

Specified by:
getStandardErrorStream in interface IProcessConsole
Returns:
InputStream
Throws:
ExecutionComponentStateException

getPid

public java.lang.String getPid()
Return the process id of the started process

Returns:
int

getProcessStatus

public int getProcessStatus(int pid)
Get the process status

Parameters:
pid -
Returns:
int

getProcessConsole

public IProcessConsole getProcessConsole()
Get the process console associated with the current executor

Specified by:
getProcessConsole in interface IExecutor
Returns:
IProcessConsole

getCompatibleExecutableObject

public IExecutableObject getCompatibleExecutableObject(java.lang.String classname)
                                                throws java.lang.ClassNotFoundException
Description copied from interface: IExecutor
Returns an empty instance of an IExecutableObject that is compatible with this IExecutor.

Issue: Do we want this to be the ExecutableObject (thus replacing the setExecutableObject() method), and if so, how do we know when to pass the object across the wire (since the IExecutor doing the real work won't be the same instance of IExecutor that contains this IExecutableObject.)

Specified by:
getCompatibleExecutableObject in interface IExecutor
Returns:
an empty instance of a compatible IExecutableObject.
Throws:
java.lang.ClassNotFoundException
See Also:
org.eclipse.hyades.execution.core.IExecutor.getCompatibleExecutableObject()

supportsControlEvent

public boolean supportsControlEvent(java.lang.String controlEvent)
Description copied from interface: IExecutor
Returns a boolean specifying whether the control event specified is supported.

Specified by:
supportsControlEvent in interface IExecutor
Parameters:
controlEvent - Contol Event in question.
Returns:
Specifies whether the control event is supported.

performControlEvent

public java.lang.String performControlEvent(java.lang.String controlEvent,
                                            java.lang.String[] params)
Description copied from interface: IExecutor
Performs the control event specified.

Specified by:
performControlEvent in interface IExecutor
Parameters:
controlEvent - Contol Event to perform.
Returns:
Error Message if error occurred. Otherwise null.

TPTP 4.6.0 Platform Project
Public API Specification