org.davesag.generica.persistence.jdo
Class JdoTransaction

java.lang.Object
  extended byorg.davesag.generica.persistence.jdo.JdoTransaction
All Implemented Interfaces:
Manager, Transaction

public class JdoTransaction
extends Object
implements Transaction, Manager

The JdoTransaction delegates to an underlying Transaction.

Since:
Generica 1.0
Version:
CVS Revision $Id: JdoTransaction.java,v 1.6 2004/04/06 15:33:23 davesag Exp $
Author:
Dave Sag http://www.davesag.com

Field Summary
protected  javax.jdo.Transaction theTransaction
          the Transaction we are delegating to
 
Constructor Summary
JdoTransaction()
          default constructor
 
Method Summary
 void commit()
          Tell the undelying JDO Transaction to commit.
 Object getDelegate()
          Get the JDO Transaction being delegated to.
 boolean isActive()
          test to see if this transaction is still active.
 void rollback()
          rollback this transaction.
 void setDelegate(Object delegate)
          Set the JDO Transaction to delegate to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

theTransaction

protected javax.jdo.Transaction theTransaction
the Transaction we are delegating to

Constructor Detail

JdoTransaction

public JdoTransaction()
default constructor

Method Detail

setDelegate

public void setDelegate(Object delegate)
                 throws ClassCastException
Set the JDO Transaction to delegate to.

Specified by:
setDelegate in interface Manager
Parameters:
delegate - The JDO Transaction to delegate to.
Throws:
ClassCastException - if the delegate was not a JDO PersistenceManager.

getDelegate

public Object getDelegate()
Get the JDO Transaction being delegated to.

Specified by:
getDelegate in interface Manager
Returns:
The JDO Transaction being delegated to.

commit

public void commit()
            throws ArchiveException
Tell the undelying JDO Transaction to commit.

Specified by:
commit in interface Transaction
Throws:
ArchiveException - if anything jdo related went wrong.
DelegateException - if the underlying transaction has not been set.

rollback

public void rollback()
              throws ArchiveException
rollback this transaction.

Specified by:
rollback in interface Transaction
Throws:
ArchiveException - if anything jdo related went wrong.
DelegateException - if there was no PersistenceManager to delegate to.

isActive

public boolean isActive()
                 throws ArchiveException
test to see if this transaction is still active.

Specified by:
isActive in interface Transaction
Returns:
true if the transaction is still active.
Throws:
ArchiveException - if anything went wrong.
DelegateException - if the underlying transaction has not been set.


Dave Sag Generica API version 0.5.9 - (prerelease) Copyright 2003 - 2004 Dave Sag.