|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.camel.support.ServiceSupport org.apache.camel.impl.DefaultRoute
public abstract class DefaultRoute
Default implementation of Route
.
CamelContext
to control the lifecycle of a route,
such as starting and stopping using the CamelContext.startRoute(String)
and CamelContext.stopRoute(String)
methods.
Field Summary |
---|
Fields inherited from class org.apache.camel.support.ServiceSupport |
---|
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending |
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 |
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. |
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 are starting. |
void |
start()
Do not invoke this method directly, use CamelContext.startRoute(String) to start a route. |
void |
stop()
Do not invoke this method directly, use CamelContext.stopRoute(String) to stop a route. |
String |
toString()
|
void |
warmUp()
Callback preparing the route to be started, by warming up the route. |
Methods inherited from class org.apache.camel.support.ServiceSupport |
---|
doResume, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspended, isSuspending, resume, shutdown, 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 |
---|
public DefaultRoute(RouteContext routeContext, Endpoint endpoint)
public DefaultRoute(RouteContext routeContext, Endpoint endpoint, Service... services)
Method Detail |
---|
public String toString()
toString
in class Object
public String getId()
Route
getId
in interface Route
public Endpoint getEndpoint()
Route
getEndpoint
in interface Route
public RouteContext getRouteContext()
Route
getRouteContext
in interface Route
public Map<String,Object> getProperties()
Route
getProperties
in interface Route
public void onStartingServices(List<Service> services) throws Exception
Route
onStartingServices
in interface Route
services
- the service
Exception
- is thrown in case of errorpublic List<Service> getServices()
Route
getServices
in interface Route
public void addService(Service service)
Route
addService
in interface Route
service
- the servicepublic void warmUp()
Route
warmUp
in interface Route
public void start() throws Exception
CamelContext.startRoute(String)
to start a route.
start
in interface Service
start
in class ServiceSupport
Exception
- is thrown if starting failedpublic void stop() throws Exception
CamelContext.stopRoute(String)
to stop a route.
stop
in interface Service
stop
in class ServiceSupport
Exception
- is thrown if stopping failedprotected void addServices(List<Service> services) throws Exception
Exception
protected void doStart() throws Exception
ServiceSupport
ServiceSupport.doStop()
for more details.
doStart
in class ServiceSupport
Exception
ServiceSupport.doStop()
protected void doStop() throws Exception
ServiceSupport
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.
doStop
in class ServiceSupport
Exception
ServiceSupport.doStart()
protected void doShutdown() throws Exception
ServiceSupport
doShutdown
in class ServiceSupport
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |