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> 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)ExecCommandreadInput(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.
-
-
-
Method Detail
-
readInput
public ExecCommand readInput(org.apache.camel.Exchange exchange, ExecEndpoint endpoint)
Description copied from interface:ExecBinding- Specified by:
readInputin interfaceExecBinding- Parameters:
exchange- a CamelExchangeendpoint- anExecEndpointinstance- Returns:
- an
ExecCommandobject - See Also:
ExecCommandExecutor
-
writeOutput
public void writeOutput(org.apache.camel.Exchange exchange, ExecResult result)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:
ExecCommandExecutor
-
writeOutputInMessage
protected void writeOutputInMessage(org.apache.camel.Message message, ExecResult result)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
-
-