Search in sources :

Example 11 with RoutePolicy

use of org.apache.camel.spi.RoutePolicy in project camel by apache.

the class RouteService method doStart.

protected void doStart() throws Exception {
    warmUp();
    for (Route route : routes) {
        try (MDCHelper mdcHelper = new MDCHelper(route.getId())) {
            // start the route itself
            ServiceHelper.startService(route);
            // invoke callbacks on route policy
            if (route.getRouteContext().getRoutePolicyList() != null) {
                for (RoutePolicy routePolicy : route.getRouteContext().getRoutePolicyList()) {
                    routePolicy.onStart(route);
                }
            }
            // fire event
            EventHelper.notifyRouteStarted(camelContext, route);
        }
    }
}
Also used : RoutePolicy(org.apache.camel.spi.RoutePolicy) Route(org.apache.camel.Route)

Aggregations

RoutePolicy (org.apache.camel.spi.RoutePolicy)11 Route (org.apache.camel.Route)6 LifecycleStrategy (org.apache.camel.spi.LifecycleStrategy)3 List (java.util.List)2 CamelContext (org.apache.camel.CamelContext)2 NoSuchEndpointException (org.apache.camel.NoSuchEndpointException)2 Service (org.apache.camel.Service)2 DefaultCamelContext (org.apache.camel.impl.DefaultCamelContext)2 ModelCamelContext (org.apache.camel.model.ModelCamelContext)2 RouteDefinition (org.apache.camel.model.RouteDefinition)2 JobExecutionException (org.quartz.JobExecutionException)2 SchedulerContext (org.quartz.SchedulerContext)2 SchedulerException (org.quartz.SchedulerException)2 ArrayList (java.util.ArrayList)1 StringTokenizer (java.util.StringTokenizer)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 FailedToCreateRouteException (org.apache.camel.FailedToCreateRouteException)1 Processor (org.apache.camel.Processor)1 RuntimeCamelException (org.apache.camel.RuntimeCamelException)1 ShutdownRoute (org.apache.camel.ShutdownRoute)1