org.apache.camel.impl
Class RouteService

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

public class RouteService
extends ServiceSupport

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

Version:
$Revision: 944519 $

Constructor Summary
RouteService(DefaultCamelContext camelContext, RouteDefinition routeDefinition, List<RouteContext> routeContexts, List<Route> routes)
           
 
Method Summary
protected  void doStart()
           
protected  void doStop()
           
 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 startChildService(Route route, Service... services)
           
 void startInputs(boolean flag)
          Sets whether inputs (consumers) should be started when starting the routes

By default inputs are started.

protected  void stopChildService(Route route, List<Service> services, boolean shutdown)
           
 
Methods inherited from class org.apache.camel.impl.ServiceSupport
addChildService, doShutdown, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, removeChildService, shutdown, start, stop
 
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()

startInputs

public void startInputs(boolean flag)
Sets whether inputs (consumers) should be started when starting the routes

By default inputs are started.

Parameters:
flag - flag to either start inputs or not

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)

doStart

protected void doStart()
                throws Exception
Specified by:
doStart in class ServiceSupport
Throws:
Exception

doStop

protected void doStop()
               throws Exception
Specified by:
doStop in class ServiceSupport
Throws:
Exception

startChildService

protected void startChildService(Route route,
                                 Service... services)
                          throws Exception
Throws:
Exception

startChildService

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

stopChildService

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


Copyright © 2007-2010 The Apache Software Foundation. All Rights Reserved.