org.apache.camel.impl
Class RouteService

java.lang.Object
  extended by org.apache.camel.support.ServiceSupport
      extended by org.apache.camel.support.ChildServiceSupport
          extended by org.apache.camel.impl.RouteService
All Implemented Interfaces:
Service, ShutdownableService, StatefulService, SuspendableService

public class RouteService
extends ChildServiceSupport

Represents the runtime objects for a given RouteDefinition so that it can be stopped independently of other routes

Version:

Field Summary
 
Fields inherited from class org.apache.camel.support.ServiceSupport
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
 
Constructor Summary
RouteService(DefaultCamelContext camelContext, RouteDefinition routeDefinition, List<RouteContext> routeContexts, List<Route> routes)
           
 
Method Summary
protected  void doResume()
          Implementations override this method to support customized suspend/resume.
protected  void doShutdown()
          Implementations override this method to perform customized shutdown.
protected  void doStart()
          Implementations override this method to support customized start/stop.
protected  void doStop()
          Implementations override this method to support customized start/stop.
protected  void doSuspend()
          Implementations override this method to support customized suspend/resume.
 CamelContext getCamelContext()
           
 String getId()
           
 Map<Route,Consumer> getInputs()
          Gets the inputs to the routes.
 List<RouteContext> getRouteContexts()
           
 RouteDefinition getRouteDefinition()
           
 Collection<Route> getRoutes()
           
 boolean isRemovingRoutes()
           
 void setRemovingRoutes(boolean removingRoutes)
           
protected  void startChildService(Route route, List<Service> services)
           
protected  void stopChildService(Route route, Set<Service> services, boolean shutdown)
           
 void warmUp()
           
 
Methods inherited from class org.apache.camel.support.ChildServiceSupport
addChildService, removeChildService, shutdown, start, start, stop
 
Methods inherited from class org.apache.camel.support.ServiceSupport
getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspended, isSuspending, resume, suspend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RouteService

public RouteService(DefaultCamelContext camelContext,
                    RouteDefinition routeDefinition,
                    List<RouteContext> routeContexts,
                    List<Route> routes)
Method Detail

getId

public String getId()

getCamelContext

public CamelContext getCamelContext()

getRouteContexts

public List<RouteContext> getRouteContexts()

getRouteDefinition

public RouteDefinition getRouteDefinition()

getRoutes

public Collection<Route> getRoutes()

getInputs

public Map<Route,Consumer> getInputs()
Gets the inputs to the routes.

Returns:
list of Consumer as inputs for the routes

isRemovingRoutes

public boolean isRemovingRoutes()

setRemovingRoutes

public void setRemovingRoutes(boolean removingRoutes)

warmUp

public void warmUp()
            throws Exception
Throws:
Exception

doStart

protected void doStart()
                throws Exception
Description copied from class: ServiceSupport
Implementations override this method to support customized start/stop.

Important: See ServiceSupport.doStop() for more details.

Specified by:
doStart in class ServiceSupport
Throws:
Exception
See Also:
ServiceSupport.doStop()

doStop

protected void doStop()
               throws Exception
Description copied from class: ServiceSupport
Implementations override this method to support customized start/stop.

Important: Camel will invoke this ServiceSupport.doStop() method when the service is being stopped. This method will also be invoked if the service is still in uninitialized state (eg has not been started). The method is always called to allow the service to do custom logic when the service is being stopped, such as when CamelContext is shutting down.

Specified by:
doStop in class ServiceSupport
Throws:
Exception
See Also:
ServiceSupport.doStart()

doShutdown

protected void doShutdown()
                   throws Exception
Description copied from class: ServiceSupport
Implementations override this method to perform customized shutdown.

Overrides:
doShutdown in class ServiceSupport
Throws:
Exception

doSuspend

protected void doSuspend()
                  throws Exception
Description copied from class: ServiceSupport
Implementations override this method to support customized suspend/resume.

Overrides:
doSuspend in class ServiceSupport
Throws:
Exception

doResume

protected void doResume()
                 throws Exception
Description copied from class: ServiceSupport
Implementations override this method to support customized suspend/resume.

Overrides:
doResume in class ServiceSupport
Throws:
Exception

startChildService

protected void startChildService(Route route,
                                 List<Service> services)
                          throws Exception
Throws:
Exception

stopChildService

protected void stopChildService(Route route,
                                Set<Service> services,
                                boolean shutdown)
                         throws Exception
Throws:
Exception


Apache CAMEL