Package org.apache.camel.impl

Examples of org.apache.camel.impl.SimpleRegistry


        return new JmsTransactionRouteBuilder();
    }

    @Override
    protected CamelContext createCamelContext() throws Exception {
        SimpleRegistry registry = new SimpleRegistry();
        ActiveMQConnectionFactory connectionFactory =
            new ActiveMQConnectionFactory();
        connectionFactory.setBrokerURL(broker.getTcpConnectorUri());
        registry.put("connectionFactory", connectionFactory);

        JmsTransactionManager jmsTransactionManager = new JmsTransactionManager();
        jmsTransactionManager.setConnectionFactory(connectionFactory);
        registry.put("jmsTransactionManager", jmsTransactionManager);

        SpringTransactionPolicy policy = new SpringTransactionPolicy();
        policy.setTransactionManager(jmsTransactionManager);
        policy.setPropagationBehaviorName("PROPAGATION_REQUIRED");
        registry.put("PROPAGATION_REQUIRED", policy);

        CamelContext camelContext = new DefaultCamelContext(registry);

        ActiveMQComponent activeMQComponent = new ActiveMQComponent();
        activeMQComponent.setConnectionFactory(connectionFactory);
View Full Code Here


        return new RollbackMarkRollbackOnlyLastRouteBuilder();
    }

    @Override
    protected CamelContext createCamelContext() throws Exception {
        SimpleRegistry registry = new SimpleRegistry();
        DataSource dataSource = EmbeddedDataSourceFactory.getDataSource("sql/schema.sql");

        DataSourceTransactionManager transactionManager = new DataSourceTransactionManager(dataSource);
        registry.put("transactionManager", transactionManager);

        {
            SpringTransactionPolicy propagationRequiresNew = new SpringTransactionPolicy();
            propagationRequiresNew.setTransactionManager(transactionManager);
            propagationRequiresNew.setPropagationBehaviorName("PROPAGATION_REQUIRES_NEW");
            registry.put("PROPAGATION_REQUIRES_NEW", propagationRequiresNew);
        }

        {
            SpringTransactionPolicy propagationRequiresNew2 = new SpringTransactionPolicy();
            propagationRequiresNew2.setTransactionManager(transactionManager);
            propagationRequiresNew2.setPropagationBehaviorName("PROPAGATION_REQUIRES_NEW");
            registry.put("PROPAGATION_REQUIRES_NEW-2", propagationRequiresNew2);
        }

        auditLogDao = new AuditLogDao(dataSource);
        messageDao = new MessageDao(dataSource);
View Full Code Here

        return new RollbackRouteBuilder();
    }

    @Override
    protected CamelContext createCamelContext() throws Exception {
        SimpleRegistry registry = new SimpleRegistry();
        DataSource auditDataSource = EmbeddedDataSourceFactory.getDataSource("sql/schema.sql");

        DataSourceTransactionManager transactionManager = new DataSourceTransactionManager(auditDataSource);
        registry.put("transactionManager", transactionManager);

        SpringTransactionPolicy propagationRequired = new SpringTransactionPolicy();
        propagationRequired.setTransactionManager(transactionManager);
        propagationRequired.setPropagationBehaviorName("PROPAGATION_REQUIRED");
        registry.put("PROPAGATION_REQUIRED", propagationRequired);

        auditLogDao = new AuditLogDao(auditDataSource);

        CamelContext camelContext = new DefaultCamelContext(registry);
View Full Code Here

        return new DatabaseTransactionRouteBuilder();
    }

    @Override
    protected CamelContext createCamelContext() throws Exception {
        SimpleRegistry registry = new SimpleRegistry();
        auditDataSource = EmbeddedDataSourceFactory.getDataSource("sql/schema.sql");
        //registry.put("auditDataSource", auditDataSource);

        DataSourceTransactionManager transactionManager = new DataSourceTransactionManager(auditDataSource);
        registry.put("transactionManager", transactionManager);

        SpringTransactionPolicy propagationRequired = new SpringTransactionPolicy();
        propagationRequired.setTransactionManager(transactionManager);
        propagationRequired.setPropagationBehaviorName("PROPAGATION_REQUIRED");
        registry.put("PROPAGATION_REQUIRED", propagationRequired);

        auditLogDao = new AuditLogDao(auditDataSource);

        CamelContext camelContext = new DefaultCamelContext(registry);
View Full Code Here

        return new JmsTransactionEndpointRouteBuilder();
    }

    @Override
    protected CamelContext createCamelContext() throws Exception {
        SimpleRegistry registry = new SimpleRegistry();

        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory();
        connectionFactory.setBrokerURL(broker.getTcpConnectorUri());
        registry.put("connectionFactory", connectionFactory);

        CamelContext camelContext = new DefaultCamelContext(registry);
        ActiveMQComponent activeMQComponent = new ActiveMQComponent();
        activeMQComponent.setConnectionFactory(connectionFactory);
        camelContext.addComponent("jms", activeMQComponent);
View Full Code Here

        return new TransactionPolicyRouteBuilder();
    }

    @Override
    protected CamelContext createCamelContext() throws Exception {
        SimpleRegistry registry = new SimpleRegistry();
        dataSource = EmbeddedDataSourceFactory.getDataSource("sql/schema.sql");

        DataSourceTransactionManager transactionManager = new DataSourceTransactionManager(dataSource);
        registry.put("transactionManager", transactionManager);

        SpringTransactionPolicy propagationRequired = new SpringTransactionPolicy();
        propagationRequired.setTransactionManager(transactionManager);
        propagationRequired.setPropagationBehaviorName("PROPAGATION_REQUIRED");
        registry.put("PROPAGATION_REQUIRED", propagationRequired);

        auditLogDao = new AuditLogDao(dataSource);
        messageDao = new MessageDao(dataSource);

        CamelContext camelContext = new DefaultCamelContext(registry);
View Full Code Here

        return new XATransactionRouteBuilder();
    }

    @Override
    protected CamelContext createCamelContext() throws Exception {
        SimpleRegistry registry = new SimpleRegistry();

        // JMS setup
        ActiveMQXAConnectionFactory xaConnectionFactory =
            new ActiveMQXAConnectionFactory();
        xaConnectionFactory.setBrokerURL(broker.getTcpConnectorUri());
        registry.put("connectionFactory", xaConnectionFactory);

        atomikosConnectionFactoryBean = new AtomikosConnectionFactoryBean();
        atomikosConnectionFactoryBean.setXaConnectionFactory(xaConnectionFactory);
        atomikosConnectionFactoryBean.setUniqueResourceName("xa.activemq");
        atomikosConnectionFactoryBean.setMaxPoolSize(10);
        atomikosConnectionFactoryBean.setIgnoreSessionTransactedFlag(false);
        registry.put("atomikos.connectionFactory", atomikosConnectionFactoryBean);


        // JDBC setup
        JdbcDataSource jdbcDataSource = EmbeddedDataSourceFactory.getJdbcDataSource("sql/schema.sql");

        AtomikosDataSourceBean atomikosDataSourceBean = new AtomikosDataSourceBean();
        atomikosDataSourceBean.setXaDataSource(jdbcDataSource);
        atomikosDataSourceBean.setUniqueResourceName("xa.h2");
        registry.put("atomikos.dataSource", atomikosDataSourceBean);


        // Atomikos setup
        userTransactionManager = new UserTransactionManager();
        userTransactionManager.setForceShutdown(false);
        userTransactionManager.init();

        UserTransactionImp userTransactionImp = new UserTransactionImp();
        userTransactionImp.setTransactionTimeout(300);

        JtaTransactionManager jtaTransactionManager = new JtaTransactionManager();
        jtaTransactionManager.setTransactionManager(userTransactionManager);
        jtaTransactionManager.setUserTransaction(userTransactionImp);

        registry.put("jta.transactionManager", jtaTransactionManager);

        SpringTransactionPolicy propagationRequired = new SpringTransactionPolicy();
        propagationRequired.setTransactionManager(jtaTransactionManager);
        propagationRequired.setPropagationBehaviorName("PROPAGATION_REQUIRED");
        registry.put("PROPAGATION_REQUIRED", propagationRequired);


        auditLogDao = new AuditLogDao(jdbcDataSource);

        CamelContext camelContext = new DefaultCamelContext(registry);
View Full Code Here

        inputDataSet.setSize(testBatchSize);

        ExpectedOutputDataSet expectedOutputDataSet = new ExpectedOutputDataSet();
        expectedOutputDataSet.setSize(testBatchSize);

        SimpleRegistry registry = new SimpleRegistry();
        registry.put("input", inputDataSet);
        registry.put("expectedOutput", expectedOutputDataSet);

        return new DefaultCamelContext(registry);
    }
View Full Code Here

/**
* Example that demonstrates how to run the Camel runtime in a standalone Java application.
*/
public class SimpleCamelApplication {
    public static void main(String[] args) throws Exception {
        SimpleRegistry registry = new SimpleRegistry();
        // add POJOs to the registry here using registry.put("name", <object reference>)

        CamelContext context = new DefaultCamelContext(registry);

        context.addComponent("mylogger", new LogComponent());
View Full Code Here

        ClassLoader classLoader = getClass().getClassLoader();
        log.info("Loading keystore from [{}]", classLoader.getResource("shared.jceks").toString());
        keyStore.load(classLoader.getResourceAsStream("shared.jceks"), "sharedKeystorePassword".toCharArray());

        SimpleRegistry registry = new SimpleRegistry();
        registry.put("shared_a", keyStore.getKey("shared_a", "sharedKeyPasswordA".toCharArray()));
        registry.put("shared_b", keyStore.getKey("shared_b", "sharedKeyPasswordB".toCharArray()));

        return new DefaultCamelContext(registry);
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.impl.SimpleRegistry

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.