Package org.apache.camel.impl.engine
Class DefaultRoute
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.impl.engine.DefaultRoute
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.Route
,org.apache.camel.RuntimeConfiguration
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
public class DefaultRoute
extends org.apache.camel.support.service.ServiceSupport
implements org.apache.camel.Route
Default implementation of
Route
.
Use the API from CamelContext
to control the lifecycle of a route, such as starting and
stopping using the RouteController.startRoute(String)
and
RouteController.stopRoute(String)
methods.-
Field Summary
Fields inherited from class org.apache.camel.support.service.BaseService
BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
Fields inherited from interface org.apache.camel.Route
CONFIGURATION_ID_PROPERTY, CUSTOM_ID_PROPERTY, DESCRIPTION_PROPERTY, GROUP_PROPERTY, ID_PROPERTY, KAMELET_PROPERTY, NODE_PREFIX_ID_PROPERTY, PARENT_PROPERTY, REST_PROPERTY, SUPERVISED, TEMPLATE_PROPERTY
-
Constructor Summary
ConstructorDescriptionDefaultRoute
(org.apache.camel.CamelContext camelContext, org.apache.camel.NamedNode route, String routeId, String routeDescription, org.apache.camel.Endpoint endpoint, org.apache.camel.spi.Resource resource) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addErrorHandler
(org.apache.camel.ErrorHandlerFactory factory, org.apache.camel.NamedNode onException) void
addErrorHandlerFactoryReference
(org.apache.camel.ErrorHandlerFactory source, org.apache.camel.ErrorHandlerFactory target) void
addService
(org.apache.camel.Service service) void
protected void
protected void
doStart()
protected void
doStop()
List
<org.apache.camel.Processor> protected void
gatherServices
(List<org.apache.camel.Service> services) Factory method to lazily create the complete list of services required for this route such as adding the processor or consumerorg.apache.camel.CamelContext
org.apache.camel.Consumer
org.apache.camel.Endpoint
org.apache.camel.ErrorHandlerFactory
Set
<org.apache.camel.NamedNode> getErrorHandlers
(org.apache.camel.ErrorHandlerFactory factory) List
<org.apache.camel.Processor> getGroup()
getId()
List
<org.apache.camel.spi.InterceptStrategy> org.apache.camel.spi.RouteError
org.apache.camel.spi.ManagementInterceptStrategy
Collection
<org.apache.camel.Processor> org.apache.camel.Processor
getOnException
(String onExceptionId) Collection
<org.apache.camel.Processor> org.apache.camel.Processor
org.apache.camel.NamedNode
getRoute()
org.apache.camel.spi.RouteController
List
<org.apache.camel.spi.RoutePolicy> List
<org.apache.camel.Service> org.apache.camel.ShutdownRoute
org.apache.camel.ShutdownRunningTask
org.apache.camel.spi.Resource
long
void
boolean
boolean
boolean
boolean
org.apache.camel.Navigate
<org.apache.camel.Processor> navigate()
void
setAllowUseOriginalMessage
(Boolean allowUseOriginalMessage) void
setAutoStartup
(Boolean autoStartup) void
setAutowiredEnabled
(Boolean autowiredEnabled) void
setBacklogTracing
(Boolean backlogTrace) void
setCaseInsensitiveHeaders
(Boolean caseInsensitiveHeaders) void
setConsumerListener
(org.apache.camel.resume.ConsumerListener<?, ?> consumerListener) void
setDebugging
(Boolean debugging) void
setDelayer
(Long delay) void
setErrorHandlerFactory
(org.apache.camel.ErrorHandlerFactory errorHandlerFactory) void
setLastError
(org.apache.camel.spi.RouteError routeError) void
setLogExhaustedMessageBody
(Boolean logExhaustedMessageBody) void
setLogMask
(Boolean logMask) void
setManagementInterceptStrategy
(org.apache.camel.spi.ManagementInterceptStrategy interceptStrategy) void
setMessageHistory
(Boolean messageHistory) void
setOnCompletion
(String onCompletionId, org.apache.camel.Processor processor) void
setOnException
(String onExceptionId, org.apache.camel.Processor processor) void
setProcessor
(org.apache.camel.Processor processor) void
setResumeStrategy
(org.apache.camel.resume.ResumeStrategy resumeStrategy) void
setRouteController
(org.apache.camel.spi.RouteController routeController) void
setShutdownRoute
(org.apache.camel.ShutdownRoute shutdownRoute) void
setShutdownRunningTask
(org.apache.camel.ShutdownRunningTask shutdownRunningTask) void
setStartupOrder
(Integer startupOrder) void
setStreamCaching
(Boolean cache) void
setTracing
(Boolean tracing) void
setTracingPattern
(String tracePattern) void
start()
Do not invoke this method directly, useRouteController.startRoute(String)
to start a route.void
stop()
Do not invoke this method directly, useRouteController.stopRoute(String)
to stop a route.boolean
toString()
void
warmUp()
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, 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.Service
build, close, init
Methods inherited from interface org.apache.camel.ShutdownableService
shutdown
Methods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending
Methods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Constructor Details
-
DefaultRoute
-
-
Method Details
-
getId
- Specified by:
getId
in interfaceorg.apache.camel.Route
-
getNodePrefixId
- Specified by:
getNodePrefixId
in interfaceorg.apache.camel.Route
-
isCustomId
public boolean isCustomId()- Specified by:
isCustomId
in interfaceorg.apache.camel.Route
-
isCreatedByRestDsl
public boolean isCreatedByRestDsl()- Specified by:
isCreatedByRestDsl
in interfaceorg.apache.camel.Route
-
isCreatedByRouteTemplate
public boolean isCreatedByRouteTemplate()- Specified by:
isCreatedByRouteTemplate
in interfaceorg.apache.camel.Route
-
isCreatedByKamelet
public boolean isCreatedByKamelet()- Specified by:
isCreatedByKamelet
in interfaceorg.apache.camel.Route
-
getGroup
- Specified by:
getGroup
in interfaceorg.apache.camel.Route
-
getUptime
- Specified by:
getUptime
in interfaceorg.apache.camel.Route
-
getUptimeMillis
public long getUptimeMillis()- Specified by:
getUptimeMillis
in interfaceorg.apache.camel.Route
-
getEndpoint
public org.apache.camel.Endpoint getEndpoint()- Specified by:
getEndpoint
in interfaceorg.apache.camel.Route
-
getCamelContext
public org.apache.camel.CamelContext getCamelContext()- Specified by:
getCamelContext
in interfaceorg.apache.camel.Route
-
getProperties
- Specified by:
getProperties
in interfaceorg.apache.camel.Route
-
getDescription
- Specified by:
getDescription
in interfaceorg.apache.camel.Route
-
getConfigurationId
- Specified by:
getConfigurationId
in interfaceorg.apache.camel.Route
-
getSourceResource
public org.apache.camel.spi.Resource getSourceResource()- Specified by:
getSourceResource
in interfaceorg.apache.camel.Route
-
getSourceLocation
- Specified by:
getSourceLocation
in interfaceorg.apache.camel.Route
-
getSourceLocationShort
- Specified by:
getSourceLocationShort
in interfaceorg.apache.camel.Route
-
initializeServices
- Specified by:
initializeServices
in interfaceorg.apache.camel.Route
- Throws:
Exception
-
getServices
- Specified by:
getServices
in interfaceorg.apache.camel.Route
-
addService
public void addService(org.apache.camel.Service service) - Specified by:
addService
in interfaceorg.apache.camel.Route
-
warmUp
public void warmUp()- Specified by:
warmUp
in interfaceorg.apache.camel.Route
-
start
public void start()Do not invoke this method directly, useRouteController.startRoute(String)
to start a route.- Specified by:
start
in interfaceorg.apache.camel.Service
- Overrides:
start
in classorg.apache.camel.support.service.BaseService
-
stop
public void stop()Do not invoke this method directly, useRouteController.stopRoute(String)
to stop a route.- Specified by:
stop
in interfaceorg.apache.camel.Service
- Overrides:
stop
in classorg.apache.camel.support.service.BaseService
-
doStart
- Overrides:
doStart
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
doStop
- Overrides:
doStop
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
doShutdown
- Overrides:
doShutdown
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
getLastError
public org.apache.camel.spi.RouteError getLastError()- Specified by:
getLastError
in interfaceorg.apache.camel.Route
-
setLastError
public void setLastError(org.apache.camel.spi.RouteError routeError) - Specified by:
setLastError
in interfaceorg.apache.camel.Route
-
getStartupOrder
- Specified by:
getStartupOrder
in interfaceorg.apache.camel.Route
-
setStartupOrder
- Specified by:
setStartupOrder
in interfaceorg.apache.camel.Route
-
getRouteController
public org.apache.camel.spi.RouteController getRouteController()- Specified by:
getRouteController
in interfaceorg.apache.camel.Route
-
setRouteController
public void setRouteController(org.apache.camel.spi.RouteController routeController) - Specified by:
setRouteController
in interfaceorg.apache.camel.Route
-
isAutoStartup
- Specified by:
isAutoStartup
in interfaceorg.apache.camel.Route
- Specified by:
isAutoStartup
in interfaceorg.apache.camel.RuntimeConfiguration
-
setAutoStartup
- Specified by:
setAutoStartup
in interfaceorg.apache.camel.Route
- Specified by:
setAutoStartup
in interfaceorg.apache.camel.RuntimeConfiguration
-
getRoute
public org.apache.camel.NamedNode getRoute()- Specified by:
getRoute
in interfaceorg.apache.camel.Route
-
clearRouteModel
public void clearRouteModel()- Specified by:
clearRouteModel
in interfaceorg.apache.camel.Route
-
getRouteId
- Specified by:
getRouteId
in interfaceorg.apache.camel.Route
-
getRouteDescription
- Specified by:
getRouteDescription
in interfaceorg.apache.camel.Route
-
getEventDrivenProcessors
- Specified by:
getEventDrivenProcessors
in interfaceorg.apache.camel.Route
-
getInterceptStrategies
- Specified by:
getInterceptStrategies
in interfaceorg.apache.camel.Route
-
setManagementInterceptStrategy
public void setManagementInterceptStrategy(org.apache.camel.spi.ManagementInterceptStrategy interceptStrategy) - Specified by:
setManagementInterceptStrategy
in interfaceorg.apache.camel.Route
-
getManagementInterceptStrategy
public org.apache.camel.spi.ManagementInterceptStrategy getManagementInterceptStrategy()- Specified by:
getManagementInterceptStrategy
in interfaceorg.apache.camel.Route
-
setTracing
- Specified by:
setTracing
in interfaceorg.apache.camel.RuntimeConfiguration
-
isTracing
- Specified by:
isTracing
in interfaceorg.apache.camel.RuntimeConfiguration
-
getTracingPattern
- Specified by:
getTracingPattern
in interfaceorg.apache.camel.RuntimeConfiguration
-
setTracingPattern
- Specified by:
setTracingPattern
in interfaceorg.apache.camel.RuntimeConfiguration
-
setBacklogTracing
- Specified by:
setBacklogTracing
in interfaceorg.apache.camel.RuntimeConfiguration
-
isBacklogTracing
- Specified by:
isBacklogTracing
in interfaceorg.apache.camel.RuntimeConfiguration
-
setDebugging
- Specified by:
setDebugging
in interfaceorg.apache.camel.RuntimeConfiguration
-
isDebugging
- Specified by:
isDebugging
in interfaceorg.apache.camel.RuntimeConfiguration
-
setMessageHistory
- Specified by:
setMessageHistory
in interfaceorg.apache.camel.RuntimeConfiguration
-
isMessageHistory
- Specified by:
isMessageHistory
in interfaceorg.apache.camel.RuntimeConfiguration
-
setLogMask
- Specified by:
setLogMask
in interfaceorg.apache.camel.RuntimeConfiguration
-
isLogMask
- Specified by:
isLogMask
in interfaceorg.apache.camel.RuntimeConfiguration
-
setLogExhaustedMessageBody
- Specified by:
setLogExhaustedMessageBody
in interfaceorg.apache.camel.RuntimeConfiguration
-
isLogExhaustedMessageBody
- Specified by:
isLogExhaustedMessageBody
in interfaceorg.apache.camel.RuntimeConfiguration
-
setStreamCaching
- Specified by:
setStreamCaching
in interfaceorg.apache.camel.RuntimeConfiguration
-
isStreamCaching
- Specified by:
isStreamCaching
in interfaceorg.apache.camel.RuntimeConfiguration
-
setDelayer
- Specified by:
setDelayer
in interfaceorg.apache.camel.RuntimeConfiguration
-
getDelayer
- Specified by:
getDelayer
in interfaceorg.apache.camel.RuntimeConfiguration
-
setErrorHandlerFactory
public void setErrorHandlerFactory(org.apache.camel.ErrorHandlerFactory errorHandlerFactory) - Specified by:
setErrorHandlerFactory
in interfaceorg.apache.camel.Route
-
getErrorHandlerFactory
public org.apache.camel.ErrorHandlerFactory getErrorHandlerFactory()- Specified by:
getErrorHandlerFactory
in interfaceorg.apache.camel.Route
-
setShutdownRoute
public void setShutdownRoute(org.apache.camel.ShutdownRoute shutdownRoute) - Specified by:
setShutdownRoute
in interfaceorg.apache.camel.RuntimeConfiguration
-
setAllowUseOriginalMessage
- Specified by:
setAllowUseOriginalMessage
in interfaceorg.apache.camel.RuntimeConfiguration
-
isAllowUseOriginalMessage
- Specified by:
isAllowUseOriginalMessage
in interfaceorg.apache.camel.RuntimeConfiguration
-
isCaseInsensitiveHeaders
- Specified by:
isCaseInsensitiveHeaders
in interfaceorg.apache.camel.RuntimeConfiguration
-
setCaseInsensitiveHeaders
- Specified by:
setCaseInsensitiveHeaders
in interfaceorg.apache.camel.RuntimeConfiguration
-
isAutowiredEnabled
- Specified by:
isAutowiredEnabled
in interfaceorg.apache.camel.RuntimeConfiguration
-
setAutowiredEnabled
- Specified by:
setAutowiredEnabled
in interfaceorg.apache.camel.RuntimeConfiguration
-
getShutdownRoute
public org.apache.camel.ShutdownRoute getShutdownRoute()- Specified by:
getShutdownRoute
in interfaceorg.apache.camel.RuntimeConfiguration
-
setShutdownRunningTask
public void setShutdownRunningTask(org.apache.camel.ShutdownRunningTask shutdownRunningTask) - Specified by:
setShutdownRunningTask
in interfaceorg.apache.camel.RuntimeConfiguration
-
getShutdownRunningTask
public org.apache.camel.ShutdownRunningTask getShutdownRunningTask()- Specified by:
getShutdownRunningTask
in interfaceorg.apache.camel.RuntimeConfiguration
-
getRoutePolicyList
- Specified by:
getRoutePolicyList
in interfaceorg.apache.camel.Route
-
getOnCompletions
- Specified by:
getOnCompletions
in interfaceorg.apache.camel.Route
-
setOnCompletion
- Specified by:
setOnCompletion
in interfaceorg.apache.camel.Route
-
getOnExceptions
- Specified by:
getOnExceptions
in interfaceorg.apache.camel.Route
-
getOnException
- Specified by:
getOnException
in interfaceorg.apache.camel.Route
-
setOnException
- Specified by:
setOnException
in interfaceorg.apache.camel.Route
-
getErrorHandlers
public Set<org.apache.camel.NamedNode> getErrorHandlers(org.apache.camel.ErrorHandlerFactory factory) - Specified by:
getErrorHandlers
in interfaceorg.apache.camel.Route
-
addErrorHandler
public void addErrorHandler(org.apache.camel.ErrorHandlerFactory factory, org.apache.camel.NamedNode onException) - Specified by:
addErrorHandler
in interfaceorg.apache.camel.Route
-
addErrorHandlerFactoryReference
public void addErrorHandlerFactoryReference(org.apache.camel.ErrorHandlerFactory source, org.apache.camel.ErrorHandlerFactory target) - Specified by:
addErrorHandlerFactoryReference
in interfaceorg.apache.camel.Route
-
toString
-
getProcessor
public org.apache.camel.Processor getProcessor()- Specified by:
getProcessor
in interfaceorg.apache.camel.Route
-
setProcessor
public void setProcessor(org.apache.camel.Processor processor) - Specified by:
setProcessor
in interfaceorg.apache.camel.Route
-
gatherServices
Factory method to lazily create the complete list of services required for this route such as adding the processor or consumer- Throws:
Exception
-
filter
- Specified by:
filter
in interfaceorg.apache.camel.Route
-
getConsumer
public org.apache.camel.Consumer getConsumer()- Specified by:
getConsumer
in interfaceorg.apache.camel.Route
-
supportsSuspension
public boolean supportsSuspension()- Specified by:
supportsSuspension
in interfaceorg.apache.camel.Route
-
setResumeStrategy
public void setResumeStrategy(org.apache.camel.resume.ResumeStrategy resumeStrategy) - Specified by:
setResumeStrategy
in interfaceorg.apache.camel.Route
-
setConsumerListener
public void setConsumerListener(org.apache.camel.resume.ConsumerListener<?, ?> consumerListener) - Specified by:
setConsumerListener
in interfaceorg.apache.camel.Route
-