|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--org.opennms.bb.dp.actiond.components.ActionExec
Each ActionExec thread is responsible for starting a command through a call to the Runtime.Exec() method and waiting for it to complete. When the command completes result and exit/failure values are set which may be retrieved via the getcmdxxx() methods. On Win32 environments, at attempt is made to convert common numeric Win32 API error codes into meaningful failure text.
Field Summary | |
static int |
CMD_EXIT_VALUE_UNKNOWN
|
static int |
CMD_RESULT_FAIL
|
static int |
CMD_RESULT_SUCCESS
|
static int |
CMD_RESULT_UNKNOWN
|
private ActionLauncher |
m_actionLauncher
Reference to the parent object which started this thread. |
private int |
m_cmdExecutionResult
Value which indicates the result of the Runtime.exec() call to start the command. |
private int |
m_cmdExitValue
If m_cmdExecutionResult is set to CMD_RESULT_SUCCESS, then this variable will contain the exit code of the process as returned by Process.exitValue() call. |
private String |
m_cmdFailureText
If m_cmdExecutionResult is set to CMD_RESULT_FAIL then this String will contain the reason for the failure. |
private String |
m_command
Command to be executed. |
private static String |
m_osName
Operating system identifier string. |
private static int |
WIN32_ERROR_ACCESS_DENIED
|
private static int |
WIN32_ERROR_BAD_EXE_FORMAT
|
private static int |
WIN32_ERROR_FILE_NOT_FOUND
|
private static int |
WIN32_ERROR_PATH_NOT_FOUND
|
private static String |
WIN32_TEXT_ACCESS_DENIED
|
private static String |
WIN32_TEXT_BAD_EXE_FORMAT
|
private static String |
WIN32_TEXT_FILE_NOT_FOUND
|
private static String |
WIN32_TEXT_PATH_NOT_FOUND
|
Fields inherited from class java.lang.Thread |
contextClassLoader, daemon, eetop, group, inheritableThreadLocals, inheritedAccessControlContext, MAX_PRIORITY, MIN_PRIORITY, name, NORM_PRIORITY, priority, single_step, stillborn, stopThreadPermission, target, threadInitNumber, threadLocals, threadQ |
Constructor Summary | |
ActionExec(String command,
ActionLauncher actionLauncher)
Constructs the ActionExec thread |
Method Summary | |
(package private) static void |
|
int |
getCmdExitValue()
Get the command exit value. |
String |
getCmdFailureText()
Get the command failure text. |
int |
getCmdResult()
Get the command execution result code which indicates the success or failure of starting an external process/command. |
void |
run()
Does the work of actually starting a separate process to execute the command. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, exit, getContextClassLoader, getName, getPriority, getThreadGroup, init, interrupt, interrupt0, interrupted, isAlive, isDaemon, isInterrupted, isInterrupted, join, join, join, nextThreadNum, registerNatives, resume, resume0, setContextClassLoader, setDaemon, setName, setPriority, setPriority0, sleep, sleep, start, stop, stop, stop0, suspend, suspend0, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int CMD_RESULT_UNKNOWN
public static final int CMD_RESULT_SUCCESS
public static final int CMD_RESULT_FAIL
public static final int CMD_EXIT_VALUE_UNKNOWN
private static final int WIN32_ERROR_FILE_NOT_FOUND
private static final int WIN32_ERROR_PATH_NOT_FOUND
private static final int WIN32_ERROR_ACCESS_DENIED
private static final int WIN32_ERROR_BAD_EXE_FORMAT
private static final String WIN32_TEXT_FILE_NOT_FOUND
private static final String WIN32_TEXT_PATH_NOT_FOUND
private static final String WIN32_TEXT_ACCESS_DENIED
private static final String WIN32_TEXT_BAD_EXE_FORMAT
private int m_cmdExecutionResult
private int m_cmdExitValue
private String m_cmdFailureText
private String m_command
private ActionLauncher m_actionLauncher
private static String m_osName
Constructor Detail |
public ActionExec(String command, ActionLauncher actionLauncher)
command
- Command string to be executedactionLauncher
- ActionLauncher object to be notified when command completesMethod Detail |
static void()
public void run()
run
in class Thread
public int getCmdResult()
public int getCmdExitValue()
public String getCmdFailureText()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |