Package org.apache.camel.impl

Examples of org.apache.camel.impl.SimpleRegistry


        assertEquals("CamelCxfClientImpl should has the same bus with CxfEndpoint", newBus, client.getBus());
    }
   
    @Test
    public void testCxfEndpointConfigurer() throws Exception {
        SimpleRegistry registry = new SimpleRegistry();
        CxfEndpointConfigurer configurer = EasyMock.createMock(CxfEndpointConfigurer.class);
        Processor processor = EasyMock.createMock(Processor.class);
        registry.put("myConfigurer", configurer);
        CamelContext camelContext = new DefaultCamelContext(registry);
        CxfComponent cxfComponent = new CxfComponent(camelContext);
        CxfEndpoint endpoint = (CxfEndpoint)cxfComponent.createEndpoint(routerEndpointURI + "&cxfEndpointConfigurer=#myConfigurer");
       
        configurer.configure(EasyMock.isA(AbstractWSDLBasedEndpointFactory.class));
View Full Code Here


public class XmlRpcEndpointTest extends Assert {
   
    private CamelContext camelContext = new DefaultCamelContext(createRegistry());
   
    protected Registry createRegistry() {
        SimpleRegistry answer = new SimpleRegistry();
        // Binding the client configurer
        answer.put("myClientConfigurer", new MyClientConfigurer());
        return answer;
    }
View Full Code Here

                + "&deleteIfFiltered=false"
                + "&defaultVisibilityTimeout=1");

        AmazonSQSClientMock clientMock = new AmazonSQSClientMock();
        populateMessages(clientMock);
        SimpleRegistry registry = new SimpleRegistry();

        DefaultCamelContext ctx = new DefaultCamelContext(registry);
        ctx.addRoutes(new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from(sqsURI)
                        // try to filter using a non-existent header... should not go through
                        .filter(simple("${header.login} == true"))
                        .to("mock:result");

            }
        });
        MockEndpoint result = MockEndpoint.resolve(ctx, "mock:result");
        clientMock.setScheduler(ctx.getExecutorServiceManager().newScheduledThreadPool(clientMock, "ClientMock Scheduler", 1));
        registry.put("amazonSQSClient", clientMock);

        result.expectedMessageCount(0);

        ctx.start();
View Full Code Here

                + "&deleteIfFiltered=false"
                + "&defaultVisibilityTimeout=1");

        AmazonSQSClientMock clientMock = new AmazonSQSClientMock();
        populateMessages(clientMock);
        SimpleRegistry registry = new SimpleRegistry();

        DefaultCamelContext ctx = new DefaultCamelContext(registry);
        ctx.addRoutes(new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from(sqsURI)
                        .setHeader("login", constant(true))

                        // this filter should allow the message to pass..
                        .filter(simple("${header.login} == true"))
                        .to("mock:result");

            }
        });
        MockEndpoint result = MockEndpoint.resolve(ctx, "mock:result");
        registry.put("amazonSQSClient", clientMock);
        clientMock.setScheduler(ctx.getExecutorServiceManager().newScheduledThreadPool(clientMock, "ClientMock Scheduler", 1));

        result.expectedMessageCount(1);
        ctx.start();
View Full Code Here

        assertEquals("Bye World", bodies.get(1));
    }

    @Override
    protected CamelContext createCamelContext() throws Exception {
        SimpleRegistry reg = new SimpleRegistry();
        CamelContext context = new DefaultCamelContext(reg);

        foo = context.getEndpoint("mock:foo");
        bar = context.getEndpoint("mock:bar");
        reg.put("foo", foo);
        reg.put("coolbar", bar);

        return context;
    }
View Full Code Here

    public void init(ServiceDomain domain) {
        if (_logger.isDebugEnabled()) {
            _logger.debug("Initialization of CamelExchangeBus for domain " + domain.getName());
        }

        SimpleRegistry registry = _camelContext.getWritebleRegistry();
        for (Processors processor : Processors.values()) {
            registry.put(processor.name(), processor.create(domain));
        }

        // CAMEL-7728 introduces an issue on finding BeanManager due to the fact that default
        // applicationContextClassLoader in the CamelContext is not a bundle deployment class loader.
        // We need to ensure the applicationContextClassLoader is the bundle deployment class loader
View Full Code Here

        return new IdempotentConsumerInTransactionRouteBuilder(idempotentRepository);
    }

    @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);

        TransactionTemplate transactionTemplate = new TransactionTemplate();
        transactionTemplate.setTransactionManager(transactionManager);
View Full Code Here

        return new JmsTransactionRequestReplyRouteBuilder();
    }

    @Override
    protected CamelContext createCamelContext() throws Exception {
        SimpleRegistry registry = new SimpleRegistry();
        ActiveMQConnectionFactory connectionFactory =
            new ActiveMQConnectionFactory("vm://embedded?broker.persistent=false");
        registry.put("connectionFactory", connectionFactory);

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

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

        SpringTransactionPolicy propagationNotSupported = new SpringTransactionPolicy();
        propagationNotSupported.setTransactionManager(jmsTransactionManager);
        propagationNotSupported.setPropagationBehaviorName("PROPAGATION_NOT_SUPPORTED");
        registry.put("PROPAGATION_NOT_SUPPORTED", propagationNotSupported);

        CamelContext camelContext = new DefaultCamelContext(registry);

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

        return new RollbackMarkRollbackOnlyRouteBuilder();
    }

    @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 TransactionPolicyNestedRouteBuilder();
    }

    @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);
        }

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

        auditLogDao = new AuditLogDao(dataSource);
        messageDao = new MessageDao(dataSource);
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.