|
||||||||||
| 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.PollingConsumerSupport
org.apache.camel.impl.EventDrivenPollingConsumer
public class EventDrivenPollingConsumer
A default implementation of the PollingConsumer which uses the normal
asynchronous consumer mechanism along with a BlockingQueue to allow
the caller to pull messages on demand.
| Field Summary |
|---|
| Fields inherited from class org.apache.camel.impl.PollingConsumerSupport |
|---|
log |
| Fields inherited from class org.apache.camel.support.ServiceSupport |
|---|
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending |
| Constructor Summary | |
|---|---|
EventDrivenPollingConsumer(Endpoint endpoint)
|
|
EventDrivenPollingConsumer(Endpoint endpoint,
BlockingQueue<Exchange> queue)
|
|
| Method Summary | |
|---|---|
protected void |
afterPoll()
|
protected long |
beforePoll(long timeout)
|
protected void |
doShutdown()
Implementations override this method to perform customized shutdown. |
protected void |
doStart()
Implementations override this method to support customized start/stop. |
protected void |
doStop()
Implementations override this method to support customized start/stop. |
ExceptionHandler |
getInterruptedExceptionHandler()
|
protected void |
handleInterruptedException(InterruptedException e)
|
void |
process(Exchange exchange)
Processes the message exchange |
Exchange |
receive()
Waits until a message is available and then returns it. |
Exchange |
receive(long timeout)
Attempts to receive a message exchange, waiting up to the given timeout to expire if a message is not yet available. |
Exchange |
receiveNoWait()
Attempts to receive a message exchange immediately without waiting and returning null if a message exchange is not available yet. |
void |
setInterruptedExceptionHandler(ExceptionHandler interruptedExceptionHandler)
|
| Methods inherited from class org.apache.camel.impl.PollingConsumerSupport |
|---|
getEndpoint, getExceptionHandler, handleException, setExceptionHandler, toString |
| Methods inherited from class org.apache.camel.support.ServiceSupport |
|---|
doResume, 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 |
| Constructor Detail |
|---|
public EventDrivenPollingConsumer(Endpoint endpoint)
public EventDrivenPollingConsumer(Endpoint endpoint,
BlockingQueue<Exchange> queue)
| Method Detail |
|---|
public Exchange receiveNoWait()
PollingConsumerUnitOfWork
on the returned Exchange
receiveNoWait in interface PollingConsumerpublic Exchange receive()
PollingConsumerUnitOfWork
on the returned Exchange
receive in interface PollingConsumerpublic Exchange receive(long timeout)
PollingConsumerUnitOfWork
on the returned Exchange
receive in interface PollingConsumertimeout - the amount of time in milliseconds to wait for a message
before timing out and returning null
public void process(Exchange exchange)
throws Exception
Processor
process in interface Processorexchange - the message exchange
Exception - if an internal processing error has occurred.public ExceptionHandler getInterruptedExceptionHandler()
public void setInterruptedExceptionHandler(ExceptionHandler interruptedExceptionHandler)
protected void handleInterruptedException(InterruptedException e)
protected long beforePoll(long timeout)
protected void afterPoll()
protected void doStart()
throws Exception
ServiceSupportServiceSupport.doStop() for more details.
doStart in class ServiceSupportExceptionServiceSupport.doStop()
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 doShutdown()
throws Exception
ServiceSupport
doShutdown in class ServiceSupportException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||