Class DefaultExecBinding
- java.lang.Object
-
- org.apache.camel.component.exec.impl.DefaultExecBinding
-
- All Implemented Interfaces:
ExecBinding
public class DefaultExecBinding extends Object implements ExecBinding
Default implementation ofExecBinding
.
-
-
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
Constructors Constructor Description DefaultExecBinding()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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)ExecCommand
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.
-
-
-
Method Detail
-
readInput
public ExecCommand readInput(org.apache.camel.Exchange exchange, ExecEndpoint endpoint)
Description copied from interface:ExecBinding
- Specified by:
readInput
in interfaceExecBinding
- Parameters:
exchange
- a CamelExchange
endpoint
- anExecEndpoint
instance- Returns:
- an
ExecCommand
object - See Also:
ExecCommandExecutor
-
writeOutput
public void writeOutput(org.apache.camel.Exchange exchange, ExecResult result)
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:
ExecCommandExecutor
-
writeOutputInMessage
protected void writeOutputInMessage(org.apache.camel.Message message, ExecResult result)
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
-
-