|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.camel.support.ServiceSupport
org.apache.camel.impl.DefaultConsumer
public class DefaultConsumer
A default consumer useful for implementation inheritance.
| Field Summary | |
|---|---|
protected org.slf4j.Logger |
log
|
| Fields inherited from class org.apache.camel.support.ServiceSupport |
|---|
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending |
| Constructor Summary | |
|---|---|
DefaultConsumer(Endpoint endpoint,
Processor processor)
|
|
| Method Summary | |
|---|---|
UnitOfWork |
createUoW(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. |
void |
doneUoW(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()
Implementations override this method to support customized start/stop. |
protected void |
doStop()
Implementations override this method to support customized start/stop. |
AsyncProcessor |
getAsyncProcessor()
Provides an AsyncProcessor interface to the configured
processor on the consumer. |
Endpoint |
getEndpoint()
Gets the endpoint this Consumer consumes from. |
ExceptionHandler |
getExceptionHandler()
|
Processor |
getProcessor()
|
Route |
getRoute()
Gets the Route |
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(ExceptionHandler exceptionHandler)
|
void |
setRoute(Route route)
Injects the Route |
String |
toString()
|
| Methods inherited from class org.apache.camel.support.ServiceSupport |
|---|
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, resume, shutdown, start, stop, suspend |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.camel.Service |
|---|
start, stop |
| Field Detail |
|---|
protected final org.slf4j.Logger log
| Constructor Detail |
|---|
public DefaultConsumer(Endpoint endpoint,
Processor processor)
| Method Detail |
|---|
public String toString()
toString in class Objectpublic Route getRoute()
RouteAwareRoute
getRoute in interface RouteAwarepublic void setRoute(Route route)
RouteAwareRoute
setRoute in interface RouteAwareroute - the route
public UnitOfWork createUoW(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 exchange
Exception - is thrown if error starting the unit of workdoneUoW(org.apache.camel.Exchange)public void doneUoW(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 Endpoint getEndpoint()
ConsumerConsumer consumes from.
getEndpoint in interface Consumerpublic Processor getProcessor()
public 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 ExceptionHandler getExceptionHandler()
public void setExceptionHandler(ExceptionHandler exceptionHandler)
protected void doStop()
throws Exception
ServiceSupportServiceSupport.doStop() method when
the service is being stopped. This method will also be invoked
if the service is still in uninitialized state (eg has not
been started). The method is always called to allow the service
to do custom logic when the service is being stopped, such as when
CamelContext is shutting down.
doStop in class ServiceSupportExceptionServiceSupport.doStart()
protected void doStart()
throws Exception
ServiceSupportServiceSupport.doStop() for more details.
doStart in class ServiceSupportExceptionServiceSupport.doStop()protected void handleException(Throwable t)
getExceptionHandler()
t - the exception to handle
protected void handleException(String message,
Throwable t)
getExceptionHandler()
message - additional message about the exceptiont - the exception to handle
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||