Package org.apache.camel.spi
Interface Policy
-
- All Known Subinterfaces:
AuthorizationPolicy,TransactedPolicy
public interface PolicyA strategy capable of applying interceptors to a processor. Its strongly advised to use anAsyncProcessoras the returned wrappedProcessorwhich ensures the policy works well with the asynchronous routing engine. You can use theorg.apache.camel.processor.DelegateAsyncProcessorto easily return anAsyncProcessorand override theAsyncProcessor.process(org.apache.camel.Exchange, org.apache.camel.AsyncCallback)to implement your interceptor logic. And just invoke the super method to continue routing. Mind that not all frameworks supports asynchronous routing, for example some transaction managers, such as Spring Transaction uses the current thread to store state of the transaction, and thus can't transfer this state to other threads when routing continues asynchronously.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidbeforeWrap(Route route, NamedNode definition)Hook invoked before the wrap.Processorwrap(Route route, Processor processor)Wraps any applicable interceptors around the given processor.
-