Interface CamelInternalProcessorAdvice<T>

  • Type Parameters:
    T -

    public interface CamelInternalProcessorAdvice<T>
    An advice (before and after) to execute cross cutting functionality in the Camel routing engine.

    The Camel routing engine will execute the before(org.apache.camel.Exchange) and after(org.apache.camel.Exchange, Object) methods during routing in correct order.

    See Also:
    org.apache.camel.processor.CamelInternalProcessor
    • Method Detail

      • before

        T before​(Exchange exchange)
          throws Exception
        Callback executed before processing a step in the route.
        Parameters:
        exchange - the current exchange
        Returns:
        any state to keep and provide as data to the after(org.apache.camel.Exchange, Object) method, or use null for no state.
        Throws:
        Exception - is thrown if error during the call.
      • after

        void after​(Exchange exchange,
                   T data)
            throws Exception
        Callback executed after processing a step in the route.
        Parameters:
        exchange - the current exchange
        data - the state, if any, returned in the before(org.apache.camel.Exchange) method.
        Throws:
        Exception - is thrown if error during the call.
      • hasState

        default boolean hasState()
        Whether this advice has state or not.