|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.camel.impl.ServiceSupport org.apache.camel.processor.BatchProcessor
public class BatchProcessor
A base class for any kind of Processor
which implements some kind of batch processing.
Field Summary | |
---|---|
static int |
DEFAULT_BATCH_SIZE
|
static long |
DEFAULT_BATCH_TIMEOUT
|
Constructor Summary | |
---|---|
BatchProcessor(Processor processor,
Collection<Exchange> collection)
|
Method Summary | |
---|---|
protected void |
doStart()
|
protected void |
doStop()
|
int |
getBatchSize()
|
long |
getBatchTimeout()
|
ExceptionHandler |
getExceptionHandler()
|
int |
getOutBatchSize()
|
Processor |
getProcessor()
|
boolean |
hasNext()
Are there more outputs? |
boolean |
isBatchConsumer()
|
boolean |
isGroupExchanges()
|
List<Processor> |
next()
Next group of outputs |
void |
process(Exchange exchange)
Enqueues an exchange for later batch processing. |
protected void |
processExchange(Exchange exchange)
Strategy Method to process an exchange in the batch. |
void |
setBatchConsumer(boolean batchConsumer)
|
void |
setBatchSize(int batchSize)
Sets the in batch size. |
void |
setBatchTimeout(long batchTimeout)
|
void |
setExceptionHandler(ExceptionHandler exceptionHandler)
|
void |
setGroupExchanges(boolean groupExchanges)
|
void |
setOutBatchSize(int outBatchSize)
Sets the out batch size. |
String |
toString()
|
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 |
---|
public static final long DEFAULT_BATCH_TIMEOUT
public static final int DEFAULT_BATCH_SIZE
Constructor Detail |
---|
public BatchProcessor(Processor processor, Collection<Exchange> collection)
Method Detail |
---|
public String toString()
toString
in class Object
public ExceptionHandler getExceptionHandler()
public void setExceptionHandler(ExceptionHandler exceptionHandler)
public int getBatchSize()
public void setBatchSize(int batchSize)
DEFAULT_BATCH_SIZE
.
batchSize
- the sizepublic int getOutBatchSize()
public void setOutBatchSize(int outBatchSize)
outBatchSize
- the sizepublic long getBatchTimeout()
public void setBatchTimeout(long batchTimeout)
public boolean isGroupExchanges()
public void setGroupExchanges(boolean groupExchanges)
public boolean isBatchConsumer()
public void setBatchConsumer(boolean batchConsumer)
public Processor getProcessor()
public List<Processor> next()
Navigate
next
in interface Navigate<Processor>
public boolean hasNext()
Navigate
hasNext
in interface Navigate<Processor>
protected void processExchange(Exchange exchange) throws Exception
Exception
protected void doStart() throws Exception
doStart
in class ServiceSupport
Exception
protected void doStop() throws Exception
doStop
in class ServiceSupport
Exception
public void process(Exchange exchange) throws Exception
process
in interface Processor
exchange
- the message exchange
Exception
- if an internal processing error has occurred.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |