stomp.jdo
Class TransactionWrapper

java.lang.Object
  |
  +--stomp.jdo.TransactionWrapper
All Implemented Interfaces:
javax.jdo.Transaction
Direct Known Subclasses:
EnhancedTransaction

public class TransactionWrapper
extends java.lang.Object
implements javax.jdo.Transaction

wraps a JDO Transaction object, preventing any developer attempts to begin or commit the transaction. Alternatively named methods which accomplish this effect are provided, to allow for JDOFactory transaction management which is transparent to the developer. works in conjunction with the HCMPersistenceMananger.

Author:
Eric Lindauer

Constructor Summary
TransactionWrapper(PMWrapper pm)
           
 
Method Summary
 void begin()
           
 void commit()
           
protected  void fixState(java.lang.Object object)
          called when the PM for a transactional object is closed.
 boolean getNontransactionalRead()
           
 boolean getNontransactionalWrite()
           
 boolean getOptimistic()
           
 javax.jdo.PersistenceManager getPersistenceManager()
           
 boolean getRestoreValues()
           
 boolean getRetainValues()
           
 javax.transaction.Synchronization getSynchronization()
           
 boolean isActive()
           
 void reallyBegin()
          For transparent transactional control only.
 boolean reallyCommit()
          For transparent transactional control only.
 void rollback()
          rollback the current transaction.
 void setNontransactionalRead(boolean nontransactionalRead)
           
 void setNontransactionalWrite(boolean nontransactionalWrite)
           
 void setOptimistic(boolean optimistic)
           
 void setRestoreValues(boolean restore)
           
 void setRetainValues(boolean retainValues)
           
 void setSynchronization(javax.transaction.Synchronization sync)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionWrapper

public TransactionWrapper(PMWrapper pm)
Method Detail

begin

public void begin()
Specified by:
begin in interface javax.jdo.Transaction

reallyBegin

public void reallyBegin()
For transparent transactional control only.


commit

public void commit()
Specified by:
commit in interface javax.jdo.Transaction

reallyCommit

public boolean reallyCommit()
For transparent transactional control only.


fixState

protected void fixState(java.lang.Object object)
called when the PM for a transactional object is closed. This gives the Transaction the opportunity to save this object and make it usable. This particular implementation does nothing, so references to transactional objects must be discarded after the transaction is closed.


getNontransactionalRead

public boolean getNontransactionalRead()
Specified by:
getNontransactionalRead in interface javax.jdo.Transaction

getNontransactionalWrite

public boolean getNontransactionalWrite()
Specified by:
getNontransactionalWrite in interface javax.jdo.Transaction

getOptimistic

public boolean getOptimistic()
Specified by:
getOptimistic in interface javax.jdo.Transaction

getPersistenceManager

public javax.jdo.PersistenceManager getPersistenceManager()
Specified by:
getPersistenceManager in interface javax.jdo.Transaction

getRetainValues

public boolean getRetainValues()
Specified by:
getRetainValues in interface javax.jdo.Transaction

getSynchronization

public javax.transaction.Synchronization getSynchronization()
Specified by:
getSynchronization in interface javax.jdo.Transaction

isActive

public boolean isActive()
Specified by:
isActive in interface javax.jdo.Transaction

rollback

public void rollback()
rollback the current transaction. Since this is similar to a commit in that it ends the current transaction, also removes this transaction and its PM from the JDOFactory.singleton ().

Specified by:
rollback in interface javax.jdo.Transaction

setNontransactionalRead

public void setNontransactionalRead(boolean nontransactionalRead)
Specified by:
setNontransactionalRead in interface javax.jdo.Transaction

setNontransactionalWrite

public void setNontransactionalWrite(boolean nontransactionalWrite)
Specified by:
setNontransactionalWrite in interface javax.jdo.Transaction

setOptimistic

public void setOptimistic(boolean optimistic)
Specified by:
setOptimistic in interface javax.jdo.Transaction

setRetainValues

public void setRetainValues(boolean retainValues)
Specified by:
setRetainValues in interface javax.jdo.Transaction

setSynchronization

public void setSynchronization(javax.transaction.Synchronization sync)
Specified by:
setSynchronization in interface javax.jdo.Transaction

setRestoreValues

public void setRestoreValues(boolean restore)
Specified by:
setRestoreValues in interface javax.jdo.Transaction

getRestoreValues

public boolean getRestoreValues()
Specified by:
getRestoreValues in interface javax.jdo.Transaction