Package org.apache.camel.spi

Examples of org.apache.camel.spi.TraceableUnitOfWork


        return exchange.getExchangeId().substring(exchange.getExchangeId().indexOf("/") + 1);
    }

    private String extractPreviousNode(Exchange exchange) {
        if (exchange.getUnitOfWork() instanceof TraceableUnitOfWork) {
            TraceableUnitOfWork tuow = (TraceableUnitOfWork) exchange.getUnitOfWork();
            ProcessorDefinition last = tuow.getLastInterceptedNode();
            return last != null ? extractNode(last) : null;
        }
        return null;
    }
View Full Code Here


        }

        // compute from and to
        String from = "";
        if (showNode && exchange.getUnitOfWork() instanceof TraceableUnitOfWork) {
            TraceableUnitOfWork tuow = (TraceableUnitOfWork) exchange.getUnitOfWork();
            ProcessorDefinition prev = tuow.getLastInterceptedNode();
            if (prev != null) {
                from = getNodeMessage(prev);
            } else if (exchange.getFromEndpoint() != null) {
                from = exchange.getFromEndpoint().getEndpointUri();
            }
View Full Code Here

    // START SNIPPET: e2
    private class MyErrorProcessor implements Processor {
        public void process(Exchange exchange) throws Exception {
            // cast to TraceableUnitOfWork so we can work on the intercepted node path
            TraceableUnitOfWork tuow = (TraceableUnitOfWork) exchange.getUnitOfWork();

            // get the list of intercepted nodes
            List<ProcessorDefinition> list = tuow.getInterceptedNodes();
            // get the 2nd last as the last is me (MyErrorProcessor)
            ProcessorDefinition last = list.get(list.size() - 2);

            // set error message
            exchange.getFault().setBody("Failed at: " + last.getLabel());
View Full Code Here

                logExchange(exchange);
                traceExchange(exchange);

                // if traceable then register this as the previous node, now it has been logged
                if (exchange.getUnitOfWork() instanceof TraceableUnitOfWork) {
                    TraceableUnitOfWork tuow = (TraceableUnitOfWork) exchange.getUnitOfWork();
                    tuow.addInterceptedNode(node);
                }
            }

            // process the exchange
            super.proceed(exchange);
View Full Code Here

TOP

Related Classes of org.apache.camel.spi.TraceableUnitOfWork

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.