Package org.apache.camel.impl

Examples of org.apache.camel.impl.SimpleRegistry


    @Override
    protected CamelContext createCamelContext() throws Exception {
        final String keyStorePassword = "keystorePassword";
        final String trustStorePassword = "truststorePassword";

        SimpleRegistry registry = new SimpleRegistry();

        KeyStore keyStore = KeyStore.getInstance("JKS"); // Java keystore

        ClassLoader classLoader = getClass().getClassLoader();
        log.info("Loading keystore from [{}]", classLoader.getResource("keystore.jks").toString());
        keyStore.load(classLoader.getResourceAsStream("keystore.jks"), keyStorePassword.toCharArray());
        registry.put("keyStore", keyStore);

        KeyStore trustStore = KeyStore.getInstance("JKS"); // Java keystore
        trustStore.load(classLoader.getResourceAsStream("truststore.jks"), trustStorePassword.toCharArray());
        registry.put("trustStore", trustStore);

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


    @Override
    protected CamelContext createCamelContext() throws Exception {
        final String keyStorePassword = "keystorePassword";
        final String trustStorePassword = "truststorePassword";

        SimpleRegistry registry = new SimpleRegistry();

        KeyStore keyStore = KeyStore.getInstance("JKS"); // Java keystore

        ClassLoader classLoader = getClass().getClassLoader();
        log.info("Loading keystore from [{}]", classLoader.getResource("keystore.jks").toString());
        keyStore.load(classLoader.getResourceAsStream("keystore.jks"), keyStorePassword.toCharArray());
        registry.put("keyStore", keyStore);

        KeyStore trustStore = KeyStore.getInstance("JKS"); // Java keystore
        trustStore.load(classLoader.getResourceAsStream("truststore.jks"), trustStorePassword.toCharArray());
        registry.put("trustStore", trustStore);

        return new DefaultCamelContext(registry);
    }
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

    public GaeDefaultCamelContext() {
        super();
        // disable JMX and use the simple registry as JNDI is not allowed
        disableJMX();
        setRegistry(new SimpleRegistry());
    }
View Full Code Here

        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

    @Override
    protected CamelContext createCamelContext() throws Exception {
        // We initialize Camel

        SimpleRegistry registry = new SimpleRegistry();
        // First we register a blog service in our bean registry
        registry.put("blogService", new BlogService());

        // Then we create the camel context with our bean registry
        context = new DefaultCamelContext(registry);

        // Then we add all the routes we need using the route builder DSL syntax
View Full Code Here

        // Create the zkClientBean
        zkClientBean.setConnectString("localhost:9004");
        CuratorFramework client = zkClientBean.getObject();

        // Need to bind the zookeeper client with the name "curator"
        SimpleRegistry registry = new SimpleRegistry();
        registry.put("curator", client);

        producerContext = new DefaultCamelContext(registry);
        // Add the vm:start endpoint to avoid the NPE before starting the consumerContext1
        producerContext.addRoutes(new RouteBuilder() {
            @Override
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

    }

    @Before
    public void setUp() throws Exception {
        camelContext = new DefaultCamelContext();
        SimpleRegistry registry = new SimpleRegistry();
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("custName", "Willem");
        // bind the params
        registry.put("params", params);
        camelContext.setRegistry(registry);
       
        template = camelContext.createProducerTemplate();
        ServiceHelper.startServices(template, camelContext);
View Full Code Here

public class GreaterCamelEjbPropertiesTest extends CamelTestSupport {

    @Override
    protected CamelContext createCamelContext() throws Exception {
        // use simple registry to not conflict with jndi used by EJB
        CamelContext answer = new DefaultCamelContext(new SimpleRegistry());

        // enlist EJB component using JndiContext
        Properties properties = new Properties();
        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
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.