org.apache.qpid.server.txn
Class CleanupMessageOperation

java.lang.Object
  extended by org.apache.qpid.server.txn.CleanupMessageOperation
All Implemented Interfaces:
TxnOp

public class CleanupMessageOperation
extends java.lang.Object
implements TxnOp

Author:
Apache Software Foundation

Constructor Summary
CleanupMessageOperation(AMQMessage msg, java.util.List<RequiredDeliveryException> returns)
           
 
Method Summary
 void commit(StoreContext context)
          Complete the operation started by prepare.
 void prepare(StoreContext context)
          Do the part of the operation that updates persistent state
 void rollback(StoreContext context)
          Rolls back the operation.
 void undoPrepare()
          This is not the same as rollback.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CleanupMessageOperation

public CleanupMessageOperation(AMQMessage msg,
                               java.util.List<RequiredDeliveryException> returns)
Method Detail

prepare

public void prepare(StoreContext context)
             throws AMQException
Description copied from interface: TxnOp
Do the part of the operation that updates persistent state

Specified by:
prepare in interface TxnOp
Throws:
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(StoreContext context)
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(StoreContext context)
Description copied from interface: TxnOp
Rolls back the operation.

Specified by:
rollback in interface TxnOp


Copyright © 2007. All Rights Reserved.