### JNDI

JNDI integration is provided by a {wildfly} specific CamelContext as shown below:

[source,java,options="nowrap"]
InitialContext inictx = new InitialContext();
CamelContextFactory factory = inictx.lookup("java:jboss/camel/CamelContextFactory");
WildFlyCamelContext camelctx = factory.createCamelContext();

From a `WildFlyCamelContext` you can obtain a preconfigured Naming Context

[source,java,options="nowrap"]
Context context = camelctx.getNamingContext();
context.bind("helloBean", new HelloBean());

which can then be referenced from Camel routes.

[source,java,options="nowrap"]
camelctx.addRoutes(new RouteBuilder() {
    @Override
    public void configure() throws Exception {
        from("direct:start").beanRef("helloBean");
    }
});
camelctx.start();
