public class EventDrivenPollingConsumer extends PollingConsumerSupport implements org.apache.camel.Processor, org.apache.camel.IsSingleton
PollingConsumer which uses the normal asynchronous consumer
mechanism along with a BlockingQueue to allow the caller to pull messages on demand.| Constructor and Description |
|---|
EventDrivenPollingConsumer(org.apache.camel.Endpoint endpoint) |
EventDrivenPollingConsumer(org.apache.camel.Endpoint endpoint,
BlockingQueue<org.apache.camel.Exchange> queue) |
EventDrivenPollingConsumer(org.apache.camel.Endpoint endpoint,
int queueSize) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
afterPoll() |
protected long |
beforePoll(long timeout) |
protected org.apache.camel.Consumer |
createConsumer() |
protected void |
doBuild() |
protected void |
doInit() |
protected void |
doShutdown() |
protected void |
doStart() |
protected void |
doStop() |
long |
getBlockTimeout() |
protected org.apache.camel.Consumer |
getConsumer() |
org.apache.camel.Consumer |
getDelegateConsumer() |
org.apache.camel.spi.ExceptionHandler |
getInterruptedExceptionHandler() |
org.apache.camel.Processor |
getProcessor() |
int |
getQueueCapacity()
Gets the queue capacity.
|
int |
getQueueSize()
Gets the current queue size (no of elements in the queue).
|
protected void |
handleInterruptedException(InterruptedException e) |
boolean |
isBlockWhenFull() |
boolean |
isCopy() |
boolean |
isSingleton() |
protected org.apache.camel.Exchange |
prepareCopy(org.apache.camel.Exchange exchange,
boolean handover) |
void |
process(org.apache.camel.Exchange exchange) |
org.apache.camel.Exchange |
receive() |
org.apache.camel.Exchange |
receive(long timeout) |
org.apache.camel.Exchange |
receiveNoWait() |
void |
setBlockTimeout(long blockTimeout) |
void |
setBlockWhenFull(boolean blockWhenFull) |
void |
setCopy(boolean copy) |
void |
setInterruptedExceptionHandler(org.apache.camel.spi.ExceptionHandler interruptedExceptionHandler) |
createExchange, getEndpoint, getExceptionHandler, handleException, releaseExchange, setExceptionHandler, toStringbuild, doFail, doLifecycleChange, doResume, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic EventDrivenPollingConsumer(org.apache.camel.Endpoint endpoint)
public EventDrivenPollingConsumer(org.apache.camel.Endpoint endpoint,
int queueSize)
public EventDrivenPollingConsumer(org.apache.camel.Endpoint endpoint,
BlockingQueue<org.apache.camel.Exchange> queue)
public org.apache.camel.Processor getProcessor()
getProcessor in interface org.apache.camel.ConsumergetProcessor in class PollingConsumerSupportpublic boolean isBlockWhenFull()
public void setBlockWhenFull(boolean blockWhenFull)
public long getBlockTimeout()
public void setBlockTimeout(long blockTimeout)
public boolean isCopy()
public void setCopy(boolean copy)
public int getQueueCapacity()
public int getQueueSize()
public org.apache.camel.Exchange receiveNoWait()
receiveNoWait in interface org.apache.camel.PollingConsumerpublic org.apache.camel.Exchange receive()
receive in interface org.apache.camel.PollingConsumerpublic org.apache.camel.Exchange receive(long timeout)
receive in interface org.apache.camel.PollingConsumerpublic void process(org.apache.camel.Exchange exchange)
throws Exception
process in interface org.apache.camel.ProcessorExceptionprotected org.apache.camel.Exchange prepareCopy(org.apache.camel.Exchange exchange,
boolean handover)
public org.apache.camel.spi.ExceptionHandler getInterruptedExceptionHandler()
public void setInterruptedExceptionHandler(org.apache.camel.spi.ExceptionHandler interruptedExceptionHandler)
public org.apache.camel.Consumer getDelegateConsumer()
protected void handleInterruptedException(InterruptedException e)
protected long beforePoll(long timeout)
protected void afterPoll()
protected org.apache.camel.Consumer getConsumer()
protected org.apache.camel.Consumer createConsumer()
throws Exception
Exceptionprotected void doBuild()
throws Exception
doBuild in class org.apache.camel.support.service.BaseServiceExceptionprotected void doInit()
throws Exception
doInit in class org.apache.camel.support.service.BaseServiceExceptionprotected void doStart()
throws Exception
doStart in class org.apache.camel.support.service.BaseServiceExceptionprotected void doStop()
throws Exception
doStop in class org.apache.camel.support.service.BaseServiceExceptionprotected void doShutdown()
throws Exception
doShutdown in class org.apache.camel.support.service.BaseServiceExceptionpublic boolean isSingleton()
isSingleton in interface org.apache.camel.IsSingletonApache Camel