public class OsCommandAction extends ForkProcessAction
This class defines the following keys:
os
- The possible general values for the Operating System can
be "all", "windows", "unix". Or the value can be more
specific to a particular Windows platform or unix platform
such as "Windows 95", "Windows 98", "Windows NT",
"Windows 2000", "Solaris". These values should EXACTLY
match the value returned by the System property "os.name"
when called from Java.
command
- The command to execute. It should be absolute path,
if it points to an executable or script etc.
This key is mandatory. If it is not passes then the
action will not run anything.
Modifier and Type | Field and Description |
---|---|
static String |
ALL_OS
Value for the key "os".
|
static String |
COMMAND_KEY |
static String |
OS_KEY |
static String |
UNIX_OS
Value for the key "os".
|
static String |
WINDOWS_OS
Value for the key "os".
|
LOG_KEY, m_log, TIMEOUT_KEY
CONTINUE_ON_ERROR, m_defaultOptions, m_options
APPEND_LOG, DATABASE_TYPE, DATABASE_URL, DB_USER_NAME, DB_USER_PASSWORD, DOMAIN_TYPE, ENABLE_SSL_SUPPORT, FOR_SCHEMA_UPGRADE, IFS_DOMAIN_DISPLAY_NAME, IFS_DOMAIN_NAME, IFS_SCHEMA_NAME, IFS_SCHEMA_PASSWORD, IFS_SERVICE_NAME, IFS_USER_NAME, IFS_USER_PASSWORD, INCLUDE_PATH, INITIAL_CONTEXT_FACTORY, LDAP_URL_DAS_LOOKUP, LDAP_USER_NAME, LDAP_USER_PASSWORD, OUTPUT_FILE, PARAMETER_FILE, REGISTRY, SCHEMA_VERSION_KEY, SECURITY_PROTOCOL_NAME, SERVICE_CONFIGURATION_NAME
Constructor and Description |
---|
OsCommandAction() |
Modifier and Type | Method and Description |
---|---|
protected String |
getCommand()
Returns the OS command that should be invoked as an external process.
|
protected void |
processDestroyed(StringWriter out,
StringWriter err)
Invoked when the external process was destroyed by this Action, due to a
timeout, an interrupt from another Thread, or other exceptional conditions.
|
protected void |
processFinished(int code,
StringWriter out,
StringWriter err)
Invoked when the external process has finished on its own.
|
failed, perform, stop
getDescription, getName, getValue, isContinueOnError, isPostgres, putValue, setDefaultOptions, setDescription, setName, setOptions
public static final String OS_KEY
public static final String COMMAND_KEY
public static final String ALL_OS
public static final String WINDOWS_OS
public static final String UNIX_OS
protected String getCommand()
getCommand
in class ForkProcessAction
protected void processFinished(int code, StringWriter out, StringWriter err) throws ActionFailedException
ForkProcessAction
Note: subclasses may override this method; it has an empty implementation.
Note: subclasses may decide (based on the output from the process or the exit code) that the process did not finish successfully. In this case, the subclass may throw an ActionFailedException to notify that the action has in fact failed, even though the external process finished.
processFinished
in class ForkProcessAction
code
- the exit code returned by the Process.out
- a closed StringWriter with stdout output from the Process.err
- a closed StringWriter with stderr output form the Process.ActionFailedException
- if the process finished but was not
considered (by the action implementing this method) a
successful execution; thus the action has failed.protected void processDestroyed(StringWriter out, StringWriter err)
ForkProcessAction
processDestroyed
in class ForkProcessAction
out
- a closed StringWriter with stdout output from the Process.err
- a closed StringWriter with stderr output form the Process.Copyright © 2023. All rights reserved.