02/28/2005
 

com.epicentric.common
Class Command

java.lang.Object
  |
  +--com.epicentric.common.Command
All Implemented Interfaces:
Runnable

Deprecated. as of version 4.5, to be removed in 8.0 or later.

public class Command
extends Object
implements Runnable

Wrapper around Runtime.exec() that handles reading the output from the other process, etc.


Field Summary
static int TIMEOUT
          Deprecated. How long to wait before giving up on a command (milliseconds).
 
Constructor Summary
Command(String[] argsArray)
          Deprecated. Create command and start it running.
Command(Vector argsVector)
          Deprecated.  
 
Method Summary
 void dumpResult(PrintWriter out)
          Deprecated. Print the results of the command to an output stream (for debugging).
 String[] getArgs()
          Deprecated. Get arguments used to start the command
 String getErrorOutput()
          Deprecated. Get stderr from the command.
 int getExitValue()
          Deprecated. Get the command's exit value.
static String getIPAddress()
          Deprecated. helper to retrieve the systems IP Address
static String getMACAddress()
          Deprecated. Retrieves the MAC Address (Hardware address) from the system.
 String getOutput()
          Deprecated. Get stdout from the command.
static boolean isMacintosh()
          Deprecated.  
static boolean isOS2()
          Deprecated.  
static boolean isWindows()
          Deprecated.  
static void main(String[] args)
          Deprecated.  
 void println(String line)
          Deprecated. Send a line of text to the command's input stream.
 void run()
          Deprecated.  
 boolean waitFor(long timeoutInMillis)
          Deprecated. Wait for the command to finish.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TIMEOUT

public static final int TIMEOUT
Deprecated. 
How long to wait before giving up on a command (milliseconds).
Constructor Detail

Command

public Command(String[] argsArray)
        throws IOException,
               InterruptedException
Deprecated. 
Create command and start it running.

Command

public Command(Vector argsVector)
        throws IOException,
               InterruptedException
Deprecated. 
Method Detail

println

public void println(String line)
Deprecated. 
Send a line of text to the command's input stream.

waitFor

public boolean waitFor(long timeoutInMillis)
                throws InterruptedException,
                       IOException
Deprecated. 
Wait for the command to finish. Note: the Sun JDK sends a end-of-file to stdin but jview does not, so the process needs to explicitly be told to exit.
Returns:
true if the process has exited. (False means the process is hung.)

getArgs

public String[] getArgs()
Deprecated. 
Get arguments used to start the command

getOutput

public String getOutput()
Deprecated. 
Get stdout from the command.

getErrorOutput

public String getErrorOutput()
Deprecated. 
Get stderr from the command.

getExitValue

public int getExitValue()
Deprecated. 
Get the command's exit value.

dumpResult

public void dumpResult(PrintWriter out)
Deprecated. 
Print the results of the command to an output stream (for debugging).

run

public void run()
Deprecated. 
Specified by:
run in interface Runnable

isWindows

public static boolean isWindows()
Deprecated. 

isMacintosh

public static boolean isMacintosh()
Deprecated. 

isOS2

public static boolean isOS2()
Deprecated. 

getMACAddress

public static String getMACAddress()
Deprecated. 
Retrieves the MAC Address (Hardware address) from the system. If multiple NIC cards are present, there is no guarantee as to which address will be returned. This method works (in most cases) on Windows, Solaris, HPUX, LINUX, and AIX assuming some standard commands are available at the command line. The commands required are as follows:

- Windows: "ipconfig /all"
- Solaris: "/usr/sbin/arp ip_address"
- HPUX: "/usr/sbin/lanscan -a"
- LINUX: "/sbin/ifconfig"
- AIX: "/bin/entstat en0"
For AIX, it is also assumed that a NIC card exists at /dev/en0.


getIPAddress

public static String getIPAddress()
Deprecated. 
helper to retrieve the systems IP Address

main

public static void main(String[] args)
Deprecated. 

02/28/2005
 

Copyright and Trademark Notices