org.apache.camel.impl
Class DefaultRoute

java.lang.Object
  extended by org.apache.camel.impl.ServiceSupport
      extended by org.apache.camel.impl.DefaultRoute
All Implemented Interfaces:
Route, Service, ShutdownableService
Direct Known Subclasses:
EventDrivenConsumerRoute

public abstract class DefaultRoute
extends ServiceSupport
implements Route

Default implementation of Route.

Version:

Field Summary
 
Fields inherited from interface org.apache.camel.Route
GROUP_PROPERTY, ID_PROPERTY, PARENT_PROPERTY
 
Constructor Summary
DefaultRoute(RouteContext routeContext, Endpoint endpoint)
           
DefaultRoute(RouteContext routeContext, Endpoint endpoint, Service... services)
           
 
Method Summary
 void addService(Service service)
          Adds a service to this route
protected  void addServices(List<Service> services)
          Strategy method to allow derived classes to lazily load services for the route
protected  void doStart()
           
protected  void doStop()
           
 Endpoint getEndpoint()
          Gets the inbound endpoint
 String getId()
          Gets the route id
 Map<String,Object> getProperties()
          This property map is used to associate information about the route.
 RouteContext getRouteContext()
          Gets the route context
 List<Service> getServices()
          Returns the services for this particular route
 void onStartingServices(List<Service> services)
          A strategy callback allowing special initialization when services is starting.
 String toString()
           
 
Methods inherited from class org.apache.camel.impl.ServiceSupport
addChildService, doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspended, isSuspending, removeChildService, resume, shutdown, start, start, stop, suspend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.camel.Route
getConsumer, navigate, supportsSuspension
 

Constructor Detail

DefaultRoute

public DefaultRoute(RouteContext routeContext,
                    Endpoint endpoint)

DefaultRoute

public DefaultRoute(RouteContext routeContext,
                    Endpoint endpoint,
                    Service... services)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

getId

public String getId()
Description copied from interface: Route
Gets the route id

Specified by:
getId in interface Route
Returns:
the route id

getEndpoint

public Endpoint getEndpoint()
Description copied from interface: Route
Gets the inbound endpoint

Specified by:
getEndpoint in interface Route

getRouteContext

public RouteContext getRouteContext()
Description copied from interface: Route
Gets the route context

Specified by:
getRouteContext in interface Route
Returns:
the route context

getProperties

public Map<String,Object> getProperties()
Description copied from interface: Route
This property map is used to associate information about the route.

Specified by:
getProperties in interface Route
Returns:
properties

onStartingServices

public void onStartingServices(List<Service> services)
                        throws Exception
Description copied from interface: Route
A strategy callback allowing special initialization when services is starting.

Specified by:
onStartingServices in interface Route
Parameters:
services - the service
Throws:
Exception - is thrown in case of error

getServices

public List<Service> getServices()
Description copied from interface: Route
Returns the services for this particular route

Specified by:
getServices in interface Route

addService

public void addService(Service service)
Description copied from interface: Route
Adds a service to this route

Specified by:
addService in interface Route
Parameters:
service - the service

addServices

protected void addServices(List<Service> services)
                    throws Exception
Strategy method to allow derived classes to lazily load services for the route

Throws:
Exception

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


Apache CAMEL