Class DefaultExecBinding
java.lang.Object
org.apache.camel.component.exec.impl.DefaultExecBinding
- All Implemented Interfaces:
ExecBinding
Default implementation of
ExecBinding
.-
Field Summary
Fields inherited from interface org.apache.camel.component.exec.ExecBinding
EXEC_COMMAND_ARGS, EXEC_COMMAND_EXECUTABLE, EXEC_COMMAND_EXIT_VALUES, EXEC_COMMAND_LOG_LEVEL, EXEC_COMMAND_OUT_FILE, EXEC_COMMAND_TIMEOUT, EXEC_COMMAND_WORKING_DIR, EXEC_EXIT_VALUE, EXEC_STDERR, EXEC_USE_STDERR_ON_EMPTY_STDOUT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected <T> T
getAndRemoveHeader
(org.apache.camel.Message message, String headerName, T defaultValue, Class<T> headerType) Gets and removes theheaderName
header form the inputmessage
(the header will not be propagated)readInput
(org.apache.camel.Exchange exchange, ExecEndpoint endpoint) void
writeOutput
(org.apache.camel.Exchange exchange, ExecResult result) Populates the exchange form theExecResult
.protected void
writeOutputInMessage
(org.apache.camel.Message message, ExecResult result) Write theExecResult
in the message body.
-
Constructor Details
-
DefaultExecBinding
public DefaultExecBinding()
-
-
Method Details
-
readInput
Description copied from interface:ExecBinding
- Specified by:
readInput
in interfaceExecBinding
- Parameters:
exchange
- a CamelExchange
endpoint
- anExecEndpoint
instance- Returns:
- an
ExecCommand
object - See Also:
-
writeOutput
Description copied from interface:ExecBinding
Populates the exchange form theExecResult
.- Specified by:
writeOutput
in interfaceExecBinding
- Parameters:
exchange
- a CamelExchange
, in which to write theresult
result
- the result of a command execution- See Also:
-
writeOutputInMessage
Write theExecResult
in the message body. Write the stderr and the exit value for convenience in the message headers.
The stdout and/or resultFile should be accessible using a converter or using the result object directly.- Parameters:
message
- a Camel messageresult
- anExecResult
instance
-
getAndRemoveHeader
protected <T> T getAndRemoveHeader(org.apache.camel.Message message, String headerName, T defaultValue, Class<T> headerType) Gets and removes theheaderName
header form the inputmessage
(the header will not be propagated)
-