|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.camel.builder.BuilderSupport
org.apache.camel.builder.RouteBuilder
public abstract class RouteBuilder
A Java DSL which is
used to build DefaultRoute
instances in a CamelContext
for smart routing.
Constructor Summary | |
---|---|
RouteBuilder()
|
|
RouteBuilder(CamelContext context)
|
Method Summary | |
---|---|
protected void |
addRoutes(RoutesBuilder routes)
Adds a collection of routes to this context |
void |
addRoutesToCamelContext(CamelContext context)
Adds the routes from this Route Builder to the CamelContext. |
protected void |
checkInitialized()
|
abstract void |
configure()
Called on initialization to build the routes using the fluent builder syntax. This is a central method for RouteBuilder implementations to implement the routes using the Java fluent builder syntax. |
protected void |
configureRoute(RouteDefinition route)
|
protected CamelContext |
createContainer()
Factory method |
RouteBuilder |
errorHandler(ErrorHandlerBuilder errorHandlerBuilder)
Installs the given error handler builder |
RouteDefinition |
from(Endpoint... endpoints)
Creates a new route from the given endpoint |
RouteDefinition |
from(Endpoint endpoint)
Creates a new route from the given endpoint |
RouteDefinition |
from(String... uris)
Creates a new route from the given URIs input |
RouteDefinition |
from(String uri)
Creates a new route from the given URI input |
RouteDefinition |
fromF(String uri,
Object... args)
Creates a new route from the given URI input |
CamelContext |
getContext()
|
RoutesDefinition |
getRouteCollection()
|
InterceptDefinition |
intercept()
Adds a route for an interceptor that intercepts every processing step. |
InterceptFromDefinition |
interceptFrom()
Adds a route for an interceptor that intercepts incoming messages on any inputs in this route |
InterceptFromDefinition |
interceptFrom(String uri)
Adds a route for an interceptor that intercepts incoming messages on the given endpoint. |
InterceptSendToEndpointDefinition |
interceptSendToEndpoint(String uri)
Applies a route for an interceptor if an exchange is send to the given endpoint |
OnCompletionDefinition |
onCompletion()
On completion callback for doing custom routing when the Exchange is complete. |
OnExceptionDefinition |
onException(Class... exceptions)
Exception clause for catching certain exceptions and handling them. |
OnExceptionDefinition |
onException(Class exception)
Exception clause for catching certain exceptions and handling them. |
protected void |
populateRoutes()
|
void |
setErrorHandlerBuilder(ErrorHandlerBuilder errorHandlerBuilder)
Sets the error handler to use with processors created by this builder |
void |
setRouteCollection(RoutesDefinition routeCollection)
|
String |
toString()
|
Methods inherited from class org.apache.camel.builder.BuilderSupport |
---|
bean, bean, bean, bean, body, body, constant, createErrorHandlerBuilder, deadLetterChannel, deadLetterChannel, defaultErrorHandler, endpoint, endpoint, endpoints, endpoints, exceptionMessage, faultBody, faultBodyAs, getErrorHandlerBuilder, header, loggingErrorHandler, loggingErrorHandler, loggingErrorHandler, loggingErrorHandler, noErrorHandler, outBody, outBody, property, regexReplaceAll, regexReplaceAll, sendTo, setContext, systemProperty, systemProperty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RouteBuilder()
public RouteBuilder(CamelContext context)
Method Detail |
---|
public String toString()
toString
in class Object
public abstract void configure() throws Exception
Exception
- can be thrown during configurationpublic RouteDefinition from(String uri)
uri
- the from uri
public RouteDefinition fromF(String uri, Object... args)
uri
- the String formatted from uriargs
- arguments for the string formatting of the uri
public RouteDefinition from(Endpoint endpoint)
endpoint
- the from endpoint
public RouteDefinition from(String... uris)
uris
- the from uris
public RouteDefinition from(Endpoint... endpoints)
endpoints
- the from endpoints
public RouteBuilder errorHandler(ErrorHandlerBuilder errorHandlerBuilder)
errorHandlerBuilder
- the error handler to be used by default for all child routes
public InterceptDefinition intercept()
public InterceptFromDefinition interceptFrom()
public InterceptFromDefinition interceptFrom(String uri)
uri
- endpoint uri
public InterceptSendToEndpointDefinition interceptSendToEndpoint(String uri)
uri
- endpoint uri
public OnExceptionDefinition onException(Class exception)
exception
- exception to catch
public OnExceptionDefinition onException(Class... exceptions)
exceptions
- list of exceptions to catch
public OnCompletionDefinition onCompletion()
Exchange
is complete.
public CamelContext getContext()
getContext
in class BuilderSupport
public void addRoutesToCamelContext(CamelContext context) throws Exception
RoutesBuilder
addRoutesToCamelContext
in interface RoutesBuilder
context
- the Camel context
Exception
public void setErrorHandlerBuilder(ErrorHandlerBuilder errorHandlerBuilder)
BuilderSupport
setErrorHandlerBuilder
in class BuilderSupport
protected void checkInitialized() throws Exception
Exception
protected void populateRoutes() throws Exception
Exception
public void setRouteCollection(RoutesDefinition routeCollection)
public RoutesDefinition getRouteCollection()
protected CamelContext createContainer()
protected void configureRoute(RouteDefinition route)
protected void addRoutes(RoutesBuilder routes) throws Exception
Exception
- if the routes could not be created for whatever reason
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |