org.apache.qpid.server.ack
Class TxAck

java.lang.Object
  extended by org.apache.qpid.server.ack.TxAck
All Implemented Interfaces:
TxnOp

public class TxAck
extends java.lang.Object
implements TxnOp

A TxnOp implementation for handling accumulated acks


Constructor Summary
TxAck(UnacknowledgedMessageMap map)
           
 
Method Summary
 boolean checkPersistent()
           
 void commit()
          Complete the operation started by prepare.
 void consolidate()
           
 void prepare()
          Do the part of the operation that updates persistent state
 void rollback()
          Rolls back the operation.
 void undoPrepare()
          This is not the same as rollback.
 void update(long deliveryTag, boolean multiple)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TxAck

public TxAck(UnacknowledgedMessageMap map)
Method Detail

update

public void update(long deliveryTag,
                   boolean multiple)

consolidate

public void consolidate()

checkPersistent

public boolean checkPersistent()
                        throws org.apache.qpid.AMQException
Throws:
org.apache.qpid.AMQException

prepare

public void prepare()
             throws org.apache.qpid.AMQException
Description copied from interface: TxnOp
Do the part of the operation that updates persistent state

Specified by:
prepare in interface TxnOp
Throws:
org.apache.qpid.AMQException

undoPrepare

public void undoPrepare()
Description copied from interface: TxnOp
This is not the same as rollback. Unfortunately the use of an in memory reference count as a locking mechanism and a test for whether a message should be deleted means that as things are, handling an acknowledgement unavoidably alters both memory and persistent state on prepare. This is needed to 'compensate' or undo the in-memory change if the peristent update of later ops fails.

Specified by:
undoPrepare in interface TxnOp

commit

public void commit()
Description copied from interface: TxnOp
Complete the operation started by prepare. Can now update in memory state or make netork transfers.

Specified by:
commit in interface TxnOp

rollback

public void rollback()
Description copied from interface: TxnOp
Rolls back the operation.

Specified by:
rollback in interface TxnOp