|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
com.Prominic.runtime.DefaultNProcess
public class DefaultNProcess
java.lang.Process wrapper Creation date: (8/14/2001 10:45:55 AM)
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
private java.util.Vector |
listeners
|
private java.lang.Process |
process
|
private boolean |
running
|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
DefaultNProcess()
Create a new DefaultNProcess object. |
|
DefaultNProcess(java.lang.Process process)
Create a new DefaultJProcess wrapper object around the specified process. |
Method Summary | |
---|---|
void |
addProcessEventListener(ProcessEventListener listener)
Add a new ProcessEventListener to this process. |
void |
destroy()
Kill the spawned process. |
protected void |
dispatch(ProcessEvent event)
Dispatch the specified process event to all listeners. |
int |
exitValue()
Return the process exit value. |
java.io.InputStream |
getErrorStream()
Return a stream to the stderr of the spawned process. |
java.io.InputStream |
getInputStream()
Return a reference to the stdout of the spawned process. |
protected java.util.Vector |
getListeners()
Return the list of listeners of this process. |
java.io.OutputStream |
getOutputStream()
Return a reference to process' stdin stream. |
int |
getPid()
Return the pid of the spawned process. |
protected java.lang.Process |
getProcess()
Returns the reference to the process object. |
boolean |
isRunning()
Returns true if this thread is still doing something. |
void |
removeProcessEventListener(ProcessEventListener listener)
Removes the specified ProcessEventListener from the listeners list associated to this process. |
void |
run()
Waits for the process to finish. |
protected void |
setListeners(java.util.Vector newListeners)
Set the vector of ProcessEventListeners. |
protected void |
setProcess(java.lang.Process newProcess)
Creation date: (8/14/2001 10:48:29 AM) |
void |
signal(int signal)
Send a signal to the spawned process. |
void |
waitFor()
Wait for the spawned process to finish. |
void |
waitFor(long time)
Wait for this process to finish executing. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.lang.Process process
private java.util.Vector listeners
private boolean running
Constructor Detail |
---|
public DefaultNProcess()
public DefaultNProcess(java.lang.Process process)
process
- java.lang.Process;Method Detail |
---|
public void addProcessEventListener(ProcessEventListener listener) throws java.lang.IllegalThreadStateException
addProcessEventListener
in interface NProcess
listener
- com.Prominic.jdi.spawning.ProcessEventListener
java.lang.IllegalThreadStateException
public void destroy()
destroy
in interface NProcess
destroy
in class java.lang.Thread
protected void dispatch(ProcessEvent event)
event
- com.Prominic.jdi.spawning.ProcessEventpublic int exitValue() throws java.lang.IllegalThreadStateException
exitValue
in interface NProcess
java.io.IOException.
java.lang.IllegalThreadStateException
public java.io.InputStream getErrorStream() throws java.io.IOException
getErrorStream
in interface NProcess
java.io.IOException.
java.io.IOException
- The exception description.public java.io.InputStream getInputStream() throws java.io.IOException
getInputStream
in interface NProcess
java.io.IOException
protected java.util.Vector getListeners()
public java.io.OutputStream getOutputStream() throws java.io.IOException
getOutputStream
in interface NProcess
java.io.IOException
public int getPid() throws java.lang.IllegalThreadStateException
getPid
in interface NProcess
java.lang.IllegalThreadStateException
- If the process is still running.protected java.lang.Process getProcess()
public boolean isRunning()
isRunning
in interface NProcess
public void removeProcessEventListener(ProcessEventListener listener)
removeProcessEventListener
in interface NProcess
listener
- com.Prominic.jdi.spawning.ProcessEventListenerpublic void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
protected void setListeners(java.util.Vector newListeners)
newListeners
- java.util.Vectorprotected void setProcess(java.lang.Process newProcess)
newProcess
- java.lang.Processpublic void signal(int signal) throws java.io.IOException
signal
in interface NProcess
signal
- int
java.io.IOException
public void waitFor() throws java.lang.InterruptedException
waitFor
in interface NProcess
java.lang.InterruptedException
- If the thread is interrupted.public void waitFor(long time) throws java.lang.InterruptedException
waitFor
in interface NProcess
time
- int
java.lang.InterruptedException
- If the thread is interrupted.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |