public CamelRouteActionBuilder create ( RouteBuilder routeBuilder ) { CreateCamelRouteAction camelRouteAction = new CreateCamelRouteAction ( ) ; try { if ( ! routeBuilder . getContext ( ) . equals ( getCamelContext ( ) ) ) { routeBuilder . configureRoutes ( getCamelContext ( ) ) ; } else { routeBuilder . configure ( ) ; } camelRouteAction . setRoutes ( routeBuilder . getRouteCollection ( ) . getRoutes ( ) ) ; } catch ( Exception e ) { throw new CitrusRuntimeException ( "Failed to configure route definitions with camel context" , e ) ; } camelRouteAction . setCamelContext ( getCamelContext ( ) ) ; action . setDelegate ( camelRouteAction ) ; return this ; }
Creates new Camel routes in route builder .