public class DefaultConsumer
extends org.apache.camel.support.service.ServiceSupport
implements org.apache.camel.Consumer, org.apache.camel.RouteAware
| Constructor and Description |
|---|
DefaultConsumer(org.apache.camel.Endpoint endpoint,
org.apache.camel.Processor processor) |
| Modifier and Type | Method and Description |
|---|---|
org.apache.camel.spi.UnitOfWork |
createUoW(org.apache.camel.Exchange exchange)
If the consumer needs to defer done the
UnitOfWork on
the processed Exchange then this method should be use to create and start
the UnitOfWork on the exchange. |
protected void |
doInit() |
void |
doneUoW(org.apache.camel.Exchange exchange)
If the consumer needs to defer done the
UnitOfWork on
the processed Exchange then this method should be executed when the consumer
is finished processing the message. |
protected void |
doStart() |
protected void |
doStop() |
org.apache.camel.AsyncProcessor |
getAsyncProcessor()
Provides an
AsyncProcessor interface to the configured
processor on the consumer. |
org.apache.camel.Endpoint |
getEndpoint() |
org.apache.camel.spi.ExceptionHandler |
getExceptionHandler() |
org.apache.camel.Processor |
getProcessor() |
org.apache.camel.Route |
getRoute() |
protected void |
handleException(String message,
Throwable t)
Handles the given exception using the
getExceptionHandler() |
protected void |
handleException(Throwable t)
Handles the given exception using the
getExceptionHandler() |
void |
setExceptionHandler(org.apache.camel.spi.ExceptionHandler exceptionHandler) |
void |
setRoute(org.apache.camel.Route route) |
String |
toString() |
build, doBuild, doResume, doShutdown, doSuspend, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendpublic DefaultConsumer(org.apache.camel.Endpoint endpoint,
org.apache.camel.Processor processor)
public org.apache.camel.Route getRoute()
getRoute in interface org.apache.camel.RouteAwarepublic void setRoute(org.apache.camel.Route route)
setRoute in interface org.apache.camel.RouteAwarepublic org.apache.camel.spi.UnitOfWork createUoW(org.apache.camel.Exchange exchange)
throws Exception
UnitOfWork on
the processed Exchange then this method should be use to create and start
the UnitOfWork on the exchange.exchange - the exchangeException - is thrown if error starting the unit of workdoneUoW(org.apache.camel.Exchange)public void doneUoW(org.apache.camel.Exchange exchange)
UnitOfWork on
the processed Exchange then this method should be executed when the consumer
is finished processing the message.exchange - the exchangecreateUoW(org.apache.camel.Exchange)public org.apache.camel.Endpoint getEndpoint()
getEndpoint in interface org.apache.camel.EndpointAwarepublic org.apache.camel.Processor getProcessor()
getProcessor in interface org.apache.camel.Consumerpublic org.apache.camel.AsyncProcessor getAsyncProcessor()
AsyncProcessor interface to the configured
processor on the consumer. If the processor does not implement the interface,
it will be adapted so that it does.public org.apache.camel.spi.ExceptionHandler getExceptionHandler()
public void setExceptionHandler(org.apache.camel.spi.ExceptionHandler exceptionHandler)
protected void doInit()
throws Exception
doInit in class org.apache.camel.support.service.ServiceSupportExceptionprotected void doStop()
throws Exception
doStop in class org.apache.camel.support.service.ServiceSupportExceptionprotected void doStart()
throws Exception
doStart in class org.apache.camel.support.service.ServiceSupportExceptionprotected void handleException(Throwable t)
getExceptionHandler()t - the exception to handleprotected void handleException(String message, Throwable t)
getExceptionHandler()message - additional message about the exceptiont - the exception to handleApache Camel