|
||||||||||
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.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()
|
protected Collection<Exchange> |
getCollection()
|
ExceptionHandler |
getExceptionHandler()
|
int |
getOutBatchSize()
|
Processor |
getProcessor()
|
protected boolean |
isInBatchCompleted(int num)
A strategy method to decide if the "in" batch is completed. |
protected boolean |
isOutBatchCompleted()
A strategy method to decide if the "out" batch is completed. |
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 |
setBatchSize(int batchSize)
Sets the in batch size. |
void |
setBatchTimeout(long batchTimeout)
|
void |
setExceptionHandler(ExceptionHandler exceptionHandler)
|
void |
setOutBatchSize(int outBatchSize)
Sets the out batch size. |
String |
toString()
|
Methods inherited from class org.apache.camel.impl.ServiceSupport |
---|
addChildService, getThreadName, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, nextThreadCounter, 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 Processor getProcessor()
protected boolean isInBatchCompleted(int num)
protected boolean isOutBatchCompleted()
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
protected Collection<Exchange> getCollection()
public void process(Exchange exchange) throws Exception
process
in interface Processor
Exception
- if an internal processing error has occurred.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |