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
Direct Known Subclasses:
EventDrivenConsumerRoute

public abstract class DefaultRoute
extends ServiceSupport
implements Route

A Route defines the processing used on an inbound message exchange from a specific Endpoint within a CamelContext

Version:
$Revision: 808777 $

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
 List<Service> getServicesForRoute()
          This property map is used to associate information about the 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, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, removeChildService, start, stop
 
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
 

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

getServicesForRoute

public List<Service> getServicesForRoute()
                                  throws Exception
Description copied from interface: Route
This property map is used to associate information about the route. Gets all the services for this routes

This implementation is used for initialization

Specified by:
getServicesForRoute in interface Route
Returns:
the services
Throws:
Exception - is thrown in case of error

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


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