|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.Prominic.runtime.UnixProcess
public class UnixProcess
An unix process. It contains a lot of native methods. To used this class the libunixruntime.so must be in LD_LIBRARY_PATH. The class was tested on linux, aix and solaris machine Creation date: (8/13/2001 2:40:35 PM)
Field Summary | |
---|---|
private boolean |
canNotAllocateSharedMemory
|
private boolean |
canNotExecute
|
private boolean |
canNotMakeFork
|
private int |
errorCode
|
private int |
exitCode
|
private int |
gid
|
private java.util.Vector |
listeners
|
static int |
MAX_PROCESSES
|
private java.lang.String[] |
param
|
private int |
pid
|
private boolean |
running
|
private boolean |
setGidError
|
private boolean |
setUidError
|
private int |
signal
|
private java.lang.String |
stderrfilename
|
private java.lang.String |
stdinfilename
|
private java.lang.String |
stdoutfilename
|
private int |
uid
|
Constructor Summary | |
---|---|
UnixProcess()
Insert the method's description here. |
|
UnixProcess(int uid,
int gid,
java.lang.String cmd)
Create and start an unix process specified by command. |
|
UnixProcess(int uid,
int gid,
java.lang.String[] cmd)
Create and start an unix process specified by command. |
|
UnixProcess(int uid,
int gid,
java.lang.String[] cmd,
java.lang.String stdoutfilename,
java.lang.String stderrfilename,
java.lang.String stdinfilename)
Create and start an unix process specified by command. |
|
UnixProcess(int uid,
int gid,
java.lang.String cmd,
java.lang.String stdoutfilename,
java.lang.String stderrfilename,
java.lang.String stdinfilename)
Create and start an unix process specified by command. |
|
UnixProcess(int uid,
java.lang.String cmd)
Create and start an unix process specified by command. |
|
UnixProcess(int uid,
java.lang.String[] cmd)
Create and start an unix process specified by command. |
|
UnixProcess(int uid,
java.lang.String[] cmd,
java.lang.String stdoutfilename,
java.lang.String stderrfilename,
java.lang.String stdinfilename)
Create and start an unix process specified by command. |
|
UnixProcess(int uid,
java.lang.String cmd,
java.lang.String stdoutfilename,
java.lang.String stderrfilename,
java.lang.String stdinfilename)
Create and start an unix process specified by command. |
|
UnixProcess(java.lang.String cmd)
Create and start an unix process specified by command. |
|
UnixProcess(java.lang.String[] cmd)
Create and start an unix process specified by command. |
|
UnixProcess(java.lang.String[] cmd,
java.lang.String stdoutfilename,
java.lang.String stderrfilename,
java.lang.String stdinfilename)
Create and start an unix process specified by command. |
|
UnixProcess(java.lang.String cmd,
java.lang.String stdoutfilename,
java.lang.String stderrfilename,
java.lang.String stdinfilename)
Create and start an unix process specified by command. |
Method Summary | |
---|---|
void |
addProcessEventListener(ProcessEventListener listener)
Insert the method's description here. |
void |
destroy()
Stoped the process. |
protected void |
dispatch(ProcessEvent event)
Insert the method's description here. |
private int |
exec(int uid,
int gid,
java.lang.String[] cmd,
java.lang.String stdoutfilename,
java.lang.String stderrfilename,
java.lang.String stdinfilename)
Starts unix process specified by command. |
int |
exitValue()
Returns exit code if the process is stoped Creation date: (8/19/2001 2:42:38 PM) |
void |
finalize()
Insert the method's description here. |
protected java.util.Vector |
getListeners()
Insert the method's description here. |
protected int |
getPid()
Insert the method's description here. |
java.lang.String |
getStderrFilename()
Returns the process error file name Creation date: (8/19/2001 2:42:38 PM) |
java.lang.String |
getStdinFilename()
Returns the process input file name Creation date: (8/19/2001 2:42:38 PM) |
java.lang.String |
getStdoutFilename()
Returns the process ouput file name Creation date: (8/19/2001 2:42:38 PM) |
boolean |
isRunning()
Tells if the process is running or no. |
private void |
processDied(int status)
Insert the method's description here. |
private static void |
processDied(int pid,
int status)
Insert the method's description here. |
void |
removeProcessEventListener(ProcessEventListener listener)
Insert the method's description here. |
void |
run()
The thread start method. |
protected void |
setListeners(java.util.Vector newListeners)
Insert the method's description here. |
void |
waitFor()
Insert the method's description here. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MAX_PROCESSES
private boolean running
private int exitCode
private boolean canNotExecute
private boolean canNotMakeFork
private boolean canNotAllocateSharedMemory
private boolean setUidError
private boolean setGidError
private int errorCode
private int pid
private int signal
private java.lang.String[] param
private java.lang.String stdoutfilename
private java.lang.String stderrfilename
private java.lang.String stdinfilename
private int gid
private int uid
private java.util.Vector listeners
Constructor Detail |
---|
public UnixProcess()
public UnixProcess(java.lang.String[] cmd)
cmd
- java.lang.String[] The commandpublic UnixProcess(java.lang.String[] cmd, java.lang.String stdoutfilename, java.lang.String stderrfilename, java.lang.String stdinfilename)
cmd
- java.lang.String[] The commandstdoutfilename
- java.lang.String The output filename for the processstderrfilename
- java.lang.String The error filename for the processstdinfilename
- java.lang.String The input filename for the processpublic UnixProcess(int uid, java.lang.String[] cmd)
uid
- int The process will be start by the user specified by its uidcmd
- java.lang.String[] The commandpublic UnixProcess(int uid, java.lang.String[] cmd, java.lang.String stdoutfilename, java.lang.String stderrfilename, java.lang.String stdinfilename)
uid
- int The process will be start by the user specified by its uidcmd
- java.lang.String[] The commandstdoutfilename
- java.lang.String The output filename for the processstderrfilename
- java.lang.String The error filename for the processstdinfilename
- java.lang.String The input filename for the processpublic UnixProcess(int uid, int gid, java.lang.String[] cmd)
uid
- int The process will be start by the user specified by its uidgid
- int The process will be start by the group specified by its gidcmd
- java.lang.String[] The commandpublic UnixProcess(int uid, int gid, java.lang.String[] cmd, java.lang.String stdoutfilename, java.lang.String stderrfilename, java.lang.String stdinfilename)
uid
- int The process will be start by the user specified by its uidgid
- int The process will be start by the group specified by its gidcmd
- java.lang.String[] The commandstdoutfilename
- java.lang.String The output filename for the processstderrfilename
- java.lang.String The error filename for the processstdinfilename
- java.lang.String The input filename for the processpublic UnixProcess(int uid, int gid, java.lang.String cmd)
uid
- int The process will be start by the user specified by its uidgid
- int The process will be start by the group specified by its gidcmd
- java.lang.String The commandpublic UnixProcess(int uid, int gid, java.lang.String cmd, java.lang.String stdoutfilename, java.lang.String stderrfilename, java.lang.String stdinfilename)
uid
- int The process will be start by the user specified by its uidgid
- int The process will be start by the group specified by its gidcmd
- java.lang.String The commandstdoutfilename
- java.lang.String The output filename for the processstderrfilename
- java.lang.String The error filename for the processstdinfilename
- java.lang.String The input filename for the processpublic UnixProcess(int uid, java.lang.String cmd)
uid
- int The process will be start by the user specified by its uidcmd
- java.lang.String The commandpublic UnixProcess(int uid, java.lang.String cmd, java.lang.String stdoutfilename, java.lang.String stderrfilename, java.lang.String stdinfilename)
uid
- int The process will be start by the user specified by its uidcmd
- java.lang.String The commandstdoutfilename
- java.lang.String The output filename for the processstderrfilename
- java.lang.String The error filename for the processstdinfilename
- java.lang.String The input filename for the processpublic UnixProcess(java.lang.String cmd)
cmd
- java.lang.String The commandpublic UnixProcess(java.lang.String cmd, java.lang.String stdoutfilename, java.lang.String stderrfilename, java.lang.String stdinfilename)
cmd
- java.lang.String The commandstdoutfilename
- java.lang.String The output filename for the processstderrfilename
- java.lang.String The error filename for the processstdinfilename
- java.lang.String The input filename for the processMethod Detail |
---|
public void addProcessEventListener(ProcessEventListener listener) throws java.lang.IllegalThreadStateException
listener
- com.Prominic.runtime.ProcessEventListener
java.lang.IllegalThreadStateException
- The exception description.public void destroy()
protected void dispatch(ProcessEvent event)
event
- com.Prominic.runtime.ProcessEventprivate int exec(int uid, int gid, java.lang.String[] cmd, java.lang.String stdoutfilename, java.lang.String stderrfilename, java.lang.String stdinfilename)
uid
- int The process will be start by the user specified by its uidgid
- int The process will be start by the group specified by its gidcmd
- java.lang.String[] The commandstdoutfilename
- java.lang.String The output filename for the processstderrfilename
- java.lang.String The error filename for the processstdinfilename
- java.lang.String The input filename for the processpublic int exitValue() throws java.lang.IllegalThreadStateException, java.lang.InterruptedException, java.io.IOException, java.io.FileNotFoundException, java.lang.SecurityException, UnixRuntimeException
java.lang.IllegalThreadStateException
java.lang.InterruptedException
java.io.IOException
java.io.FileNotFoundException
java.lang.SecurityException
UnixRuntimeException
public void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
- The exception description.protected java.util.Vector getListeners()
protected int getPid()
public java.lang.String getStderrFilename()
public java.lang.String getStdinFilename()
public java.lang.String getStdoutFilename()
public boolean isRunning()
private void processDied(int status)
status
- intprivate static void processDied(int pid, int status)
status
- intpublic void removeProcessEventListener(ProcessEventListener listener)
listener
- com.Prominic.runtime.ProcessEventListenerpublic void run()
run
in interface java.lang.Runnable
protected void setListeners(java.util.Vector newListeners)
newListeners
- java.util.Vectorpublic void waitFor() throws java.lang.InterruptedException
java.lang.InterruptedException
- The exception description.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |