org.apache.camel.processor
Class BatchProcessor

java.lang.Object
  extended by org.apache.camel.impl.ServiceSupport
      extended by org.apache.camel.processor.BatchProcessor
All Implemented Interfaces:
Navigate<Processor>, Processor, Service, ShutdownableService
Direct Known Subclasses:
Resequencer

Deprecated. may be removed in the future

@Deprecated
public class BatchProcessor
extends ServiceSupport
implements Processor, Navigate<Processor>

A base class for any kind of Processor which implements some kind of batch processing.

Version:

Field Summary
static int DEFAULT_BATCH_SIZE
          Deprecated.  
static long DEFAULT_BATCH_TIMEOUT
          Deprecated.  
 
Constructor Summary
BatchProcessor(CamelContext camelContext, Processor processor, Collection<Exchange> collection)
          Deprecated.  
 
Method Summary
protected  void doStart()
          Deprecated.  
protected  void doStop()
          Deprecated.  
 int getBatchSize()
          Deprecated.  
 long getBatchTimeout()
          Deprecated.  
 Predicate getCompletionPredicate()
          Deprecated.  
 ExceptionHandler getExceptionHandler()
          Deprecated.  
 int getOutBatchSize()
          Deprecated.  
 Processor getProcessor()
          Deprecated.  
 boolean hasNext()
          Deprecated. Are there more outputs?
 boolean isBatchConsumer()
          Deprecated.  
 boolean isGroupExchanges()
          Deprecated.  
 List<Processor> next()
          Deprecated. Next group of outputs
 void process(Exchange exchange)
          Deprecated. Enqueues an exchange for later batch processing.
protected  void processExchange(Exchange exchange)
          Deprecated. Strategy Method to process an exchange in the batch.
 void setBatchConsumer(boolean batchConsumer)
          Deprecated.  
 void setBatchSize(int batchSize)
          Deprecated. Sets the in batch size.
 void setBatchTimeout(long batchTimeout)
          Deprecated.  
 void setCompletionPredicate(Predicate completionPredicate)
          Deprecated.  
 void setExceptionHandler(ExceptionHandler exceptionHandler)
          Deprecated.  
 void setGroupExchanges(boolean groupExchanges)
          Deprecated.  
 void setOutBatchSize(int outBatchSize)
          Deprecated. Sets the out batch size.
 String toString()
          Deprecated.  
 
Methods inherited from class org.apache.camel.impl.ServiceSupport
addChildService, doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspended, isSuspending, removeChildService, resume, shutdown, start, start, stop, suspend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_BATCH_TIMEOUT

public static final long DEFAULT_BATCH_TIMEOUT
Deprecated. 
See Also:
Constant Field Values

DEFAULT_BATCH_SIZE

public static final int DEFAULT_BATCH_SIZE
Deprecated. 
See Also:
Constant Field Values
Constructor Detail

BatchProcessor

public BatchProcessor(CamelContext camelContext,
                      Processor processor,
                      Collection<Exchange> collection)
Deprecated. 
Method Detail

toString

public String toString()
Deprecated. 
Overrides:
toString in class Object

getExceptionHandler

public ExceptionHandler getExceptionHandler()
Deprecated. 

setExceptionHandler

public void setExceptionHandler(ExceptionHandler exceptionHandler)
Deprecated. 

getBatchSize

public int getBatchSize()
Deprecated. 

setBatchSize

public void setBatchSize(int batchSize)
Deprecated. 
Sets the in batch size. This is the number of incoming exchanges that this batch processor will process before its completed. The default value is DEFAULT_BATCH_SIZE.

Parameters:
batchSize - the size

getOutBatchSize

public int getOutBatchSize()
Deprecated. 

setOutBatchSize

public void setOutBatchSize(int outBatchSize)
Deprecated. 
Sets the out batch size. If the batch processor holds more exchanges than this out size then the completion is triggered. Can for instance be used to ensure that this batch is completed when a certain number of exchanges has been collected. By default this feature is not enabled.

Parameters:
outBatchSize - the size

getBatchTimeout

public long getBatchTimeout()
Deprecated. 

setBatchTimeout

public void setBatchTimeout(long batchTimeout)
Deprecated. 

isGroupExchanges

public boolean isGroupExchanges()
Deprecated. 

setGroupExchanges

public void setGroupExchanges(boolean groupExchanges)
Deprecated. 

isBatchConsumer

public boolean isBatchConsumer()
Deprecated. 

setBatchConsumer

public void setBatchConsumer(boolean batchConsumer)
Deprecated. 

getCompletionPredicate

public Predicate getCompletionPredicate()
Deprecated. 

setCompletionPredicate

public void setCompletionPredicate(Predicate completionPredicate)
Deprecated. 

getProcessor

public Processor getProcessor()
Deprecated. 

next

public List<Processor> next()
Deprecated. 
Description copied from interface: Navigate
Next group of outputs

Specified by:
next in interface Navigate<Processor>
Returns:
next group or null if no more outputs

hasNext

public boolean hasNext()
Deprecated. 
Description copied from interface: Navigate
Are there more outputs?

Specified by:
hasNext in interface Navigate<Processor>
Returns:
true if more outputs

processExchange

protected void processExchange(Exchange exchange)
                        throws Exception
Deprecated. 
Strategy Method to process an exchange in the batch. This method allows derived classes to perform custom processing before or after an individual exchange is processed

Throws:
Exception

doStart

protected void doStart()
                throws Exception
Deprecated. 
Specified by:
doStart in class ServiceSupport
Throws:
Exception

doStop

protected void doStop()
               throws Exception
Deprecated. 
Specified by:
doStop in class ServiceSupport
Throws:
Exception

process

public void process(Exchange exchange)
             throws Exception
Deprecated. 
Enqueues an exchange for later batch processing.

Specified by:
process in interface Processor
Parameters:
exchange - the message exchange
Throws:
Exception - if an internal processing error has occurred.


Apache CAMEL