Search in sources :

Example 1 with JndiContext

use of org.apache.camel.util.jndi.JndiContext in project camel by apache.

the class BeanLookupUsingJndiRegistryIssueTest method testCamelWithJndi.

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 {
            from("direct:start").bean("foo");
        }
    });
    camel.start();
    String reply = camel.createProducerTemplate().requestBody("direct:start", "Camel", String.class);
    assertEquals("Hello Camel", reply);
    camel.stop();
}
Also used : CamelContext(org.apache.camel.CamelContext) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) RouteBuilder(org.apache.camel.builder.RouteBuilder) JndiContext(org.apache.camel.util.jndi.JndiContext) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext)

Example 2 with JndiContext

use of org.apache.camel.util.jndi.JndiContext in project camel by apache.

the class BeanExchangeAsReturnTypeNotAllowedTest method createJndiContext.

protected Context createJndiContext() throws Exception {
    JndiContext answer = new JndiContext();
    answer.bind("myBean", new MyBean());
    return answer;
}
Also used : JndiContext(org.apache.camel.util.jndi.JndiContext)

Example 3 with JndiContext

use of org.apache.camel.util.jndi.JndiContext in project camel by apache.

the class BeanImplicitMethodTest method createJndiContext.

@Override
protected Context createJndiContext() throws Exception {
    JndiContext answer = new JndiContext();
    answer.bind("myBean", new MyBean());
    return answer;
}
Also used : JndiContext(org.apache.camel.util.jndi.JndiContext)

Example 4 with JndiContext

use of org.apache.camel.util.jndi.JndiContext in project camel by apache.

the class SchedulerRouteTest method createJndiContext.

@Override
protected Context createJndiContext() throws Exception {
    JndiContext answer = new JndiContext();
    answer.bind("myBean", bean);
    return answer;
}
Also used : JndiContext(org.apache.camel.util.jndi.JndiContext)

Example 5 with JndiContext

use of org.apache.camel.util.jndi.JndiContext in project camel by apache.

the class RoutingSlipWithExceptionTest method createJndiContext.

@Override
protected Context createJndiContext() throws Exception {
    JndiContext answer = new JndiContext();
    answer.bind("myBean", myBean);
    return answer;
}
Also used : JndiContext(org.apache.camel.util.jndi.JndiContext)

Aggregations

JndiContext (org.apache.camel.util.jndi.JndiContext)75 ConnectionFactory (javax.jms.ConnectionFactory)16 JmsComponent (org.apache.camel.component.jms.JmsComponent)16 CamelContext (org.apache.camel.CamelContext)6 DefaultCamelContext (org.apache.camel.impl.DefaultCamelContext)3 ArrayList (java.util.ArrayList)2 RouteBuilder (org.apache.camel.builder.RouteBuilder)2 InvocationHandler (java.lang.reflect.InvocationHandler)1 Method (java.lang.reflect.Method)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Calendar (java.util.Calendar)1 Endpoint (org.apache.camel.Endpoint)1 JndiRegistry (org.apache.camel.impl.JndiRegistry)1 ProcessorEndpoint (org.apache.camel.impl.ProcessorEndpoint)1 IoFilter (org.apache.mina.common.IoFilter)1 IoFilter (org.apache.mina.core.filterchain.IoFilter)1 Test (org.junit.Test)1