Examples of InterceptStrategy


Examples of org.apache.camel.spi.InterceptStrategy

                    continue;
                } else {
                    // replace existing delayer as delayer have individual configuration
                    Iterator<InterceptStrategy> it = channel.getInterceptStrategies().iterator();
                    while (it.hasNext()) {
                        InterceptStrategy existing = it.next();
                        if (existing instanceof Delayer) {
                            it.remove();
                        }
                    }
                    // add the new correct delayer
View Full Code Here

Examples of org.apache.camel.spi.InterceptStrategy

                    continue;
                } else {
                    // replace existing delayer as delayer have individual configuration
                    Iterator<InterceptStrategy> it = channel.getInterceptStrategies().iterator();
                    while (it.hasNext()) {
                        InterceptStrategy existing = it.next();
                        if (existing instanceof Delayer) {
                            it.remove();
                        }
                    }
                    // add the new correct delayer
View Full Code Here

Examples of org.apache.camel.spi.InterceptStrategy

        }
        // add global interceptors
        Map<String, InterceptStrategy> interceptStrategies = getContext().getRegistry().findByTypeWithName(InterceptStrategy.class);
        if (interceptStrategies != null && !interceptStrategies.isEmpty()) {
            for (Entry<String, InterceptStrategy> entry : interceptStrategies.entrySet()) {
                InterceptStrategy strategy = entry.getValue();
                // do not add if already added, for instance a tracer that is also an InterceptStrategy class
                if (!getContext().getInterceptStrategies().contains(strategy)) {
                    LOG.info("Using custom InterceptStrategy with id: {} and implementation: {}", entry.getKey(), strategy);
                    getContext().addInterceptStrategy(strategy);
                }
View Full Code Here

Examples of org.apache.camel.spi.InterceptStrategy

        // force the creation of an id
        RouteDefinitionHelper.forceAssignIds(routeContext.getCamelContext(), definition);

        // first wrap the output with the managed strategy if any
        InterceptStrategy managed = routeContext.getManagedInterceptStrategy();
        if (managed != null) {
            next = target == nextProcessor ? null : nextProcessor;
            target = managed.wrapProcessorInInterceptors(routeContext.getCamelContext(), targetOutputDef, target, next);
        }

        // then wrap the output with the backlog and tracer (backlog first, as we do not want regular tracer to tracer the backlog)
        InterceptStrategy tracer = getOrCreateBacklogTracer();
        camelContext.addService(tracer);
        if (tracer instanceof BacklogTracer) {
            BacklogTracer backlogTracer = (BacklogTracer) tracer;

            RouteDefinition route = ProcessorDefinitionHelper.getRoute(definition);
            boolean first = false;
            if (route != null && !route.getOutputs().isEmpty()) {
                first = route.getOutputs().get(0) == definition;
            }

            addAdvice(new BacklogTracerAdvice(backlogTracer.getQueue(), backlogTracer, targetOutputDef, route, first));

            // add debugger as well so we have both tracing and debugging out of the box
            InterceptStrategy debugger = getOrCreateBacklogDebugger();
            camelContext.addService(debugger);
            if (debugger instanceof BacklogDebugger) {
                BacklogDebugger backlogDebugger = (BacklogDebugger) debugger;
                addAdvice(new BacklogDebuggerAdvice(backlogDebugger, target, targetOutputDef));
            }
View Full Code Here

Examples of org.apache.camel.spi.InterceptStrategy

        // only use tracer if explicit enabled
        if (camelContext.isTracing() != null && !camelContext.isTracing()) {
            return null;
        }

        InterceptStrategy tracer = Tracer.getTracer(camelContext);
        if (tracer == null) {
            if (camelContext.getRegistry() != null) {
                // lookup in registry
                Map<String, Tracer> map = camelContext.getRegistry().findByTypeWithName(Tracer.class);
                if (map.size() == 1) {
View Full Code Here

Examples of org.apache.camel.spi.InterceptStrategy

        return tracer;
    }

    private InterceptStrategy getOrCreateBacklogTracer() {
        InterceptStrategy tracer = BacklogTracer.getBacklogTracer(camelContext);
        if (tracer == null) {
            if (camelContext.getRegistry() != null) {
                // lookup in registry
                Map<String, BacklogTracer> map = camelContext.getRegistry().findByTypeWithName(BacklogTracer.class);
                if (map.size() == 1) {
View Full Code Here

Examples of org.apache.camel.spi.InterceptStrategy

        return tracer;
    }

    private InterceptStrategy getOrCreateBacklogDebugger() {
        InterceptStrategy debugger = BacklogDebugger.getBacklogDebugger(camelContext);
        if (debugger == null) {
            if (camelContext.getRegistry() != null) {
                // lookup in registry
                Map<String, BacklogDebugger> map = camelContext.getRegistry().findByTypeWithName(BacklogDebugger.class);
                if (map.size() == 1) {
View Full Code Here

Examples of org.apache.camel.spi.InterceptStrategy

        }
        // add global interceptors
        Map<String, InterceptStrategy> interceptStrategies = getContext().getRegistry().findByTypeWithName(InterceptStrategy.class);
        if (interceptStrategies != null && !interceptStrategies.isEmpty()) {
            for (Entry<String, InterceptStrategy> entry : interceptStrategies.entrySet()) {
                InterceptStrategy strategy = entry.getValue();
                // do not add if already added, for instance a tracer that is also an InterceptStrategy class
                if (!getContext().getInterceptStrategies().contains(strategy)) {
                    LOG.info("Using custom InterceptStrategy with id: {} and implementation: {}", entry.getKey(), strategy);
                    getContext().addInterceptStrategy(strategy);
                }
View Full Code Here

Examples of org.apache.camel.spi.InterceptStrategy

                    continue;
                } else {
                    // replace existing delayer as delayer have individual configuration
                    Iterator<InterceptStrategy> it = channel.getInterceptStrategies().iterator();
                    while (it.hasNext()) {
                        InterceptStrategy existing = it.next();
                        if (existing instanceof Delayer) {
                            it.remove();
                        }
                    }
                    // add the new correct delayer
View Full Code Here

Examples of org.apache.camel.spi.InterceptStrategy

        }
        // add global interceptors
        Map<String, InterceptStrategy> interceptStrategies = getContext().getRegistry().findByTypeWithName(InterceptStrategy.class);
        if (interceptStrategies != null && !interceptStrategies.isEmpty()) {
            for (Entry<String, InterceptStrategy> entry : interceptStrategies.entrySet()) {
                InterceptStrategy strategy = entry.getValue();
                // do not add if already added, for instance a tracer that is also an InterceptStrategy class
                if (!getContext().getInterceptStrategies().contains(strategy)) {
                    LOG.info("Using custom InterceptStrategy with id: " + entry.getKey() + " and implementation: " + strategy);
                    getContext().addInterceptStrategy(strategy);
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.