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, SUSPENDINGFields 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
ConstructorsConstructorDescriptionDefaultRoute(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 TypeMethodDescriptionvoidaddErrorHandler(org.apache.camel.ErrorHandlerFactory factory, org.apache.camel.NamedNode onException) voidaddErrorHandlerFactoryReference(org.apache.camel.ErrorHandlerFactory source, org.apache.camel.ErrorHandlerFactory target) voidaddService(org.apache.camel.Service service) voidaddService(org.apache.camel.Service service, boolean forceStop) voidprotected voidprotected voiddoStart()protected voiddoStop()List<org.apache.camel.Processor> protected voidgatherServices(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.CamelContextorg.apache.camel.Consumerorg.apache.camel.Endpointorg.apache.camel.ErrorHandlerFactorySet<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.RouteErrororg.apache.camel.spi.ManagementInterceptStrategyCollection<org.apache.camel.Processor> org.apache.camel.ProcessorgetOnException(String onExceptionId) Collection<org.apache.camel.Processor> org.apache.camel.Processororg.apache.camel.NamedNodegetRoute()org.apache.camel.spi.RouteControllerList<org.apache.camel.spi.RoutePolicy> List<org.apache.camel.Service> org.apache.camel.ShutdownRouteorg.apache.camel.ShutdownRunningTaskorg.apache.camel.spi.Resourcelongvoidbooleanbooleanbooleanbooleanorg.apache.camel.Navigate<org.apache.camel.Processor> navigate()voidsetAllowUseOriginalMessage(Boolean allowUseOriginalMessage) voidsetAutoStartup(Boolean autoStartup) voidsetAutowiredEnabled(Boolean autowiredEnabled) voidsetBacklogTracing(Boolean backlogTrace) voidsetCaseInsensitiveHeaders(Boolean caseInsensitiveHeaders) voidsetConsumerListener(org.apache.camel.resume.ConsumerListener<?, ?> consumerListener) voidsetDebugging(Boolean debugging) voidsetDelayer(Long delay) voidsetErrorHandlerFactory(org.apache.camel.ErrorHandlerFactory errorHandlerFactory) voidsetLastError(org.apache.camel.spi.RouteError routeError) voidsetLogExhaustedMessageBody(Boolean logExhaustedMessageBody) voidsetLogMask(Boolean logMask) voidsetManagementInterceptStrategy(org.apache.camel.spi.ManagementInterceptStrategy interceptStrategy) voidsetMessageHistory(Boolean messageHistory) voidsetOnCompletion(String onCompletionId, org.apache.camel.Processor processor) voidsetOnException(String onExceptionId, org.apache.camel.Processor processor) voidsetProcessor(org.apache.camel.Processor processor) voidsetResumeStrategy(org.apache.camel.resume.ResumeStrategy resumeStrategy) voidsetRouteController(org.apache.camel.spi.RouteController routeController) voidsetShutdownRoute(org.apache.camel.ShutdownRoute shutdownRoute) voidsetShutdownRunningTask(org.apache.camel.ShutdownRunningTask shutdownRunningTask) voidsetStartupOrder(Integer startupOrder) voidsetStreamCaching(Boolean cache) voidsetTracing(Boolean tracing) voidsetTracingPattern(String tracePattern) voidstart()Do not invoke this method directly, useRouteController.startRoute(String)to start a route.voidstop()Do not invoke this method directly, useRouteController.stopRoute(String)to stop a route.booleantoString()voidwarmUp()Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doSuspend, fail, getInternalLock, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, suspendMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.camel.Service
build, close, initMethods inherited from interface org.apache.camel.ShutdownableService
shutdownMethods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspendingMethods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Constructor Details
-
DefaultRoute
-
-
Method Details
-
getId
- Specified by:
getIdin interfaceorg.apache.camel.Route
-
getNodePrefixId
- Specified by:
getNodePrefixIdin interfaceorg.apache.camel.Route
-
isCustomId
public boolean isCustomId()- Specified by:
isCustomIdin interfaceorg.apache.camel.Route
-
isCreatedByRestDsl
public boolean isCreatedByRestDsl()- Specified by:
isCreatedByRestDslin interfaceorg.apache.camel.Route
-
isCreatedByRouteTemplate
public boolean isCreatedByRouteTemplate()- Specified by:
isCreatedByRouteTemplatein interfaceorg.apache.camel.Route
-
isCreatedByKamelet
public boolean isCreatedByKamelet()- Specified by:
isCreatedByKameletin interfaceorg.apache.camel.Route
-
getGroup
- Specified by:
getGroupin interfaceorg.apache.camel.Route
-
getUptime
- Specified by:
getUptimein interfaceorg.apache.camel.Route
-
getUptimeMillis
public long getUptimeMillis()- Specified by:
getUptimeMillisin interfaceorg.apache.camel.Route
-
getEndpoint
public org.apache.camel.Endpoint getEndpoint()- Specified by:
getEndpointin interfaceorg.apache.camel.Route
-
getCamelContext
public org.apache.camel.CamelContext getCamelContext()- Specified by:
getCamelContextin interfaceorg.apache.camel.Route
-
getProperties
- Specified by:
getPropertiesin interfaceorg.apache.camel.Route
-
getDescription
- Specified by:
getDescriptionin interfaceorg.apache.camel.Route
-
getConfigurationId
- Specified by:
getConfigurationIdin interfaceorg.apache.camel.Route
-
getSourceResource
public org.apache.camel.spi.Resource getSourceResource()- Specified by:
getSourceResourcein interfaceorg.apache.camel.Route
-
getSourceLocation
- Specified by:
getSourceLocationin interfaceorg.apache.camel.Route
-
getSourceLocationShort
- Specified by:
getSourceLocationShortin interfaceorg.apache.camel.Route
-
initializeServices
- Specified by:
initializeServicesin interfaceorg.apache.camel.Route- Throws:
Exception
-
getServices
- Specified by:
getServicesin interfaceorg.apache.camel.Route
-
addService
public void addService(org.apache.camel.Service service) - Specified by:
addServicein interfaceorg.apache.camel.Route
-
addService
public void addService(org.apache.camel.Service service, boolean forceStop) - Specified by:
addServicein interfaceorg.apache.camel.Route
-
warmUp
public void warmUp()- Specified by:
warmUpin interfaceorg.apache.camel.Route
-
start
public void start()Do not invoke this method directly, useRouteController.startRoute(String)to start a route.- Specified by:
startin interfaceorg.apache.camel.Service- Overrides:
startin 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:
stopin interfaceorg.apache.camel.Service- Overrides:
stopin classorg.apache.camel.support.service.BaseService
-
doStart
- Overrides:
doStartin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
doStop
- Overrides:
doStopin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
doShutdown
- Overrides:
doShutdownin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
getLastError
public org.apache.camel.spi.RouteError getLastError()- Specified by:
getLastErrorin interfaceorg.apache.camel.Route
-
setLastError
public void setLastError(org.apache.camel.spi.RouteError routeError) - Specified by:
setLastErrorin interfaceorg.apache.camel.Route
-
getStartupOrder
- Specified by:
getStartupOrderin interfaceorg.apache.camel.Route
-
setStartupOrder
- Specified by:
setStartupOrderin interfaceorg.apache.camel.Route
-
getRouteController
public org.apache.camel.spi.RouteController getRouteController()- Specified by:
getRouteControllerin interfaceorg.apache.camel.Route
-
setRouteController
public void setRouteController(org.apache.camel.spi.RouteController routeController) - Specified by:
setRouteControllerin interfaceorg.apache.camel.Route
-
isAutoStartup
- Specified by:
isAutoStartupin interfaceorg.apache.camel.Route- Specified by:
isAutoStartupin interfaceorg.apache.camel.RuntimeConfiguration
-
setAutoStartup
- Specified by:
setAutoStartupin interfaceorg.apache.camel.Route- Specified by:
setAutoStartupin interfaceorg.apache.camel.RuntimeConfiguration
-
getRoute
public org.apache.camel.NamedNode getRoute()- Specified by:
getRoutein interfaceorg.apache.camel.Route
-
clearRouteModel
public void clearRouteModel()- Specified by:
clearRouteModelin interfaceorg.apache.camel.Route
-
getRouteId
- Specified by:
getRouteIdin interfaceorg.apache.camel.Route
-
getRouteDescription
- Specified by:
getRouteDescriptionin interfaceorg.apache.camel.Route
-
getEventDrivenProcessors
- Specified by:
getEventDrivenProcessorsin interfaceorg.apache.camel.Route
-
getInterceptStrategies
- Specified by:
getInterceptStrategiesin interfaceorg.apache.camel.Route
-
setManagementInterceptStrategy
public void setManagementInterceptStrategy(org.apache.camel.spi.ManagementInterceptStrategy interceptStrategy) - Specified by:
setManagementInterceptStrategyin interfaceorg.apache.camel.Route
-
getManagementInterceptStrategy
public org.apache.camel.spi.ManagementInterceptStrategy getManagementInterceptStrategy()- Specified by:
getManagementInterceptStrategyin interfaceorg.apache.camel.Route
-
setTracing
- Specified by:
setTracingin interfaceorg.apache.camel.RuntimeConfiguration
-
isTracing
- Specified by:
isTracingin interfaceorg.apache.camel.RuntimeConfiguration
-
getTracingPattern
- Specified by:
getTracingPatternin interfaceorg.apache.camel.RuntimeConfiguration
-
setTracingPattern
- Specified by:
setTracingPatternin interfaceorg.apache.camel.RuntimeConfiguration
-
setBacklogTracing
- Specified by:
setBacklogTracingin interfaceorg.apache.camel.RuntimeConfiguration
-
isBacklogTracing
- Specified by:
isBacklogTracingin interfaceorg.apache.camel.RuntimeConfiguration
-
setDebugging
- Specified by:
setDebuggingin interfaceorg.apache.camel.RuntimeConfiguration
-
isDebugging
- Specified by:
isDebuggingin interfaceorg.apache.camel.RuntimeConfiguration
-
setMessageHistory
- Specified by:
setMessageHistoryin interfaceorg.apache.camel.RuntimeConfiguration
-
isMessageHistory
- Specified by:
isMessageHistoryin interfaceorg.apache.camel.RuntimeConfiguration
-
setLogMask
- Specified by:
setLogMaskin interfaceorg.apache.camel.RuntimeConfiguration
-
isLogMask
- Specified by:
isLogMaskin interfaceorg.apache.camel.RuntimeConfiguration
-
setLogExhaustedMessageBody
- Specified by:
setLogExhaustedMessageBodyin interfaceorg.apache.camel.RuntimeConfiguration
-
isLogExhaustedMessageBody
- Specified by:
isLogExhaustedMessageBodyin interfaceorg.apache.camel.RuntimeConfiguration
-
setStreamCaching
- Specified by:
setStreamCachingin interfaceorg.apache.camel.RuntimeConfiguration
-
isStreamCaching
- Specified by:
isStreamCachingin interfaceorg.apache.camel.RuntimeConfiguration
-
setDelayer
- Specified by:
setDelayerin interfaceorg.apache.camel.RuntimeConfiguration
-
getDelayer
- Specified by:
getDelayerin interfaceorg.apache.camel.RuntimeConfiguration
-
setErrorHandlerFactory
public void setErrorHandlerFactory(org.apache.camel.ErrorHandlerFactory errorHandlerFactory) - Specified by:
setErrorHandlerFactoryin interfaceorg.apache.camel.Route
-
getErrorHandlerFactory
public org.apache.camel.ErrorHandlerFactory getErrorHandlerFactory()- Specified by:
getErrorHandlerFactoryin interfaceorg.apache.camel.Route
-
setShutdownRoute
public void setShutdownRoute(org.apache.camel.ShutdownRoute shutdownRoute) - Specified by:
setShutdownRoutein interfaceorg.apache.camel.RuntimeConfiguration
-
setAllowUseOriginalMessage
- Specified by:
setAllowUseOriginalMessagein interfaceorg.apache.camel.RuntimeConfiguration
-
isAllowUseOriginalMessage
- Specified by:
isAllowUseOriginalMessagein interfaceorg.apache.camel.RuntimeConfiguration
-
isCaseInsensitiveHeaders
- Specified by:
isCaseInsensitiveHeadersin interfaceorg.apache.camel.RuntimeConfiguration
-
setCaseInsensitiveHeaders
- Specified by:
setCaseInsensitiveHeadersin interfaceorg.apache.camel.RuntimeConfiguration
-
isAutowiredEnabled
- Specified by:
isAutowiredEnabledin interfaceorg.apache.camel.RuntimeConfiguration
-
setAutowiredEnabled
- Specified by:
setAutowiredEnabledin interfaceorg.apache.camel.RuntimeConfiguration
-
getShutdownRoute
public org.apache.camel.ShutdownRoute getShutdownRoute()- Specified by:
getShutdownRoutein interfaceorg.apache.camel.RuntimeConfiguration
-
setShutdownRunningTask
public void setShutdownRunningTask(org.apache.camel.ShutdownRunningTask shutdownRunningTask) - Specified by:
setShutdownRunningTaskin interfaceorg.apache.camel.RuntimeConfiguration
-
getShutdownRunningTask
public org.apache.camel.ShutdownRunningTask getShutdownRunningTask()- Specified by:
getShutdownRunningTaskin interfaceorg.apache.camel.RuntimeConfiguration
-
getRoutePolicyList
- Specified by:
getRoutePolicyListin interfaceorg.apache.camel.Route
-
getOnCompletions
- Specified by:
getOnCompletionsin interfaceorg.apache.camel.Route
-
setOnCompletion
- Specified by:
setOnCompletionin interfaceorg.apache.camel.Route
-
getOnExceptions
- Specified by:
getOnExceptionsin interfaceorg.apache.camel.Route
-
getOnException
- Specified by:
getOnExceptionin interfaceorg.apache.camel.Route
-
setOnException
- Specified by:
setOnExceptionin interfaceorg.apache.camel.Route
-
getErrorHandlers
public Set<org.apache.camel.NamedNode> getErrorHandlers(org.apache.camel.ErrorHandlerFactory factory) - Specified by:
getErrorHandlersin interfaceorg.apache.camel.Route
-
addErrorHandler
public void addErrorHandler(org.apache.camel.ErrorHandlerFactory factory, org.apache.camel.NamedNode onException) - Specified by:
addErrorHandlerin interfaceorg.apache.camel.Route
-
addErrorHandlerFactoryReference
public void addErrorHandlerFactoryReference(org.apache.camel.ErrorHandlerFactory source, org.apache.camel.ErrorHandlerFactory target) - Specified by:
addErrorHandlerFactoryReferencein interfaceorg.apache.camel.Route
-
toString
-
getProcessor
public org.apache.camel.Processor getProcessor()- Specified by:
getProcessorin interfaceorg.apache.camel.Route
-
setProcessor
public void setProcessor(org.apache.camel.Processor processor) - Specified by:
setProcessorin 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:
filterin interfaceorg.apache.camel.Route
-
getConsumer
public org.apache.camel.Consumer getConsumer()- Specified by:
getConsumerin interfaceorg.apache.camel.Route
-
supportsSuspension
public boolean supportsSuspension()- Specified by:
supportsSuspensionin interfaceorg.apache.camel.Route
-
setResumeStrategy
public void setResumeStrategy(org.apache.camel.resume.ResumeStrategy resumeStrategy) - Specified by:
setResumeStrategyin interfaceorg.apache.camel.Route
-
setConsumerListener
public void setConsumerListener(org.apache.camel.resume.ConsumerListener<?, ?> consumerListener) - Specified by:
setConsumerListenerin interfaceorg.apache.camel.Route
-