Class hp.netstation.NETSTATIONProcess
java.lang.Object
|
+----java.lang.Process
|
+----hp.netstation.NETSTATIONProcess
- public class NETSTATIONProcess
- extends Process
- implements Runnable
The hp.netstation.NETSTATIONProcess class is a public class that extends
the abstract class java.lang.Process. This class allows a Java application
to spawn native Netstation processes (local clients).
HP-Specific Features
The hp.netstation.NETSTATIONProcess subclass behaves differently from the
java.lang.UNIXProcess subclass with regards to:
- stdout and stderr
Spawned processes stdout and stderr are sent to the
Netstation log instead of the Java application that spawned the process.
- stdin and process exit values
The Java application does not have access to the spawned local client'
stdin, nor the exit value of the spawned process.
Running the NETSTATIONProcess Class With or Without a Peer
Java applications can instantiate the hp.netstation.NETSTATIONProcess class
directly in either peered or non-peered mode:
- If you invoke the java.lang.Runtime#exec(variable)
with a peer, the java.lang.UNIXProcess class will be instantiated.
- If you invoke the java.lang.Runtime#exec(variable)
without a peer, the hp.netstation.NETSTATIONProcess class will be
instantiated.
- See Also:
- Process, getOutputStream, getInputStream, getErrorStream, exitValue, waitFor, exec, UNIXProcess
-
NETSTATIONProcess(String[], String[])
- execute a native HP Netstation process (local client) with the
specified environment variables.
-
destroy()
- Terminate the spawned process.
-
exitValue()
- HP Netstations do not currently support the ability to retrieve
exit values from spawned processes and so unless an exception is
thrown, 0 is always returned.
-
getErrorStream()
- HP Netstations do not currently support the ability to attach
to
stderr of the spawned local client and therefore this
method returns null.
-
getInputStream()
- HP Netstations do not currently support the ability to attach
to
stdin of the spawned local client and therefore this
method returns null.
-
getOutputStream()
- HP Netstations do not currently support the ability to attach
to
stdout of the spawned local client and therefore this
method returns null.
-
run()
-
-
waitFor()
- Waits for the subprocess to complete.
NETSTATIONProcess
public NETSTATIONProcess(String cmdarray[],
String env[]) throws IOException
- execute a native HP Netstation process (local client) with the
specified environment variables.
cmdarray[] is an array
of strings consisting of the local client to spawn and any arguments
that it may take. env[] is array of environment variable
assignments. env may NOT be null but may
be a single element array with a null string.
- Returns:
- NETSTATIONProcess
run
public native void run()
getOutputStream
public OutputStream getOutputStream()
- HP Netstations do not currently support the ability to attach
to
stdout of the spawned local client and therefore this
method returns null.
- Returns:
- null
- Overrides:
- getOutputStream in class Process
getInputStream
public InputStream getInputStream()
- HP Netstations do not currently support the ability to attach
to
stdin of the spawned local client and therefore this
method returns null.
- Returns:
- null
- Overrides:
- getInputStream in class Process
getErrorStream
public InputStream getErrorStream()
- HP Netstations do not currently support the ability to attach
to
stderr of the spawned local client and therefore this
method returns null.
- Returns:
- null
- Overrides:
- getErrorStream in class Process
waitFor
public synchronized int waitFor() throws InterruptedException
- Waits for the subprocess to complete. This method returns
immediately if the subprocess has already terminated. If the
subprocess has not yet terminated, the calling thread will be
blocked until the subprocess exits.
HP Netstations do not currently support the ability to retrieve
exit values from spawned processes and so unless an exception is
thrown, 0 is always returned.
- Returns:
- 0
- Throws: InterruptedException
- if the subprocess has not yet
terminated.
- Overrides:
- waitFor in class Process
exitValue
public synchronized int exitValue()
- HP Netstations do not currently support the ability to retrieve
exit values from spawned processes and so unless an exception is
thrown, 0 is always returned.
- Returns:
- 0
- Throws: IllegalThreadStateException
- if the subprocess has not yet
terminated.
- Overrides:
- exitValue in class Process
destroy
public native void destroy()
- Terminate the spawned process.
- Returns:
- void
- Overrides:
- destroy in class Process