public void beforeWrap(RouteContext routeContext, ProcessorDefinition<?> definition) {
//Not implemented
}
public Processor wrap(RouteContext routeContext, final Processor processor) {
return new AsyncProcessor() {
public boolean process(Exchange exchange, final AsyncCallback callback) {
boolean sync;
try {
applySecurityPolicy(exchange);
} catch (Exception e) {
// exception occurred so break out
exchange.setException(e);
callback.done(true);
return true;
}
// If here, then user is authenticated and authorized
// Now let the original processor continue routing supporting the async routing engine
AsyncProcessor ap = AsyncProcessorConverterHelper.convert(processor);
sync = AsyncProcessorHelper.process(ap, exchange, new AsyncCallback() {
public void done(boolean doneSync) {
// we only have to handle async completion of this policy
if (doneSync) {
return;