Package org.apache.camel.processor.interceptor

Examples of org.apache.camel.processor.interceptor.Tracer


        initPropertyPlaceholder();

        // setup JMX agent at first
        initJMXAgent();

        Tracer tracer = getBeanForType(Tracer.class);
        if (tracer != null) {
            // use formatter if there is a TraceFormatter bean defined
            TraceFormatter formatter = getBeanForType(TraceFormatter.class);
            if (formatter != null) {
                tracer.setFormatter(formatter);
            }
            LOG.info("Using custom Tracer: " + tracer);
            getContext().addInterceptStrategy(tracer);
        }
        BacklogTracer backlogTracer = getBeanForType(BacklogTracer.class);
View Full Code Here


    }

    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            public void configure() throws Exception {
                Tracer tracer = new Tracer();
                tracer.setLogLevel(LoggingLevel.FATAL);
                tracer.setLogName("com.mycompany");

                getContext().addInterceptStrategy(tracer);

                from("direct:start").to("mock:result");
            }
View Full Code Here

        Debugger debugger = getBeanForType(Debugger.class);
        if (debugger != null) {
            getContext().addInterceptStrategy(debugger);
        }

        Tracer tracer = getBeanForType(Tracer.class);
        if (tracer != null) {
            // use formatter if there is a TraceFormatter bean defined
            TraceFormatter formatter = getBeanForType(TraceFormatter.class);
            if (formatter != null) {
                tracer.setFormatter(formatter);
            }
            getContext().addInterceptStrategy(tracer);
        }

        Delayer delayer = getBeanForType(Delayer.class);
View Full Code Here

    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            public void configure() throws Exception {
                // START SNIPPET: tracingOutExchanges
                Tracer tracer = new Tracer();
                tracer.setTraceOutExchanges(true);
                tracer.getFormatter().setShowOutBody(true);
                tracer.getFormatter().setShowOutBodyType(true);
               
                getContext().addInterceptStrategy(tracer);
                // END SNIPPET: tracingOutExchanges
               
                from("direct:start").
View Full Code Here

    @EndpointInject(uri = "mock:resultEndpoint")
    protected MockEndpoint resultEndpoint;

    public void testMocksAreValidWithTracerEnabled() throws Exception {
        assertNotNull(camelContext);
        Tracer tracer = Tracer.getTracer(camelContext);
        assertNotNull(tracer);
        assertTrue("The tracer should be enabled", tracer.isEnabled());
        validMockes();
    }
View Full Code Here

        validMockes();
    }

    public void testMocksAreValidWithTracerDisabled() throws Exception {
        assertNotNull(camelContext);
        Tracer tracer = Tracer.getTracer(camelContext);
        assertNotNull(tracer);
        tracer.setEnabled(false);
        validMockes();
    }
View Full Code Here

    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            public void configure() throws Exception {
                // add tracer as an interceptor so it will log the exchange executions at runtime
                // this can aid us to understand/see how the exchanges is routed etc.
                getContext().addInterceptStrategy(new Tracer());

                from("direct:start").
                        process(new Processor() {
                            public void process(Exchange exchange) throws Exception {
                                // do nothing
View Full Code Here

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            public void configure() throws Exception {
                getContext().addInterceptStrategy(new Tracer());

                from("timer://kickoff?period=9999910000").
                    setHeader("id").constant("foo").setBody().constant("a b c").
                    splitter(body().tokenize(" ")).to("seda:splitted");
View Full Code Here

        LOG.info("Apache Camel " + getVersion() + " (CamelContext:" + getName() + ") is starting");

        if (getTrace()) {
            // only add a new tracer if not already configued
            if (Tracer.getTracer(this) == null) {
                Tracer tracer = new Tracer();
                // lets see if we have a formatter if so use it
                TraceFormatter formatter = this.getRegistry().lookup("traceFormatter", TraceFormatter.class);
                if (formatter != null) {
                    tracer.setFormatter(formatter);
                }
                addInterceptStrategy(tracer);
            }
        }
View Full Code Here

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            public void configure() {
                getContext().addInterceptStrategy(new Tracer());
                from("timer://foo?fixedRate=true&delay=0&period=500").to("bean:myBean");
            }
        };
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.processor.interceptor.Tracer

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.