org.objectweb.speedo.workingset.lib
Class SpeedoTransaction

java.lang.Object
  extended byBasicWorkingSet
      extended byorg.objectweb.speedo.workingset.lib.SpeedoTransaction
All Implemented Interfaces:
Transaction

public class SpeedoTransaction
extends BasicWorkingSet
implements Transaction

Is a working set assocaited to a ProxyManager. The working set can be transactional or not. It contains the list of reached instances.

Author:
S.Chassande-Barrioz
See Also:
javax.jdo.Transaction, Transaction, WorkingSet, BasicWorkingSet, Serialized Form

Field Summary
static java.lang.String COMPONENT_BINDING
           
static java.lang.String MAPPER_BINDING
           
static java.lang.String PROXY_MANAGER_BINDING
           
static java.lang.String TRANSACTIONAL_PERSISTENCE_MANAGER_BINDING
           
static TransactionListener txListener
           
 
Constructor Summary
SpeedoTransaction()
           
 
Method Summary
 void active()
          It activates the working set.
 void afterWSPrepare()
          Signal to the persistent instances reached in the working set that the current working set is closed.
 void beforeWSPrepare()
          Invalidates the prefetch buffer associated to this working set.
 void begin()
           
 State bind(State state, java.lang.Object oid, byte mode)
          Attaches an entry to the transaction.
 void bindFc(java.lang.String c, java.lang.Object s)
           
 void commit()
           
 java.lang.String getFcState()
           
 boolean getNontransactionalRead()
           
 boolean getNontransactionalWrite()
           
 boolean getOptimistic()
           
 PersistenceManager getPersistenceManager()
           
 boolean getRestoreValues()
           
 boolean getRetainValues()
           
 boolean getRollbackOnly()
           
 Synchronization getSynchronization()
           
 boolean isActive()
           
 boolean isManagedEnv()
          Indicates if the transaction environnement is managed.
 java.lang.String[] listFc()
           
 java.lang.Object lookupFc(java.lang.String c)
           
 void rollback()
           
 JDOFatalException rollBackOnInternalError(java.lang.Exception _e)
           
 void setConnectionHolder(ConnectionHolder ch)
          Assignes the connection holder.
 void setNontransactionalRead(boolean b)
           
 void setNontransactionalWrite(boolean b)
           
 void setOptimistic(boolean b)
           
 void setRestoreValues(boolean b)
           
 void setRetainValues(boolean b)
           
 void setRollbackOnly()
           
 void setStatus(byte status)
           
 void setSynchronization(Synchronization s)
           
 void startFc()
           
 void stopFc()
           
 void unbindFc(java.lang.String c)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROXY_MANAGER_BINDING

public static final java.lang.String PROXY_MANAGER_BINDING
See Also:
Constant Field Values

MAPPER_BINDING

public static final java.lang.String MAPPER_BINDING
See Also:
Constant Field Values

TRANSACTIONAL_PERSISTENCE_MANAGER_BINDING

public static final java.lang.String TRANSACTIONAL_PERSISTENCE_MANAGER_BINDING
See Also:
Constant Field Values

COMPONENT_BINDING

public static final java.lang.String COMPONENT_BINDING
See Also:
Constant Field Values

txListener

public static TransactionListener txListener
Constructor Detail

SpeedoTransaction

public SpeedoTransaction()
Method Detail

active

public void active()
            throws PersistenceException
It activates the working set. This is used to delimit the begining of the working set.

Specified by:
active in interface Transaction
Throws:
PersistenceException

bind

public State bind(State state,
                  java.lang.Object oid,
                  byte mode)
Attaches an entry to the transaction.

Parameters:
state - the state which must be attached to the transaction
mode - the action that stared the binding: either read or write intention

beforeWSPrepare

public void beforeWSPrepare()
                     throws PersistenceException
Invalidates the prefetch buffer associated to this working set.

Throws:
PersistenceException

afterWSPrepare

public void afterWSPrepare()
Signal to the persistent instances reached in the working set that the current working set is closed. Some actions on persistent instances at this time can be done, such as reference unswizlling


setConnectionHolder

public void setConnectionHolder(ConnectionHolder ch)
Description copied from interface: Transaction
Assignes the connection holder. The connection holder is able to allocate a connection to the underlying data support and to kept it until the working set / transaction end.

Specified by:
setConnectionHolder in interface Transaction

rollBackOnInternalError

public JDOFatalException rollBackOnInternalError(java.lang.Exception _e)
Specified by:
rollBackOnInternalError in interface Transaction

isManagedEnv

public boolean isManagedEnv()
Description copied from interface: Transaction
Indicates if the transaction environnement is managed. If the 'false' value is returned then that means that a user transaction matches to a local transaction managed by speedo.

Specified by:
isManagedEnv in interface Transaction

getFcState

public java.lang.String getFcState()

startFc

public void startFc()

stopFc

public void stopFc()

listFc

public java.lang.String[] listFc()

lookupFc

public java.lang.Object lookupFc(java.lang.String c)

bindFc

public void bindFc(java.lang.String c,
                   java.lang.Object s)

unbindFc

public void unbindFc(java.lang.String c)

setStatus

public void setStatus(byte status)
               throws PersistenceException
Throws:
PersistenceException

begin

public void begin()

commit

public void commit()

rollback

public void rollback()

isActive

public boolean isActive()

setNontransactionalRead

public void setNontransactionalRead(boolean b)

getNontransactionalRead

public boolean getNontransactionalRead()

setNontransactionalWrite

public void setNontransactionalWrite(boolean b)

getNontransactionalWrite

public boolean getNontransactionalWrite()

setRetainValues

public void setRetainValues(boolean b)

getRetainValues

public boolean getRetainValues()

setRestoreValues

public void setRestoreValues(boolean b)

getRestoreValues

public boolean getRestoreValues()

setOptimistic

public void setOptimistic(boolean b)

getOptimistic

public boolean getOptimistic()

setSynchronization

public void setSynchronization(Synchronization s)

getSynchronization

public Synchronization getSynchronization()

getPersistenceManager

public PersistenceManager getPersistenceManager()

getRollbackOnly

public boolean getRollbackOnly()

setRollbackOnly

public void setRollbackOnly()