|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.camel.impl.ServiceSupport
org.apache.camel.processor.SendProcessor
org.apache.camel.processor.SendAsyncProcessor
public class SendAsyncProcessor
| Field Summary | |
|---|---|
protected BlockingQueue<Exchange> |
completedTasks
|
protected ExceptionHandler |
exceptionHandler
|
protected ExecutorService |
executorService
|
protected int |
poolSize
|
protected ExecutorService |
producerExecutorService
|
protected Processor |
target
|
| Fields inherited from class org.apache.camel.processor.SendProcessor |
|---|
destination, LOG, pattern, producerCache |
| Constructor Summary | |
|---|---|
SendAsyncProcessor(Endpoint destination,
ExchangePattern pattern,
Processor target)
|
|
SendAsyncProcessor(Endpoint destination,
Processor target)
|
|
| Method Summary | |
|---|---|
protected Exchange |
configureExchange(Exchange exchange,
ExchangePattern pattern)
|
protected ExecutorService |
createExecutorService(String name)
|
protected void |
doAsyncProcess(AsyncProcessor producer,
Exchange exchange,
AsyncCallback callback)
The producer is already capable of async processing so let it process it directly. |
Exchange |
doProcess(Exchange exchange)
Strategy to process the exchange |
protected void |
doSimulateAsyncProcess(Processor producer,
Exchange exchange,
AsyncCallback callback)
The producer is not capable of async processing so lets simulate this by transfering the task to another ExecutorService for async processing. |
protected void |
doStart()
|
protected void |
doStop()
|
ExceptionHandler |
getExceptionHandler()
|
ExecutorService |
getExecutorService()
|
int |
getPoolSize()
|
ExecutorService |
getProducerExecutorService()
|
boolean |
hasNext()
Are there more outputs? |
List<Processor> |
next()
Next group of outputs |
void |
run()
|
void |
setExceptionHandler(ExceptionHandler exceptionHandler)
|
void |
setExecutorService(ExecutorService executorService)
Sets the ExecutorService to use for consuming replies. |
void |
setPoolSize(int poolSize)
|
void |
setProducerExecutorService(ExecutorService producerExecutorService)
Sets the ExecutorService to use for simulating async producers
by transferring the Exchange to this ExecutorService for
sending the request and block while waiting for the reply. |
String |
toString()
|
| Methods inherited from class org.apache.camel.processor.SendProcessor |
|---|
getDestination, getPattern, getProducerCache, getTraceLabel, process, setDestination |
| Methods inherited from class org.apache.camel.impl.ServiceSupport |
|---|
addChildService, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, removeChildService, start, stop |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final Processor target
protected final BlockingQueue<Exchange> completedTasks
protected ExecutorService executorService
protected ExecutorService producerExecutorService
protected int poolSize
protected ExceptionHandler exceptionHandler
| Constructor Detail |
|---|
public SendAsyncProcessor(Endpoint destination,
Processor target)
public SendAsyncProcessor(Endpoint destination,
ExchangePattern pattern,
Processor target)
| Method Detail |
|---|
protected Exchange configureExchange(Exchange exchange,
ExchangePattern pattern)
configureExchange in class SendProcessor
public Exchange doProcess(Exchange exchange)
throws Exception
SendProcessor
doProcess in class SendProcessorexchange - the exchange
Exception - can be thrown if error processing exchange
protected void doAsyncProcess(AsyncProcessor producer,
Exchange exchange,
AsyncCallback callback)
throws Exception
producer - the async producerexchange - the exchangecallback - the callback
Exception - can be thrown in case of processing errors
protected void doSimulateAsyncProcess(Processor producer,
Exchange exchange,
AsyncCallback callback)
throws Exception
ExecutorService for async processing.
producer - the producerexchange - the exchangecallback - the callback
Exception - can be thrown in case of processing errorspublic String toString()
toString in class SendProcessorpublic ExecutorService getExecutorService()
public void setExecutorService(ExecutorService executorService)
ExecutorService to use for consuming replies.
executorService - the custom executor servicepublic ExecutorService getProducerExecutorService()
public void setProducerExecutorService(ExecutorService producerExecutorService)
ExecutorService to use for simulating async producers
by transferring the Exchange to this ExecutorService for
sending the request and block while waiting for the reply. However the original thread
will not block and as such it all appears as real async request/reply mechanism.
producerExecutorService - the custom executor service for producerspublic int getPoolSize()
public void setPoolSize(int poolSize)
public ExceptionHandler getExceptionHandler()
public void setExceptionHandler(ExceptionHandler exceptionHandler)
public boolean hasNext()
Navigate
hasNext in interface Navigate<Processor>public List<Processor> next()
Navigate
next in interface Navigate<Processor>public void run()
run in interface Runnableprotected ExecutorService createExecutorService(String name)
protected void doStart()
throws Exception
doStart in class SendProcessorException
protected void doStop()
throws Exception
doStop in class SendProcessorException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||