Package org.apache.camel

Examples of org.apache.camel.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


public class ComponentDiscoveryTest {
    private static final Logger LOG = LoggerFactory.getLogger(ComponentDiscoveryTest.class);

    @Test
    public void testComponentDiscovery() throws Exception {
        CamelContext context = new DefaultCamelContext();

        SortedMap<String, Properties> map = CamelContextHelper.findComponents(context);
        assertNotNull("Should never return null", map);
        assertTrue("Component map should never be empty", !map.isEmpty());
       
View Full Code Here


        }
    }

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

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

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

        assertMockEndpointsSatisfied();
    }

    protected CamelContext createCamelContext() throws Exception {
        CamelContext camelContext = super.createCamelContext();
        ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
        camelContext.addComponent("activemq", jmsComponentAutoAcknowledge(connectionFactory));
        return camelContext;
    }
View Full Code Here

        assertEquals(EXPECTED_REPLY_BODY, reply.getOut().getBody());
    }

    @Override
    protected CamelContext createCamelContext() throws Exception {
        CamelContext camelContext = super.createCamelContext();
        ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
        JmsComponent jmsComponent = jmsComponentAutoAcknowledge(connectionFactory);
        jmsComponent.getConfiguration().setReplyTo("baz");
        jmsComponent.getConfiguration().setReplyToOverride("bar");
        camelContext.addComponent("jms", jmsComponent);
        return camelContext;
    }
View Full Code Here

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

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

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

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

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

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

     * Lets force the CDI container to create all beans annotated with @Consume so that the consumer becomes active
     */
    public void startConsumeBeans(@Observes AfterDeploymentValidation event, BeanManager beanManager) throws Exception {
        for (CamelContextBean bean : camelContextBeans) {
            String name = bean.getCamelContextName();
            CamelContext context = getCamelContext(name);
            if (context == null) {
                throw new IllegalStateException(
                        "CamelContext '" + name + "' has not been injected into the CamelContextMap");
            }
            bean.configureCamelContext((CdiCamelContext) context);
View Full Code Here

        });
        return adapter;
    }

    protected DefaultCamelBeanPostProcessor getPostProcessor(String context) {
        CamelContext camelContext = getCamelContext(context);
        if (camelContext != null) {
            return new DefaultCamelBeanPostProcessor(camelContext);
        } else {
            throw new IllegalArgumentException("No such CamelContext '" + context + "' available!");
        }
View Full Code Here

TOP

Related Classes of org.apache.camel.CamelContext

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.