Class DefaultExecBinding
java.lang.Object
org.apache.camel.component.exec.impl.DefaultExecBinding
- All Implemented Interfaces:
ExecBinding
Default implementation of
ExecBinding.- See Also:
-
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 -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> TgetAndRemoveHeader(org.apache.camel.Message message, String headerName, T defaultValue, Class<T> headerType) Gets and removes theheaderNameheader form the inputmessage(the header will not be propagated)readInput(org.apache.camel.Exchange exchange, ExecEndpoint endpoint) voidwriteOutput(org.apache.camel.Exchange exchange, ExecResult result) Populates the exchange form theExecResult.protected voidwriteOutputInMessage(org.apache.camel.Message message, ExecResult result) Write theExecResultin the message body.
-
Constructor Details
-
DefaultExecBinding
public DefaultExecBinding()
-
-
Method Details
-
readInput
Description copied from interface:ExecBinding- Specified by:
readInputin interfaceExecBinding- Parameters:
exchange- a CamelExchangeendpoint- anExecEndpointinstance- Returns:
- an
ExecCommandobject - See Also:
-
writeOutput
Description copied from interface:ExecBindingPopulates the exchange form theExecResult.- Specified by:
writeOutputin interfaceExecBinding- Parameters:
exchange- a CamelExchange, in which to write theresultresult- the result of a command execution- See Also:
-
writeOutputInMessage
Write theExecResultin 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- anExecResultinstance
-
getAndRemoveHeader
protected <T> T getAndRemoveHeader(org.apache.camel.Message message, String headerName, T defaultValue, Class<T> headerType) Gets and removes theheaderNameheader form the inputmessage(the header will not be propagated)
-