org.apache.camel.component.sjms.tx
Class BatchTransactionCommitStrategy

java.lang.Object
  extended by org.apache.camel.component.sjms.tx.BatchTransactionCommitStrategy
All Implemented Interfaces:
TransactionCommitStrategy

public class BatchTransactionCommitStrategy
extends Object
implements TransactionCommitStrategy

Provides a thread safe counter to track the number of Exchange objects that have been been processed.


Constructor Summary
BatchTransactionCommitStrategy(int count)
           
 
Method Summary
 boolean commit(org.apache.camel.Exchange exchange)
          Should returns true to allow the commit to proceed.
 void reset()
           
 boolean rollback(org.apache.camel.Exchange exchange)
          Should returns true to allow the commit to proceed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BatchTransactionCommitStrategy

public BatchTransactionCommitStrategy(int count)
Parameters:
count -
Method Detail

commit

public boolean commit(org.apache.camel.Exchange exchange)
               throws Exception
Description copied from interface: TransactionCommitStrategy
Should returns true to allow the commit to proceed. If false, the commit will be skipped. The default should always be true to avoid messages remaining uncommitted.

Specified by:
commit in interface TransactionCommitStrategy
Parameters:
exchange - Exchange
Returns:
true if the Session should be committed, otherwise false
Throws:
Exception

rollback

public boolean rollback(org.apache.camel.Exchange exchange)
                 throws Exception
Description copied from interface: TransactionCommitStrategy
Should returns true to allow the commit to proceed. If false, the commit will be skipped. The default should always be true to avoid messages remaining uncommitted.

Specified by:
rollback in interface TransactionCommitStrategy
Parameters:
exchange - Exchange
Returns:
true if the Session should be committed, otherwise false
Throws:
Exception

reset

public void reset()


Apache Camel