Package org.apache.camel.component.exec
Interface ExecBinding
-
- All Known Implementing Classes:
DefaultExecBinding
public interface ExecBindingRepresents the binding of input and output types of aExecCommandExecutorto anExchange. The input of the executor is anExecCommandand the output is anExecResult.
-
-
Field Summary
Fields Modifier and Type Field Description static StringEXEC_COMMAND_ARGSThe header value overrides the existing command arguments in theExecEndpointURI.static StringEXEC_COMMAND_EXECUTABLEThe header value overrides the executable of the command, configured in the exec endpoint URI.static StringEXEC_COMMAND_LOG_LEVELThe value of this header define logging level to be used for commands during execution.static StringEXEC_COMMAND_OUT_FILESpecifies the file name of a file, created by the executable, that should be considered as output of the executable, e.g.static StringEXEC_COMMAND_TIMEOUTSpecifies the amount of time, in milliseconds, after which the process of the executable should be terminated.static StringEXEC_COMMAND_WORKING_DIRSets the working directory of theEXEC_COMMAND_EXECUTABLE.static StringEXEC_EXIT_VALUEThe value of this header is the exit value that is returned, after the execution.static StringEXEC_STDERRThe value of this header is aInputStreamwith the standard error stream of the executable.static StringEXEC_USE_STDERR_ON_EMPTY_STDOUTThe value of this header is a boolean which indicates whether or not to fallback and use stderr when stdout is empty.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ExecCommandreadInput(org.apache.camel.Exchange exchange, ExecEndpoint endpoint)voidwriteOutput(org.apache.camel.Exchange exchange, ExecResult result)Populates the exchange form theExecResult.
-
-
-
Field Detail
-
EXEC_COMMAND_EXECUTABLE
static final String EXEC_COMMAND_EXECUTABLE
The header value overrides the executable of the command, configured in the exec endpoint URI. As executable is considered the remaining of theExecEndpointURI;
e.g. in the URIexec:C:/Program Files/jdk/java.exe,C:/Program Files/jdk/java.exeis the executable.- See Also:
- Constant Field Values
-
EXEC_COMMAND_ARGS
static final String EXEC_COMMAND_ARGS
The header value overrides the existing command arguments in theExecEndpointURI. The arguments may be aList. In this case no parsing of the arguments is necessary.- See Also:
- Constant Field Values
-
EXEC_COMMAND_OUT_FILE
static final String EXEC_COMMAND_OUT_FILE
Specifies the file name of a file, created by the executable, that should be considered as output of the executable, e.g. a log file.
-
EXEC_COMMAND_WORKING_DIR
static final String EXEC_COMMAND_WORKING_DIR
Sets the working directory of theEXEC_COMMAND_EXECUTABLE. The header value overrides any existing command in the endpoint URI. If this is not configured, the working directory of the current process will be used.- See Also:
- Constant Field Values
-
EXEC_COMMAND_TIMEOUT
static final String EXEC_COMMAND_TIMEOUT
Specifies the amount of time, in milliseconds, after which the process of the executable should be terminated. The default value isLong.MAX_VALUE.- See Also:
- Constant Field Values
-
EXEC_STDERR
static final String EXEC_STDERR
The value of this header is aInputStreamwith the standard error stream of the executable.- See Also:
- Constant Field Values
-
EXEC_EXIT_VALUE
static final String EXEC_EXIT_VALUE
The value of this header is the exit value that is returned, after the execution. By convention a non-zero status exit value indicates abnormal termination.
Note that the exit value is OS dependent.- See Also:
- Constant Field Values
-
EXEC_USE_STDERR_ON_EMPTY_STDOUT
static final String EXEC_USE_STDERR_ON_EMPTY_STDOUT
The value of this header is a boolean which indicates whether or not to fallback and use stderr when stdout is empty.- See Also:
- Constant Field Values
-
EXEC_COMMAND_LOG_LEVEL
static final String EXEC_COMMAND_LOG_LEVEL
The value of this header define logging level to be used for commands during execution. The default value is INFO. Possible values are TRACE, DEBUG, INFO, WARN, ERROR or OFF. (Values of LoggingLevel enum)- See Also:
- Constant Field Values
-
-
Method Detail
-
readInput
ExecCommand readInput(org.apache.camel.Exchange exchange, ExecEndpoint endpoint)
- Parameters:
exchange- a CamelExchangeendpoint- anExecEndpointinstance- Returns:
- an
ExecCommandobject - See Also:
ExecCommandExecutor
-
writeOutput
void writeOutput(org.apache.camel.Exchange exchange, ExecResult result)Populates the exchange form theExecResult.- Parameters:
exchange- a CamelExchange, in which to write theresultresult- the result of a command execution- See Also:
ExecCommandExecutor
-
-