|
Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.jbo.server.util.SafeExec
Executes a subprocess in a separate thread, and monitors the executing subprocess. The output can be captured and redirected to a stream. Also, the subprocess is given a finite amount of time to complete, and will be forcibly terminated if it doesn't complete within the timeout. This class is used by the BC4J test framework to deal with errant tests that don't terminate, but it is a standalone utility that can be used anywhere.
Field Summary | |
static int |
DEFAULT_TIMEOUT
default timeout in seconds if nothing else specified |
static int |
ERROR_COULD_NOT_EXEC
|
static int |
ERROR_TIMED_OUT
error code to use if the process times out |
static java.lang.String |
HLINE
|
static java.lang.String |
PROP_DIAGNOSTICS
|
static java.lang.String |
PROP_TIMEOUT
|
Constructor Summary | |
SafeExec()
|
Method Summary | |
static long |
getTimeoutMillis()
|
static void |
main(java.lang.String[] args)
execute runProc |
static int |
monitorProc(java.lang.Process proc,
java.io.PrintStream logConsole,
long timeout)
Given a running process, monitor its progress, and time it out after timeout ms. |
static int |
runProc(java.lang.String[] args,
java.io.PrintStream logConsole)
|
static int |
runProc(java.lang.String[] args,
java.io.PrintStream logConsole,
long timeout)
Execute a subprocess defined by the contents of 'args'. |
static int |
runProc(java.lang.String cmdline,
java.io.PrintStream logConsole)
|
static int |
runProc(java.lang.String cmdline,
java.io.PrintStream logConsole,
long timeout)
Execute a subprocess defined by the contents of 'cmdline' |
static void |
traceln(java.lang.String message)
|
static void |
Usage()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String PROP_TIMEOUT
public static final java.lang.String PROP_DIAGNOSTICS
public static final java.lang.String HLINE
public static final int ERROR_TIMED_OUT
public static final int ERROR_COULD_NOT_EXEC
public static final int DEFAULT_TIMEOUT
Constructor Detail |
public SafeExec()
Method Detail |
public static long getTimeoutMillis()
public static void main(java.lang.String[] args)
public static int runProc(java.lang.String[] args, java.io.PrintStream logConsole, long timeout)
public static int runProc(java.lang.String cmdline, java.io.PrintStream logConsole, long timeout)
public static int monitorProc(java.lang.Process proc, java.io.PrintStream logConsole, long timeout)
public static int runProc(java.lang.String[] args, java.io.PrintStream logConsole)
public static int runProc(java.lang.String cmdline, java.io.PrintStream logConsole)
public static void traceln(java.lang.String message)
public static void Usage()
|
Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.