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 of ExecBinding.
See Also:
  • Constructor Details

    • DefaultExecBinding

      public DefaultExecBinding()
  • Method Details

    • readInput

      public ExecCommand readInput(org.apache.camel.Exchange exchange, ExecEndpoint endpoint)
      Description copied from interface: ExecBinding
      Creates a ExecCommand from the headers in the exchange and the settings of the endpoint.
      Specified by:
      readInput in interface ExecBinding
      Parameters:
      exchange - a Camel Exchange
      endpoint - an ExecEndpoint instance
      Returns:
      an ExecCommand object
      See Also:
    • writeOutput

      public void writeOutput(org.apache.camel.Exchange exchange, ExecResult result)
      Description copied from interface: ExecBinding
      Populates the exchange form the ExecResult.
      Specified by:
      writeOutput in interface ExecBinding
      Parameters:
      exchange - a Camel Exchange, in which to write the result
      result - the result of a command execution
      See Also:
    • writeOutputInMessage

      protected void writeOutputInMessage(org.apache.camel.Message message, ExecResult result)
      Write the ExecResult 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 message
      result - an ExecResult instance
    • getAndRemoveHeader

      protected <T> T getAndRemoveHeader(org.apache.camel.Message message, String headerName, T defaultValue, Class<T> headerType)
      Gets and removes the headerName header form the input message (the header will not be propagated)