Package org.apache.camel.impl

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


    protected CamelContext createCamelContext() throws Exception {
        CamelContext camelContext = new DefaultCamelContext();
        AMQConnectionResource pool = new AMQConnectionResource("tcp://localhost:33333", 1);
        SjmsComponent component = new SjmsComponent();
        component.setConnectionResource(pool);
        camelContext.addComponent("sjms", component);
        return camelContext;
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
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

  protected ProducerTemplate camelProducer;
 
  @BeforeMethod
  public void beforeTest() throws Exception {
    CamelContext camelContext = new DefaultCamelContext();
    camelContext.addComponent("activemq", defaultJmsComponent());
   
    // workaround to start the activemq broker - sucks
    camelContext.addRoutes(new RouteBuilder() {
      @Override
      public void configure() throws Exception {
View Full Code Here

    camelContext.setStreamCaching(streamCaching);

    Boolean tracing = env.getProperty("camel.tracing", Boolean.class, Boolean.FALSE);
    camelContext.setTracing(tracing);

    camelContext.addComponent("properties", camelProperties(applicationContext));

    return camelContext;
  }

  /**
 
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

    @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

        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

        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

        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

    public static void main(String args[]) throws Exception {
        CamelContext context = new DefaultCamelContext();
        // Set up the ActiveMQ JMS Components
        ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");
        // Note we can explicit name of the component
        context.addComponent("jms", JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));

        context.addRoutes(new Client());

        ProducerTemplate template = context.createProducerTemplate();
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.