Examples of CamelContext

Notice: {@link #stop()} and {@link #suspend()} will gracefully stop/suspend routes ensuring any messagesin progress will be given time to complete. See more details at {@link org.apache.camel.spi.ShutdownStrategy}.

If you are doing a hot restart then it's advised to use the suspend/resume methods which ensure a faster restart but also allows any internal state to be kept as is. The stop/start approach will do a cold restart of Camel, where all internal state is reset.

End users are advised to use suspend/resume. Using stop is for shutting down Camel and it's not guaranteed that when it's being started again using the start method that Camel will operate consistently. @version


Examples of org.apache.camel.CamelContext

    public List<Route> getRoutes(String camelContextName, String filter) {
        List<Route> routes = new ArrayList<Route>();

        if (camelContextName != null) {
            CamelContext context = this.getCamelContext(camelContextName);
            if (context != null) {
                for (Route route : context.getRoutes()) {
                    if (filter == null || route.getId().matches(filter)) {
                        routes.add(route);
                    }
                }
            }
View Full Code Here

Examples of org.apache.camel.CamelContext

        return null;
    }

    @SuppressWarnings("deprecation")
    public RouteDefinition getRouteDefinition(String routeId, String camelContextName) {
        CamelContext context = this.getCamelContext(camelContextName);
        if (context == null) {
            return null;
        }
        return context.getRouteDefinition(routeId);
    }
View Full Code Here

Examples of org.apache.camel.CamelContext

        }
        return context.getRouteDefinition(routeId);
    }

    public List<RestDefinition> getRestDefinitions(String camelContextName) {
        CamelContext context = this.getCamelContext(camelContextName);
        if (context == null) {
            return null;
        }
        return context.getRestDefinitions();
    }
View Full Code Here

Examples of org.apache.camel.CamelContext

    public List<Endpoint> getEndpoints(String camelContextName) {
        List<Endpoint> answer = new ArrayList<Endpoint>();

        if (camelContextName != null) {
            CamelContext context = this.getCamelContext(camelContextName);
            if (context != null) {
                List<Endpoint> endpoints = new ArrayList<Endpoint>(context.getEndpoints());
                // sort routes
                Collections.sort(endpoints, new Comparator<Endpoint>() {
                    @Override
                    public int compare(Endpoint o1, Endpoint o2) {
                        return o1.getEndpointKey().compareTo(o2.getEndpointKey());
View Full Code Here

Examples of org.apache.camel.CamelContext

    public Map<String, List<RestRegistry.RestService>> getRestServices(String camelContextName) {
        Map<String, List<RestRegistry.RestService>> answer = new LinkedHashMap<String, List<RestRegistry.RestService>>();

        if (camelContextName != null) {
            CamelContext context = this.getCamelContext(camelContextName);
            if (context != null) {
                List<RestRegistry.RestService> services = new ArrayList<RestRegistry.RestService>(context.getRestRegistry().listAllRestServices());
                Collections.sort(services, new Comparator<RestRegistry.RestService>() {
                    @Override
                    public int compare(RestRegistry.RestService o1, RestRegistry.RestService o2) {
                        return o1.getUrl().compareTo(o2.getUrl());
                    }
View Full Code Here

Examples of org.apache.camel.CamelContext

        assertTrue(json.contains("\"delay\": { \"type\": \"integer\""));
    }

    @Test
    public void testComponentDocumentation() throws Exception {
        CamelContext context = new DefaultCamelContext();
        String html = context.getComponentDocumentation("timer");
        assertNotNull("Should have found some auto-generated HTML", html);
    }
View Full Code Here

Examples of org.apache.camel.CamelContext

        }
        return answer;
    }

    public String explainEndpoint(String camelContextName, String uri, boolean allOptions) throws Exception {
        CamelContext context = this.getCamelContext(camelContextName);
        if (context == null) {
            return null;
        }
        return context.explainEndpointJson(uri, allOptions);
    }
View Full Code Here

Examples of org.apache.camel.CamelContext

        }
        return context.explainEndpointJson(uri, allOptions);
    }

    public List<Map<String, String>> listComponents(String camelContextName) throws Exception {
        CamelContext context = this.getCamelContext(camelContextName);
        if (context == null) {
            return null;
        }

        List<Map<String, String>> answer = new ArrayList<Map<String, String>>();

        // find all components
        Map<String, Properties> components = context.findComponents();

        // gather component detail for each component
        for (Map.Entry<String, Properties> entry : components.entrySet()) {
            String name = entry.getKey();
            String description = null;
            // the status can be:
            // - loaded = in use
            // - classpath = on the classpath
            // - release = available from the Apache Camel release
            String status = context.hasComponent(name) != null ? "in use" : "on classpath";
            String type = null;
            String groupId = null;
            String artifactId = null;
            String version = null;

            // load component json data, and parse it to gather the component meta-data
            String json = context.getComponentParameterJsonSchema(name);
            List<Map<String, String>> rows = JsonSchemaHelper.parseJsonSchema("component", json, false);
            for (Map<String, String> row : rows) {
                if (row.containsKey("description")) {
                    description = row.get("description");
                } else if (row.containsKey("javaType")) {
View Full Code Here

Examples of org.apache.camel.CamelContext

        assertTrue(json.contains("\"synchronous\": { \"type\": \"boolean\""));
    }

    @Test
    public void testComponentDocumentation() throws Exception {
        CamelContext context = new DefaultCamelContext();
        String html = context.getComponentDocumentation("dataformat");
        assertNotNull("Should have found some auto-generated HTML", html);
    }
View Full Code Here

Examples of org.apache.camel.CamelContext

        assertTrue(json.contains("\"retainFirst\": { \"type\": \"integer\""));
    }

    @Test
    public void testComponentDocumentation() throws Exception {
        CamelContext context = new DefaultCamelContext();
        String html = context.getComponentDocumentation("mock");
        assertNotNull("Should have found some auto-generated HTML", html);
    }
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.