Package org.apache.camel.util.jndi

Examples of org.apache.camel.util.jndi.JndiContext.bind()



    @Override
    protected Context createJndiContext() throws Exception {
        JndiContext answer = new JndiContext();
        answer.bind("myBean", bean);
        return answer;
    }

    public static class MyBean {
        public AtomicInteger counter = new AtomicInteger(0);
View Full Code Here


        // Boot up a local RMI registry
        LocateRegistry.createRegistry(getPort());

        // START SNIPPET: register
        JndiContext context = new JndiContext();
        context.bind("bye", new SayService("Good Bye!"));

        CamelContext camelContext = new DefaultCamelContext(context);
        // END SNIPPET: register

        camelContext.addRoutes(getRouteBuilder(camelContext));
View Full Code Here

        JndiContext answer = new JndiContext();
        IoFilter myFilter = new TestFilter();
        List<IoFilter> myFilters = new ArrayList<IoFilter>();
        myFilters.add(myFilter);

        answer.bind("myFilters", myFilters);
        answer.bind("myFilter", myFilter);
        return answer;
    }

    public static final class TestFilter extends IoFilterAdapter {
View Full Code Here

        IoFilter myFilter = new TestFilter();
        List<IoFilter> myFilters = new ArrayList<IoFilter>();
        myFilters.add(myFilter);

        answer.bind("myFilters", myFilters);
        answer.bind("myFilter", myFilter);
        return answer;
    }

    public static final class TestFilter extends IoFilterAdapter {
View Full Code Here

    }

    @Override
    protected Context createJndiContext() throws Exception {
        JndiContext answer = new JndiContext();
        answer.bind("myBean", new MyBean());
        answer.bind("myStrategy", new MyAggregationStrategy());
        return answer;
    }

    protected RouteBuilder createRouteBuilder() {
View Full Code Here

    @Override
    protected Context createJndiContext() throws Exception {
        JndiContext answer = new JndiContext();
        answer.bind("myBean", new MyBean());
        answer.bind("myStrategy", new MyAggregationStrategy());
        return answer;
    }

    protected RouteBuilder createRouteBuilder() {
        return new RouteBuilder() {
View Full Code Here

    }

    @Override
    protected Context createJndiContext() throws Exception {
        JndiContext answer = new JndiContext();
        answer.bind("myBean", myBean);
        return answer;
    }

    public static class MyBean {
View Full Code Here

    }

    protected Context createJndiContext() throws Exception {
        JndiContext answer = new JndiContext();
        bean = new MyBean();
        answer.bind("myBean", bean);
        return answer;
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
View Full Code Here

*/
public class BeanLookupUsingJndiRegistryIssueTest extends TestCase {

    public void testCamelWithJndi() throws Exception {
        JndiContext jndi = new JndiContext();
        jndi.bind("foo", new MyOtherDummyBean());

        CamelContext camel = new DefaultCamelContext(jndi);
        camel.addRoutes(new RouteBuilder() {
            @Override
            public void configure() throws Exception {
View Full Code Here

    public void testPojoRoutes() throws Exception {
        // START SNIPPET: register
        // lets populate the context with the services we need
        // note that we could just use a spring.xml file to avoid this step
        JndiContext context = new JndiContext();
        context.bind("bye", new SayService("Good Bye!"));

        CamelContext camelContext = new DefaultCamelContext(context);
        // END SNIPPET: register

        // START SNIPPET: route
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.