Package org.apache.camel.model

Examples of org.apache.camel.model.ModelCamelContext


     */
    private CamelContext aggregateCamelContext() throws Exception {
        if (camelContexts.size() == 1) {
            return camelContexts.get(0);
        } else {
            ModelCamelContext answer = new DefaultCamelContext();
            for (CamelContext camelContext : camelContexts) {
                answer.addRouteDefinitions(((ModelCamelContext)camelContext).getRouteDefinitions());
            }
            return answer;
        }
    }
View Full Code Here


     */
    private CamelContext aggregateCamelContext() throws Exception {
        if (camelContexts.size() == 1) {
            return camelContexts.get(0);
        } else {
            ModelCamelContext answer = new DefaultCamelContext();
            for (CamelContext camelContext : camelContexts) {
                answer.addRouteDefinitions(((ModelCamelContext)camelContext).getRouteDefinitions());
            }
            return answer;
        }
    }
View Full Code Here

public class CustomThreadPoolProfileRouteBuilder extends RouteBuilder {
    @Override
    public void configure() throws Exception {
        ThreadPoolProfile customThreadPoolProfile =
            new ThreadPoolProfileBuilder("customThreadPoolProfile").poolSize(5).maxQueueSize(100).build();
        ModelCamelContext context = getContext();
        context.getExecutorServiceManager().registerThreadPoolProfile(customThreadPoolProfile);

        from("direct:in")
            .log("Received ${body}:${threadName}")
            .threads().executorServiceRef("customThreadPoolProfile")
            .log("Processing ${body}:${threadName}")
View Full Code Here

     */
    private CamelContext aggregateCamelContext() throws Exception {
        if (camelContexts.size() == 1) {
            return camelContexts.get(0);
        } else {
            ModelCamelContext answer = new DefaultCamelContext();
            for (CamelContext camelContext : camelContexts) {
                answer.addRouteDefinitions(((ModelCamelContext)camelContext).getRouteDefinitions());
            }
            return answer;
        }
    }
View Full Code Here

        }
        return false;
    }

    public CamelContext createContext(Collection<RouteDefinition> routes) throws Exception {
        ModelCamelContext context = new DefaultCamelContext();
        context.addRouteDefinitions(routes);
        return context;
    }
View Full Code Here

     */
    private CamelContext aggregateCamelContext() throws Exception {
        if (camelContexts.size() == 1) {
            return camelContexts.get(0);
        } else {
            ModelCamelContext answer = new DefaultCamelContext();
            for (CamelContext camelContext : camelContexts) {
                answer.addRouteDefinitions(((ModelCamelContext)camelContext).getRouteDefinitions());
            }
            return answer;
        }
    }
View Full Code Here

            Set<String> configurationFileNames = effectiveProfile.getConfigurationFileNames();
            for (CamelContext camelContext : camelContexts.values()) {
                String camelContextID = camelContext.getName();
                // check we only add testing stuff to each context once
                if (camelContext instanceof ModelCamelContext) {
                    final ModelCamelContext modelCamelContext = (ModelCamelContext) camelContext;
                    List<RouteDefinition> routeDefinitions = modelCamelContext.getRouteDefinitions();
                    if (camelContextsConfigured.add(camelContextID)) {
                        NodeIdFactory nodeIdFactory = camelContext.getNodeIdFactory();

                        if (mockInputs || mockOutputs) {
                            for (RouteDefinition routeDefinition : routeDefinitions) {
                                String routeId = routeDefinition.idOrCreate(nodeIdFactory);
                                modelCamelContext.stopRoute(routeId);

                                final String routeKey = camelContextID + "." + routeId;
                                LOG.info("Mocking Camel route: " + routeKey);
                                routeDefinition.adviceWith(modelCamelContext, new AdviceWithRouteBuilder() {
                                    @Override
                                    public void configure() throws Exception {
                                        if (mockOutputs) {
                                            modelCamelContext.addRegisterEndpointCallback(strategy);
                                        }
                                    }
                                });
                                // the advised route is automatic restarted
                            }
View Full Code Here

        }
        return false;
    }

    public CamelContext createContext(Collection<RouteDefinition> routes) throws Exception {
        ModelCamelContext context = new DefaultCamelContext();
        context.addRouteDefinitions(routes);
        return context;
    }
View Full Code Here

    }
   
    // Properties
    // -----------------------------------------------------------------------
    public ModelCamelContext getContext() {
        ModelCamelContext context = super.getContext();
        if (context == null) {
            context = createContainer();
            setContext(context);
        }
        return context;
View Full Code Here

    // -----------------------------------------------------------------------
    @SuppressWarnings("deprecation")
    protected void checkInitialized() throws Exception {
        if (initialized.compareAndSet(false, true)) {
            // Set the CamelContext ErrorHandler here
            ModelCamelContext camelContext = getContext();
            if (camelContext.getErrorHandlerBuilder() != null) {
                setErrorHandlerBuilder(camelContext.getErrorHandlerBuilder());
            }
            configure();
            // mark all route definitions as custom prepared because
            // a route builder prepares the route definitions correctly already
            for (RouteDefinition route : getRouteCollection().getRoutes()) {
View Full Code Here

TOP

Related Classes of org.apache.camel.model.ModelCamelContext

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.