Search in sources :

Example 1 with SimpleRouteBuilder

use of org.apache.camel.component.routebox.demo.SimpleRouteBuilder in project camel by apache.

the class RouteboxDirectProducerOnlyTest method createInnerContext.

private CamelContext createInnerContext() throws Exception {
    // Create a camel context to be encapsulated by the routebox
    JndiRegistry innerRegistry = new JndiRegistry(createJndiContext());
    BookCatalog catalogBean = new BookCatalog();
    innerRegistry.bind("library", catalogBean);
    CamelContext innerContext = new DefaultCamelContext(innerRegistry);
    innerContext.addRoutes(new SimpleRouteBuilder());
    return innerContext;
}
Also used : JndiRegistry(org.apache.camel.impl.JndiRegistry) CamelContext(org.apache.camel.CamelContext) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) BookCatalog(org.apache.camel.component.routebox.demo.BookCatalog) SimpleRouteBuilder(org.apache.camel.component.routebox.demo.SimpleRouteBuilder)

Example 2 with SimpleRouteBuilder

use of org.apache.camel.component.routebox.demo.SimpleRouteBuilder in project camel by apache.

the class RouteboxSedaTest method createInnerContext.

private CamelContext createInnerContext() throws Exception {
    // Create a camel context to be encapsulated by the routebox
    JndiRegistry innerRegistry = new JndiRegistry(createJndiContext());
    BookCatalog catalogBean = new BookCatalog();
    innerRegistry.bind("library", catalogBean);
    CamelContext innerContext = new DefaultCamelContext(innerRegistry);
    innerContext.addRoutes(new SimpleRouteBuilder());
    return innerContext;
}
Also used : JndiRegistry(org.apache.camel.impl.JndiRegistry) CamelContext(org.apache.camel.CamelContext) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) BookCatalog(org.apache.camel.component.routebox.demo.BookCatalog) SimpleRouteBuilder(org.apache.camel.component.routebox.demo.SimpleRouteBuilder)

Example 3 with SimpleRouteBuilder

use of org.apache.camel.component.routebox.demo.SimpleRouteBuilder in project camel by apache.

the class RouteboxDefaultContextAndRouteBuilderTest method createRegistry.

@Override
protected JndiRegistry createRegistry() throws Exception {
    JndiRegistry registry = new JndiRegistry(createJndiContext());
    // Wire the routeDefinitions & dispatchStrategy to the outer camelContext where the routebox is declared
    List<RouteBuilder> routes = new ArrayList<RouteBuilder>();
    routes.add(new SimpleRouteBuilder());
    registry.bind("registry", createInnerRegistry());
    registry.bind("routes", routes);
    registry.bind("strategy", new SimpleRouteDispatchStrategy());
    return registry;
}
Also used : JndiRegistry(org.apache.camel.impl.JndiRegistry) SimpleRouteBuilder(org.apache.camel.component.routebox.demo.SimpleRouteBuilder) RouteBuilder(org.apache.camel.builder.RouteBuilder) ArrayList(java.util.ArrayList) SimpleRouteBuilder(org.apache.camel.component.routebox.demo.SimpleRouteBuilder)

Example 4 with SimpleRouteBuilder

use of org.apache.camel.component.routebox.demo.SimpleRouteBuilder in project camel by apache.

the class RouteboxDirectTest method createInnerContext.

private CamelContext createInnerContext() throws Exception {
    // Create a camel context to be encapsulated by the routebox
    JndiRegistry innerRegistry = new JndiRegistry(createJndiContext());
    BookCatalog catalogBean = new BookCatalog();
    innerRegistry.bind("library", catalogBean);
    CamelContext innerContext = new DefaultCamelContext(innerRegistry);
    innerContext.addRoutes(new SimpleRouteBuilder());
    return innerContext;
}
Also used : JndiRegistry(org.apache.camel.impl.JndiRegistry) CamelContext(org.apache.camel.CamelContext) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) BookCatalog(org.apache.camel.component.routebox.demo.BookCatalog) SimpleRouteBuilder(org.apache.camel.component.routebox.demo.SimpleRouteBuilder)

Example 5 with SimpleRouteBuilder

use of org.apache.camel.component.routebox.demo.SimpleRouteBuilder in project camel by apache.

the class RouteboxDispatchMapTest method createRegistry.

@Override
protected JndiRegistry createRegistry() throws Exception {
    JndiRegistry registry = new JndiRegistry(createJndiContext());
    // Wire the routeDefinitions & dispatchStrategy to the outer camelContext where the routebox is declared
    List<RouteBuilder> routes = new ArrayList<RouteBuilder>();
    routes.add(new SimpleRouteBuilder());
    registry.bind("registry", createInnerRegistry());
    registry.bind("routes", routes);
    // Wire a dispatch map to registry
    Map<String, String> map = new HashMap<String, String>();
    map.put("addToCatalog", "seda:addToCatalog");
    map.put("findBook", "seda:findBook");
    registry.bind("map", map);
    return registry;
}
Also used : JndiRegistry(org.apache.camel.impl.JndiRegistry) SimpleRouteBuilder(org.apache.camel.component.routebox.demo.SimpleRouteBuilder) RouteBuilder(org.apache.camel.builder.RouteBuilder) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) SimpleRouteBuilder(org.apache.camel.component.routebox.demo.SimpleRouteBuilder)

Aggregations

SimpleRouteBuilder (org.apache.camel.component.routebox.demo.SimpleRouteBuilder)5 JndiRegistry (org.apache.camel.impl.JndiRegistry)5 CamelContext (org.apache.camel.CamelContext)3 BookCatalog (org.apache.camel.component.routebox.demo.BookCatalog)3 DefaultCamelContext (org.apache.camel.impl.DefaultCamelContext)3 ArrayList (java.util.ArrayList)2 RouteBuilder (org.apache.camel.builder.RouteBuilder)2 HashMap (java.util.HashMap)1