public interface RouteContext extends RuntimeConfiguration, EndpointAware
Modifier and Type | Method and Description |
---|---|
void |
addAdvice(CamelInternalProcessorAdvice<?> advice) |
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 |
addEventDrivenProcessor(Processor processor)
Adds an event driven processor
|
void |
addInterceptStrategy(InterceptStrategy interceptStrategy)
Adds a InterceptStrategy to this route context
|
void |
addProperty(String key,
Object value) |
Route |
commit()
For completing the route creation, creating a single event driven route
for the current from endpoint with any processors required
|
CamelContext |
getCamelContext()
Gets the camel context
|
ErrorHandlerFactory |
getErrorHandlerFactory() |
Set<NamedNode> |
getErrorHandlers(ErrorHandlerFactory factory)
Gets the error handlers
|
List<InterceptStrategy> |
getInterceptStrategies()
This method retrieves the InterceptStrategy instances this route context.
|
default RouteError |
getLastError()
Gets the last error.
|
ManagementInterceptStrategy |
getManagementInterceptStrategy()
Gets the special managed intercept strategy if any
|
Processor |
getOnCompletion(String onCompletionId) |
Processor |
getOnException(String onExceptionId) |
NamedNode |
getRoute()
Get the route type
|
default RouteController |
getRouteController()
Gets the
RouteController for this route. |
String |
getRouteId()
Gets the route id
|
List<RoutePolicy> |
getRoutePolicyList()
Gets the route policy List
|
Integer |
getStartupOrder() |
Boolean |
isAutoStartup()
Gets whether the route should automatically start when Camel starts.
|
boolean |
isRouteAdded()
Returns the isRouteAdded flag
|
<T> T |
lookup(String name,
Class<T> type)
lookup an object by name and type
|
<T> Map<String,T> |
lookupByType(Class<T> type)
lookup objects by type
|
<T> T |
mandatoryLookup(String name,
Class<T> type)
lookup an object by name and type or throws
NoSuchBeanException if not found. |
Endpoint |
resolveEndpoint(String uri)
Resolves an endpoint from the URI
|
Endpoint |
resolveEndpoint(String uri,
String ref)
Resolves an endpoint from either a URI or a named reference
|
void |
setAutoStartup(Boolean autoStartup)
Sets whether the route should automatically start when Camel starts.
|
void |
setEndpoint(Endpoint endpoint) |
void |
setErrorHandlerFactory(ErrorHandlerFactory errorHandlerFactory) |
void |
setInterceptStrategies(List<InterceptStrategy> interceptStrategies)
This method sets the InterceptStrategy instances on this route context.
|
void |
setIsRouteAdded(boolean value)
If this flag is true,
org.apache.camel.reifier.ProcessorReifier#addRoutes(RouteContext)
will not add processor to addEventDrivenProcessor to the RouteContext and it
will prevent from adding an EventDrivenRoute. |
default 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) |
default void |
setRouteController(RouteController controller)
Sets the
RouteController for this route. |
void |
setRoutePolicyList(List<RoutePolicy> routePolicyList)
Sets a custom route policy List
|
void |
setStartupOrder(Integer startupOrder) |
getDelayer, getShutdownRoute, getShutdownRunningTask, isAllowUseOriginalMessage, isDebugging, isHandleFault, isLogExhaustedMessageBody, isLogMask, isMessageHistory, isStreamCaching, isTracing, setAllowUseOriginalMessage, setDebugging, setDelayer, setHandleFault, setLogExhaustedMessageBody, setLogMask, setMessageHistory, setShutdownRoute, setShutdownRunningTask, setStreamCaching, setTracing
getEndpoint
String getRouteId()
CamelContext getCamelContext()
Endpoint resolveEndpoint(String uri)
uri
- the URIEndpoint resolveEndpoint(String uri, String ref)
uri
- the URI orref
- the named reference<T> T lookup(String name, Class<T> type)
name
- the name to lookuptype
- the expected type<T> T mandatoryLookup(String name, Class<T> type)
NoSuchBeanException
if not found.name
- the name to lookuptype
- the expected type<T> Map<String,T> lookupByType(Class<T> type)
type
- the expected typeRoute commit()
void addEventDrivenProcessor(Processor processor)
processor
- the processorList<InterceptStrategy> getInterceptStrategies()
void setInterceptStrategies(List<InterceptStrategy> interceptStrategies)
interceptStrategies
- the strategiesvoid addInterceptStrategy(InterceptStrategy interceptStrategy)
interceptStrategy
- the strategyvoid setManagementInterceptStrategy(ManagementInterceptStrategy interceptStrategy)
interceptStrategy
- the managed intercept strategyManagementInterceptStrategy getManagementInterceptStrategy()
void setIsRouteAdded(boolean value)
org.apache.camel.reifier.ProcessorReifier#addRoutes(RouteContext)
will not add processor to addEventDrivenProcessor to the RouteContext and it
will prevent from adding an EventDrivenRoute.value
- the flagvoid setEndpoint(Endpoint endpoint)
boolean isRouteAdded()
List<RoutePolicy> getRoutePolicyList()
void setRoutePolicyList(List<RoutePolicy> routePolicyList)
routePolicyList
- the custom route policy listvoid setAutoStartup(Boolean autoStartup)
setAutoStartup
in interface RuntimeConfiguration
autoStartup
- whether to start up automatically.Boolean isAutoStartup()
isAutoStartup
in interface RuntimeConfiguration
void setStartupOrder(Integer startupOrder)
Integer getStartupOrder()
void setErrorHandlerFactory(ErrorHandlerFactory errorHandlerFactory)
ErrorHandlerFactory getErrorHandlerFactory()
void addAdvice(CamelInternalProcessorAdvice<?> advice)
void addProperty(String key, Object value)
default RouteError getLastError()
default void setLastError(RouteError error)
error
- the errordefault RouteController getRouteController()
RouteController
for this route.default void setRouteController(RouteController controller)
RouteController
for this route.controller
- the RouteControllerProcessor getOnCompletion(String onCompletionId)
void setOnCompletion(String onCompletionId, Processor processor)
Processor getOnException(String onExceptionId)
void setOnException(String onExceptionId, Processor processor)
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