public interface Route extends RuntimeConfiguration
Endpoint
within a CamelContext
.
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.Modifier and Type | Field and Description |
---|---|
static String |
CUSTOM_ID_PROPERTY |
static String |
DESCRIPTION_PROPERTY |
static String |
GROUP_PROPERTY |
static String |
ID_PROPERTY |
static String |
PARENT_PROPERTY |
static String |
REST_PROPERTY |
static String |
TEMPLATE_PROPERTY |
Modifier and Type | Method and Description |
---|---|
void |
addErrorHandler(ErrorHandlerFactory factory,
NamedNode exception)
Adds error handler for the given exception type
|
void |
addErrorHandlerFactoryReference(ErrorHandlerFactory source,
ErrorHandlerFactory target)
Link the error handlers from a factory to another
|
void |
addService(Service service)
Adds a service to this route
|
void |
clearRouteModel()
Clears the route model when its no longer needed.
|
List<Processor> |
filter(String pattern)
Returns a list of all the
Processor s from this route that has id's matching the pattern |
CamelContext |
getCamelContext()
Gets the camel context
|
Consumer |
getConsumer()
Gets the inbound
Consumer |
String |
getDescription()
Gets the route description (if any has been configured).
|
Endpoint |
getEndpoint()
Gets the input endpoint for this route.
|
ErrorHandlerFactory |
getErrorHandlerFactory() |
Set<NamedNode> |
getErrorHandlers(ErrorHandlerFactory factory)
Gets the error handlers
|
List<Processor> |
getEventDrivenProcessors()
This method retrieves the event driven Processors on this route context.
|
String |
getGroup()
Gets the route group
|
String |
getId()
Gets the route id
|
List<InterceptStrategy> |
getInterceptStrategies()
This method retrieves the InterceptStrategy instances this route context.
|
RouteError |
getLastError()
Gets the last error.
|
ManagementInterceptStrategy |
getManagementInterceptStrategy()
Gets the special managed intercept strategy if any
|
Collection<Processor> |
getOnCompletions() |
Processor |
getOnException(String onExceptionId) |
Collection<Processor> |
getOnExceptions() |
Processor |
getProcessor()
Gets the
Processor |
Map<String,Object> |
getProperties()
This property map is used to associate information about the route.
|
NamedNode |
getRoute()
Get the route type.
|
RouteController |
getRouteController()
Gets the
RouteController for this route. |
String |
getRouteDescription()
Gets the route description
|
String |
getRouteId()
Gets the route id
|
List<RoutePolicy> |
getRoutePolicyList()
Gets the route policy List
|
List<Service> |
getServices()
Returns the services for this particular route
|
Integer |
getStartupOrder()
Gets the route startup order
|
String |
getUptime()
Gets the uptime in a human readable format
|
long |
getUptimeMillis()
Gets the uptime in milliseconds
|
void |
initializeServices()
A strategy callback allowing special initialization when services are initializing.
|
Boolean |
isAutoStartup()
Gets whether the route should automatically start when Camel starts.
|
Navigate<Processor> |
navigate()
Returns a navigator to navigate this route by navigating all the
Processor s. |
void |
setAutoStartup(Boolean autoStartup)
Sets whether the route should automatically start when Camel starts.
|
void |
setErrorHandlerFactory(ErrorHandlerFactory errorHandlerFactory) |
void |
setLastError(RouteError error)
Sets the last error.
|
void |
setManagementInterceptStrategy(ManagementInterceptStrategy interceptStrategy)
Sets a special intercept strategy for management.
|
void |
setOnCompletion(String onCompletionId,
Processor processor) |
void |
setOnException(String onExceptionId,
Processor processor) |
void |
setProcessor(Processor processor)
Sets the
Processor |
void |
setRouteController(RouteController controller)
Sets the
RouteController for this route. |
void |
setStartupOrder(Integer startupOrder)
Sets the route startup order
|
boolean |
supportsSuspension()
Whether or not the route supports suspension (suspend and resume)
|
void |
warmUp()
Callback preparing the route to be started, by warming up the route.
|
getDelayer, getShutdownRoute, getShutdownRunningTask, getTracingPattern, isAllowUseOriginalMessage, isAutowiredEnabled, isBacklogTracing, isCaseInsensitiveHeaders, isDebugging, isLogExhaustedMessageBody, isLogMask, isMessageHistory, isStreamCaching, isTracing, setAllowUseOriginalMessage, setAutowiredEnabled, setBacklogTracing, setCaseInsensitiveHeaders, setDebugging, setDelayer, setLogExhaustedMessageBody, setLogMask, setMessageHistory, setShutdownRoute, setShutdownRunningTask, setStreamCaching, setTracing, setTracingPattern
static final String ID_PROPERTY
static final String CUSTOM_ID_PROPERTY
static final String PARENT_PROPERTY
static final String GROUP_PROPERTY
static final String REST_PROPERTY
static final String TEMPLATE_PROPERTY
static final String DESCRIPTION_PROPERTY
String getId()
String getGroup()
String getUptime()
long getUptimeMillis()
boolean supportsSuspension()
Map<String,Object> getProperties()
String getDescription()
DESCRIPTION_PROPERTY
as key in the getProperties()
.CamelContext getCamelContext()
Endpoint getEndpoint()
void initializeServices() throws Exception
Exception
- is thrown in case of errorList<Service> getServices()
void addService(Service service)
service
- the serviceNavigate<Processor> navigate()
Processor
s.Processor
.List<Processor> filter(String pattern)
Processor
s from this route that has id's matching the patternpattern
- the pattern to match by idsProcessor
, is never null.void warmUp()
RouteError getLastError()
void setLastError(RouteError error)
error
- the errorInteger getStartupOrder()
void setStartupOrder(Integer startupOrder)
RouteController getRouteController()
RouteController
for this route.void setRouteController(RouteController controller)
RouteController
for this route.controller
- the RouteControllervoid setAutoStartup(Boolean autoStartup)
setAutoStartup
in interface RuntimeConfiguration
autoStartup
- whether to start up automatically.Boolean isAutoStartup()
isAutoStartup
in interface RuntimeConfiguration
String getRouteId()
String getRouteDescription()
NamedNode getRoute()
void clearRouteModel()
List<Processor> getEventDrivenProcessors()
List<InterceptStrategy> getInterceptStrategies()
void setManagementInterceptStrategy(ManagementInterceptStrategy interceptStrategy)
interceptStrategy
- the managed intercept strategyManagementInterceptStrategy getManagementInterceptStrategy()
List<RoutePolicy> getRoutePolicyList()
void setErrorHandlerFactory(ErrorHandlerFactory errorHandlerFactory)
ErrorHandlerFactory getErrorHandlerFactory()
Collection<Processor> getOnCompletions()
Collection<Processor> getOnExceptions()
void addErrorHandler(ErrorHandlerFactory factory, NamedNode exception)
factory
- the error handler factoryexception
- the exception to handleSet<NamedNode> getErrorHandlers(ErrorHandlerFactory factory)
factory
- the error handler factoryvoid addErrorHandlerFactoryReference(ErrorHandlerFactory source, ErrorHandlerFactory target)
source
- the source factorytarget
- the target factoryApache Camel