Package org.apache.camel.impl

Examples of org.apache.camel.impl.DefaultCamelContext.addComponent()


    public void testProperty() throws Exception {
        System.setProperty("test", "testValue");
        PropertiesComponent pc = new PropertiesComponent();
        CamelContext context = new DefaultCamelContext();
        pc.setCamelContext(context);
        context.addComponent("properties", pc);
       
        // try to setup the property
        Exchange exchange = new DefaultExchange(context);
        String result = SimpleBuilder.simple("${properties:test}").evaluate(exchange, String.class);
        Assert.assertEquals("testValue", result);
View Full Code Here


    @Override
    public CamelContext createCamelContext() throws Exception {
        CamelContext context = new DefaultCamelContext(createRegistry());
        HBaseComponent component = new HBaseComponent();
        component.setConfiguration(hbaseUtil.getConfiguration());
        context.addComponent("hbase", component);
        return context;
    }


    protected void putMultipleRows() throws IOException {
View Full Code Here

        PropertiesComponent pc = new PropertiesComponent();
        pc.setLocation("file:./target/jsse-test.properties");

        CamelContext context = new DefaultCamelContext();
        context.addComponent("properties", pc);

        return context;
    }

}
View Full Code Here

    }

    @Override
    protected CamelContext createCamelContext() throws Exception {
        CamelContext context = new DefaultCamelContext(createRegistry());
        context.addComponent("custom", new CustomComponent());

        return context;
    }

    private class CustomComponent extends DefaultComponent {
View Full Code Here

        broker.start();
        // Set up the ActiveMQ JMS Components
        ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");

        // Note we can explicitly name the component
        context.addComponent("jms", JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));

        context.addRoutes(new LoanBroker());
        // Start the loan broker
        context.start();
        System.out.println("Server is ready");
View Full Code Here

        new TradeExecutorExample().sendMessage();
    }
   
    public void sendMessage() throws Exception {       
        DefaultCamelContext context = new DefaultCamelContext();
        context.addComponent("trade-executor", new TradeExecutorComponent());
       
        final CountDownLatch logonLatch = new CountDownLatch(2);
        final CountDownLatch executionReportLatch = new CountDownLatch(2);
       
        RouteBuilder routes = new RouteBuilder() {
View Full Code Here

        DefaultManagementNamingStrategy naming = (DefaultManagementNamingStrategy) context.getManagementStrategy().getManagementNamingStrategy();
        naming.setHostName("localhost");
        naming.setDomainName("org.apache.camel");

        ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
        context.addComponent("activemq", jmsComponentAutoAcknowledge(connectionFactory));

        return context;
    }

    protected MBeanServer getMBeanServer() {
View Full Code Here

        // END SNIPPET: e1
        // Set up the ActiveMQ JMS Components
        // START SNIPPET: e2
        ConnectionFactory connectionFactory=new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
        // note we can explicity name the component
        context.addComponent("test-jms",JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
        // END SNIPPET: e2
        // Add some configuration by hand ...
        // START SNIPPET: e3
        context.addRoutes(new RouteBuilder(){
View Full Code Here

      public void run() {
            log.debug("hit");
        hitCount.incrementAndGet();
      }
        });
        container.addComponent("pojo", component);
       
        // lets add some routes
        container.addRoutes(new RouteBuilder() {
            public void configure() {
                from("timer://foo?fixedRate=true&delay=0&period=500").to("pojo:bar");
View Full Code Here

        broker.start();
        // Set up the ActiveMQ JMS Components
        ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:51616");

        // Note we can explicitly name the component
        context.addComponent("jms", JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));

        context.addRoutes(new LoanBroker());
        // Start the loan broker
        context.start();
        System.out.println("Server is ready");
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.