|
||||||||||
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(Endpoint endpoint,
Processor processor,
Collection<Exchange> collection)
|
Method Summary | |
---|---|
protected void |
doStart()
|
protected void |
doStop()
|
int |
getBatchSize()
|
long |
getBatchTimeout()
|
protected Collection<Exchange> |
getCollection()
|
Endpoint |
getEndpoint()
|
ExceptionHandler |
getExceptionHandler()
|
int |
getOutBatchSize()
|
Processor |
getProcessor()
|
protected boolean |
isBatchCompleted(int index)
A strategy method to decide if the batch is completed the resulting exchanges should be sent |
void |
process(Exchange exchange)
Processes the message exchange |
protected void |
processBatch()
A transactional method to process a batch of messages up to a timeout period or number of messages reached. |
protected void |
processExchange(Exchange exchange)
Strategy Method to process an exchange in the batch. |
void |
run()
|
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, 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(Endpoint endpoint, Processor processor, Collection<Exchange> collection)
Method Detail |
---|
public String toString()
toString
in class Object
public void run()
run
in interface Runnable
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 Endpoint getEndpoint()
public Processor getProcessor()
protected void processBatch() throws Exception
Exception
protected boolean isBatchCompleted(int index)
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
Processor
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 |