Package org.apache.camel.processor

Examples of org.apache.camel.processor.DelegateProcessor


        }
    }

    protected Processor unwrapDelegateProcessor(Processor processor) {
        if (processor instanceof DelegateProcessor) {
            DelegateProcessor delegate = (DelegateProcessor) processor;
            return delegate.getProcessor();
        } else {
            return processor;
        }
    }
View Full Code Here


            // MUST DO THIS
            // force id creation as sub nodes have lazy assigned ids
            definition.idOrCreate(context.getNodeIdFactory());

            return new DelegateProcessor(target) {
                @Override
                protected void processNext(Exchange exchange) throws Exception {
                    LOG.debug("Debugging at: " + definition.toString() + " with id: " + definition.getId() + " with exchange: " + exchange);

                    // record the path taken at runtime
View Full Code Here

    public boolean supportTransacted() {
        return false;
    }

    public Processor createErrorHandler(RouteContext routeContext, Processor processor) throws Exception {
        return new DelegateProcessor(processor) {
            @Override
            public void process(Exchange exchange) throws Exception {
                exchange.setProperty(PROPERTY_NAME, beanName);
                super.process(exchange);
            }
View Full Code Here

                SpringTransactionPolicy notsupported = new SpringTransactionPolicy(lookup("PROPAGATION_NOT_SUPPORTED", TransactionTemplate.class));
                SpringTransactionPolicy requirenew = new SpringTransactionPolicy(lookup("PROPAGATION_REQUIRES_NEW", TransactionTemplate.class));

                Policy rollback = new Policy() {
                    public Processor wrap(RouteContext routeContext, Processor processor) {
                        return new DelegateProcessor(processor) {
                            @Override
                            public void process(Exchange exchange) throws Exception {
                                processNext(exchange);
                                throw new RuntimeException("rollback");
                            }

                            @Override
                            public String toString() {
                                return "rollback(" + getProcessor() + ")";
                            }
                        };
                    }
                };

                Policy catchRollback = new Policy() {
                    public Processor wrap(RouteContext routeContext, Processor processor) {
                        return new DelegateProcessor(processor) {
                            @Override
                            public void process(Exchange exchange) {
                                try {
                                    processNext(exchange);
                                } catch (Throwable ignore) {
View Full Code Here

    public boolean supportTransacted() {
        return false;
    }

    public Processor createErrorHandler(RouteContext routeContext, Processor processor) throws Exception {
        return new DelegateProcessor(processor) {
            @Override
            public void process(Exchange exchange) throws Exception {
                exchange.setProperty(PROPERTY_NAME, beanName);
                super.process(exchange);
            }
View Full Code Here

            assertSendToProcessor(unwrapChannel(endpoints.get(1)).getNextProcessor(), "seda://b");
        }
    }

    protected List<Route> buildRouteWithInterceptor() throws Exception {
        interceptor1 = new DelegateProcessor() {
        };

        // START SNIPPET: e7
        interceptor2 = new MyInterceptorProcessor();
View Full Code Here

        }
    }

    protected Processor unwrapDelegateProcessor(Processor processor) {
        if (processor instanceof DelegateProcessor) {
            DelegateProcessor delegate = (DelegateProcessor) processor;
            return delegate.getProcessor();
        } else {
            return processor;
        }
    }
View Full Code Here

            // MUST DO THIS
            // force id creation as sub nodes have lazy assigned ids
            definition.idOrCreate(context.getNodeIdFactory());

            return new DelegateProcessor(target) {
                @Override
                protected void processNext(Exchange exchange) throws Exception {
                    LOG.debug("Debugging at: " + definition.toString() + " with id: " + definition.getId() + " with exchange: " + exchange);

                    // record the path taken at runtime
View Full Code Here

        answer.beanName = beanName;
        return answer;
    }

    public Processor createErrorHandler(RouteContext routeContext, Processor processor) throws Exception {
        return new DelegateProcessor(processor) {
            @Override
            public void process(Exchange exchange) throws Exception {
                exchange.setProperty(PROPERTY_NAME, beanName);
                super.process(exchange);
            }
View Full Code Here

                SpringTransactionPolicy notsupported = new SpringTransactionPolicy(lookup("PROPAGATION_NOT_SUPPORTED", TransactionTemplate.class));
                SpringTransactionPolicy requirenew = new SpringTransactionPolicy(lookup("PROPAGATION_REQUIRES_NEW", TransactionTemplate.class));

                Policy rollback = new Policy() {
                    public Processor wrap(RouteContext routeContext, Processor processor) {
                        return new DelegateProcessor(processor) {
                            @Override
                            public void process(Exchange exchange) throws Exception {
                                processNext(exchange);
                                throw new RuntimeException("rollback");
                            }

                            @Override
                            public String toString() {
                                return "rollback(" + getProcessor() + ")";
                            }
                        };
                    }
                };

                Policy catchRollback = new Policy() {
                    public Processor wrap(RouteContext routeContext, Processor processor) {
                        return new DelegateProcessor(processor) {
                            @Override
                            public void process(Exchange exchange) {
                                try {
                                    processNext(exchange);
                                } catch (Throwable ignore) {
View Full Code Here

TOP

Related Classes of org.apache.camel.processor.DelegateProcessor

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.