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 associated with an object.
|
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 |
isAllowUseOriginalMessage()
Sets whether to allow access to the original message from Camel's error handler,
or from
UnitOfWork.getOriginalInMessage() . |
Boolean |
isAutoStartup()
Gets whether the object should automatically start when Camel starts.
|
Boolean |
isHandleFault()
Returns whether fault handling enabled
|
Boolean |
isLogExhaustedMessageBody()
Returns whether to log exhausted message body with message history.
|
Boolean |
isLogMask()
Gets whether security mask for Logging is enabled or not.
|
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 |
setAllowUseOriginalMessage(Boolean allowUseOriginalMessage)
Sets whether to allow access to the original message from Camel's error handler,
or from
UnitOfWork.getOriginalInMessage() . |
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 |
setLogExhaustedMessageBody(Boolean logExhaustedMessageBody)
Sets whether to log exhausted message body with message history.
|
void |
setLogMask(Boolean logMask)
Sets whether security mask for Logging is enabled or not (default is disabled).
|
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()
EndpointAware
Producer
or for consuming from for components like Consumer
or Route
getEndpoint
in interface EndpointAware
public FromDefinition getFrom()
RouteContext
getFrom
in interface RouteContext
public RouteDefinition getRoute()
RouteContext
getRoute
in interface RouteContext
public CamelContext getCamelContext()
RouteContext
getCamelContext
in interface RouteContext
public Endpoint resolveEndpoint(String uri)
RouteContext
resolveEndpoint
in interface RouteContext
uri
- the URIpublic Endpoint resolveEndpoint(String uri, String ref)
RouteContext
resolveEndpoint
in interface RouteContext
uri
- the URI orref
- the named referencepublic <T> T lookup(String name, Class<T> type)
RouteContext
lookup
in interface RouteContext
name
- the name to lookuptype
- the expected typepublic <T> Map<String,T> lookupByType(Class<T> type)
RouteContext
lookupByType
in interface RouteContext
type
- the expected typepublic <T> T mandatoryLookup(String name, Class<T> type)
RouteContext
NoSuchBeanException
if not found.mandatoryLookup
in interface RouteContext
name
- the name to lookuptype
- the expected typepublic void commit()
RouteContext
commit
in interface RouteContext
public void addEventDrivenProcessor(Processor processor)
RouteContext
addEventDrivenProcessor
in interface RouteContext
processor
- the processorpublic List<InterceptStrategy> getInterceptStrategies()
RouteContext
getInterceptStrategies
in interface RouteContext
public void setInterceptStrategies(List<InterceptStrategy> interceptStrategies)
RouteContext
setInterceptStrategies
in interface RouteContext
interceptStrategies
- the strategiespublic void addInterceptStrategy(InterceptStrategy interceptStrategy)
RouteContext
addInterceptStrategy
in interface RouteContext
interceptStrategy
- the strategypublic void setManagedInterceptStrategy(InterceptStrategy interceptStrategy)
RouteContext
setManagedInterceptStrategy
in interface RouteContext
interceptStrategy
- the managed intercept strategypublic InterceptStrategy getManagedInterceptStrategy()
RouteContext
getManagedInterceptStrategy
in interface RouteContext
public boolean isRouteAdded()
RouteContext
isRouteAdded
in interface RouteContext
public void setIsRouteAdded(boolean routeAdded)
RouteContext
ProcessorDefinition.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 RouteContext
routeAdded
- the flagpublic void setTracing(Boolean tracing)
RuntimeConfiguration
setTracing
in interface RuntimeConfiguration
tracing
- whether to enable tracing.public Boolean isTracing()
RuntimeConfiguration
isTracing
in interface RuntimeConfiguration
public void setMessageHistory(Boolean messageHistory)
RuntimeConfiguration
setMessageHistory
in interface RuntimeConfiguration
messageHistory
- whether message history is enabledpublic Boolean isMessageHistory()
RuntimeConfiguration
isMessageHistory
in interface RuntimeConfiguration
public void setLogMask(Boolean logMask)
RuntimeConfiguration
setLogMask
in interface RuntimeConfiguration
logMask
- true if mask is enabledpublic Boolean isLogMask()
RuntimeConfiguration
isLogMask
in interface RuntimeConfiguration
public void setLogExhaustedMessageBody(Boolean logExhaustedMessageBody)
RuntimeConfiguration
setLogExhaustedMessageBody
in interface RuntimeConfiguration
logExhaustedMessageBody
- whether message body should be loggedpublic Boolean isLogExhaustedMessageBody()
RuntimeConfiguration
isLogExhaustedMessageBody
in interface RuntimeConfiguration
public void setStreamCaching(Boolean cache)
RuntimeConfiguration
setStreamCaching
in interface RuntimeConfiguration
cache
- whether stream caching is enabled or notpublic Boolean isStreamCaching()
RuntimeConfiguration
isStreamCaching
in interface RuntimeConfiguration
public void setHandleFault(Boolean handleFault)
RuntimeConfiguration
setHandleFault
in interface RuntimeConfiguration
handleFault
- whether to enable fault handling.public Boolean isHandleFault()
RuntimeConfiguration
isHandleFault
in interface RuntimeConfiguration
public void setDelayer(Long delay)
RuntimeConfiguration
setDelayer
in interface RuntimeConfiguration
delay
- delay in millispublic Long getDelayer()
RuntimeConfiguration
getDelayer
in interface RuntimeConfiguration
public void setAutoStartup(Boolean autoStartup)
RuntimeConfiguration
CamelContext
s 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 then
you would need to start the routes manually using CamelContext.startRoute(String)
.
Default is true to always start up.setAutoStartup
in interface RuntimeConfiguration
autoStartup
- whether to start up automatically.public Boolean isAutoStartup()
RuntimeConfiguration
CamelContext
s are always started.
isAutoStartup
in interface RuntimeConfiguration
public void setShutdownRoute(ShutdownRoute shutdownRoute)
RuntimeConfiguration
setShutdownRoute
in interface RuntimeConfiguration
shutdownRoute
- the option to use.public void setAllowUseOriginalMessage(Boolean allowUseOriginalMessage)
RuntimeConfiguration
UnitOfWork.getOriginalInMessage()
.
Turning this off can optimize performance, as defensive copy of the original message is not needed.setAllowUseOriginalMessage
in interface RuntimeConfiguration
allowUseOriginalMessage
- the option to use.public Boolean isAllowUseOriginalMessage()
RuntimeConfiguration
UnitOfWork.getOriginalInMessage()
.
Turning this off can optimize performance, as defensive copy of the original message is not needed.isAllowUseOriginalMessage
in interface RuntimeConfiguration
public ShutdownRoute getShutdownRoute()
RuntimeConfiguration
getShutdownRoute
in interface RuntimeConfiguration
public void setShutdownRunningTask(ShutdownRunningTask shutdownRunningTask)
RuntimeConfiguration
setShutdownRunningTask
in interface RuntimeConfiguration
shutdownRunningTask
- the option to use.public ShutdownRunningTask getShutdownRunningTask()
RuntimeConfiguration
getShutdownRunningTask
in interface RuntimeConfiguration
public int getAndIncrement(ProcessorDefinition<?> node)
RouteContext
ProcessorDefinition
to the Channel
getAndIncrement
in interface RouteContext
node
- the current nodepublic void setRoutePolicyList(List<RoutePolicy> routePolicyList)
RouteContext
setRoutePolicyList
in interface RouteContext
routePolicyList
- the custom route policy listpublic List<RoutePolicy> getRoutePolicyList()
RouteContext
getRoutePolicyList
in interface RouteContext
Apache Camel