public class DefaultRouteContext extends Object implements RouteContext
| Constructor and Description |
|---|
DefaultRouteContext(CamelContext camelContext)
Only used for lazy construction from inside ExpressionType
|
DefaultRouteContext(CamelContext camelContext,
RouteDefinition route,
FromDefinition from,
Collection<Route> routes) |
| Modifier and Type | Method and Description |
|---|---|
void |
addEventDrivenProcessor(Processor processor)
Adds an event driven processor
|
void |
addInterceptStrategy(InterceptStrategy interceptStrategy)
Adds a InterceptStrategy to this route context
|
void |
commit()
For completing the route creation, creating a single event driven route
for the current from endpoint with any processors required
|
int |
getAndIncrement(ProcessorDefinition<?> node)
A private counter that increments, is used to as book keeping
when building a route based on the model
We need this special book keeping be able to assign the correct
ProcessorDefinition to the Channel |
CamelContext |
getCamelContext()
Gets the camel context
|
Long |
getDelayer()
Gets the delay value
|
Endpoint |
getEndpoint()
Gets the endpoint
|
FromDefinition |
getFrom()
Gets the from type
|
List<InterceptStrategy> |
getInterceptStrategies()
This method retrieves the InterceptStrategy instances this route context.
|
InterceptStrategy |
getManagedInterceptStrategy()
Gets the special managed intercept strategy if any
|
RouteDefinition |
getRoute()
Get the route type
|
List<RoutePolicy> |
getRoutePolicyList()
Gets the route policy List
|
ShutdownRoute |
getShutdownRoute()
Gets the option to use when shutting down the route.
|
ShutdownRunningTask |
getShutdownRunningTask()
Gets the ShutdownRunningTask option in use when shutting down a route.
|
Boolean |
isAutoStartup()
Gets whether the object should automatically start when Camel starts.
|
Boolean |
isHandleFault()
Returns whether fault handling enabled
|
Boolean |
isMessageHistory()
Returns whether message history is enabled
|
boolean |
isRouteAdded()
Returns the isRouteAdded flag
|
Boolean |
isStreamCaching()
Returns whether stream cache is enabled
|
Boolean |
isTracing()
Returns whether tracing enabled
|
<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 object should automatically start when Camel starts.
|
void |
setDelayer(Long delay)
Sets a delay value in millis that a message is delayed at every step it takes in the route path,
slowing the process down to better observe what is occurring
Is disabled by default
|
void |
setHandleFault(Boolean handleFault)
Sets whether fault handling is enabled or not (default is disabled).
|
void |
setInterceptStrategies(List<InterceptStrategy> interceptStrategies)
This method sets the InterceptStrategy instances on this route context.
|
void |
setIsRouteAdded(boolean routeAdded)
If this flag is true,
ProcessorDefinition.addRoutes(RouteContext, java.util.Collection)
will not add processor to addEventDrivenProcessor to the RouteContext and it
will prevent from adding an EventDrivenRoute. |
void |
setManagedInterceptStrategy(InterceptStrategy interceptStrategy)
Sets a special intercept strategy for management.
|
void |
setMessageHistory(Boolean messageHistory)
Sets whether message history is enabled or not (default is enabled).
|
void |
setRoutePolicyList(List<RoutePolicy> routePolicyList)
Sets a custom route policy List
|
void |
setShutdownRoute(ShutdownRoute shutdownRoute)
Sets the ShutdownRoute option for routes.
|
void |
setShutdownRunningTask(ShutdownRunningTask shutdownRunningTask)
Sets the ShutdownRunningTask option to use when shutting down a route.
|
void |
setStreamCaching(Boolean cache)
Sets whether stream caching is enabled or not (default is disabled).
|
void |
setTracing(Boolean tracing)
Sets whether tracing is enabled or not (default is disabled).
|
public DefaultRouteContext(CamelContext camelContext, RouteDefinition route, FromDefinition from, Collection<Route> routes)
public DefaultRouteContext(CamelContext camelContext)
public Endpoint getEndpoint()
RouteContextgetEndpoint in interface RouteContextpublic FromDefinition getFrom()
RouteContextgetFrom in interface RouteContextpublic RouteDefinition getRoute()
RouteContextgetRoute in interface RouteContextpublic CamelContext getCamelContext()
RouteContextgetCamelContext in interface RouteContextpublic Endpoint resolveEndpoint(String uri)
RouteContextresolveEndpoint in interface RouteContexturi - the URIpublic Endpoint resolveEndpoint(String uri, String ref)
RouteContextresolveEndpoint in interface RouteContexturi - the URI orref - the named referencepublic <T> T lookup(String name, Class<T> type)
RouteContextlookup in interface RouteContextname - the name to lookuptype - the expected typepublic <T> Map<String,T> lookupByType(Class<T> type)
RouteContextlookupByType in interface RouteContexttype - the expected typepublic <T> T mandatoryLookup(String name, Class<T> type)
RouteContextNoSuchBeanException if not found.mandatoryLookup in interface RouteContextname - the name to lookuptype - the expected typepublic void commit()
RouteContextcommit in interface RouteContextpublic void addEventDrivenProcessor(Processor processor)
RouteContextaddEventDrivenProcessor in interface RouteContextprocessor - the processorpublic List<InterceptStrategy> getInterceptStrategies()
RouteContextgetInterceptStrategies in interface RouteContextpublic void setInterceptStrategies(List<InterceptStrategy> interceptStrategies)
RouteContextsetInterceptStrategies in interface RouteContextinterceptStrategies - the strategiespublic void addInterceptStrategy(InterceptStrategy interceptStrategy)
RouteContextaddInterceptStrategy in interface RouteContextinterceptStrategy - the strategypublic void setManagedInterceptStrategy(InterceptStrategy interceptStrategy)
RouteContextsetManagedInterceptStrategy in interface RouteContextinterceptStrategy - the managed intercept strategypublic InterceptStrategy getManagedInterceptStrategy()
RouteContextgetManagedInterceptStrategy in interface RouteContextpublic boolean isRouteAdded()
RouteContextisRouteAdded in interface RouteContextpublic void setIsRouteAdded(boolean routeAdded)
RouteContextProcessorDefinition.addRoutes(RouteContext, java.util.Collection)
will not add processor to addEventDrivenProcessor to the RouteContext and it
will prevent from adding an EventDrivenRoute.setIsRouteAdded in interface RouteContextrouteAdded - the flagpublic void setTracing(Boolean tracing)
RuntimeConfigurationsetTracing in interface RuntimeConfigurationtracing - whether to enable tracing.public Boolean isTracing()
RuntimeConfigurationisTracing in interface RuntimeConfigurationpublic void setMessageHistory(Boolean messageHistory)
RuntimeConfigurationsetMessageHistory in interface RuntimeConfigurationmessageHistory - whether message history is enabledpublic Boolean isMessageHistory()
RuntimeConfigurationisMessageHistory in interface RuntimeConfigurationpublic void setStreamCaching(Boolean cache)
RuntimeConfigurationsetStreamCaching in interface RuntimeConfigurationcache - whether stream caching is enabled or notpublic Boolean isStreamCaching()
RuntimeConfigurationisStreamCaching in interface RuntimeConfigurationpublic void setHandleFault(Boolean handleFault)
RuntimeConfigurationsetHandleFault in interface RuntimeConfigurationhandleFault - whether to enable fault handling.public Boolean isHandleFault()
RuntimeConfigurationisHandleFault in interface RuntimeConfigurationpublic void setDelayer(Long delay)
RuntimeConfigurationsetDelayer in interface RuntimeConfigurationdelay - delay in millispublic Long getDelayer()
RuntimeConfigurationgetDelayer in interface RuntimeConfigurationpublic void setAutoStartup(Boolean autoStartup)
RuntimeConfigurationCamelContexts are always started.
CamelContext then that takes precedence
and no routes is started. You would need to start CamelContext explicit using
the CamelContext.start() method, to start the context and the routes.
Default is true to always start up.setAutoStartup in interface RuntimeConfigurationautoStartup - whether to start up automatically.public Boolean isAutoStartup()
RuntimeConfigurationCamelContexts are always started.
isAutoStartup in interface RuntimeConfigurationpublic void setShutdownRoute(ShutdownRoute shutdownRoute)
RuntimeConfigurationsetShutdownRoute in interface RuntimeConfigurationshutdownRoute - the option to use.public ShutdownRoute getShutdownRoute()
RuntimeConfigurationgetShutdownRoute in interface RuntimeConfigurationpublic void setShutdownRunningTask(ShutdownRunningTask shutdownRunningTask)
RuntimeConfigurationsetShutdownRunningTask in interface RuntimeConfigurationshutdownRunningTask - the option to use.public ShutdownRunningTask getShutdownRunningTask()
RuntimeConfigurationgetShutdownRunningTask in interface RuntimeConfigurationpublic int getAndIncrement(ProcessorDefinition<?> node)
RouteContextProcessorDefinition to the ChannelgetAndIncrement in interface RouteContextnode - the current nodepublic void setRoutePolicyList(List<RoutePolicy> routePolicyList)
RouteContextsetRoutePolicyList in interface RouteContextroutePolicyList - the custom route policy listpublic List<RoutePolicy> getRoutePolicyList()
RouteContextgetRoutePolicyList in interface RouteContextApache Camel