org.objectweb.jotm
Class SubCoordinator

java.lang.Object
  extended by javax.rmi.PortableRemoteObject
      extended by org.objectweb.jotm.SubCoordinator
All Implemented Interfaces:
Remote, org.objectweb.jotm.Resource

public class SubCoordinator
extends PortableRemoteObject
implements org.objectweb.jotm.Resource

This object is the local coordinator. It may be registered as sub-coordinator in case of distributed transaction, so it must be callable remotely and implement Resource


Field Summary
 
Fields inherited from interface org.objectweb.jotm.Resource
VOTE_COMMIT, VOTE_READONLY, VOTE_ROLLBACK
 
Method Summary
 void addJavaxXid(Xid javaxxid)
          add this javaxxid to the List
 boolean addResource(XAResource xares)
          add a XAResource to the list
 void addSynchronization(Synchronization synchro)
          add a Synchronization to the list
 void commit_one_phase()
          commit 1 phase.
 void commit()
          phase 2 of the 2PC.
 void forget()
          forget heuristics about this transaction.
 Xid getJavaxXid(int xaresindex)
          Get the javaxxid at specified index in the list
 int getStatus()
          return the status of this transaction
 int getXaresIndex(XAResource xares)
          return index in resourceList of this XAResource
 int prepare()
          phase 1 of the 2PC.
 void rollback()
          rollback transaction
 void setRollbackOnly()
          set the transaction "rollback only"
 
Methods inherited from class javax.rmi.PortableRemoteObject
connect, exportObject, narrow, toStub, unexportObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

prepare

public int prepare()
            throws RemoteException
phase 1 of the 2PC.

Specified by:
prepare in interface org.objectweb.jotm.Resource
Returns:
int vote commit, rollback, or readonly.
Throws:
RemoteException

rollback

public void rollback()
              throws RemoteException
rollback transaction

Specified by:
rollback in interface org.objectweb.jotm.Resource
Throws:
RemoteException

commit

public void commit()
            throws RemoteException
phase 2 of the 2PC.

Specified by:
commit in interface org.objectweb.jotm.Resource
Throws:
RemoteException

commit_one_phase

public void commit_one_phase()
                      throws RemoteException
commit 1 phase. Called either from JTM (distributed transaction) or from Transaction.commit (local transaction).

Specified by:
commit_one_phase in interface org.objectweb.jotm.Resource
Throws:
RemoteException

forget

public void forget()
            throws RemoteException
forget heuristics about this transaction.

Specified by:
forget in interface org.objectweb.jotm.Resource
Throws:
RemoteException

addSynchronization

public void addSynchronization(Synchronization synchro)
                        throws RollbackException,
                               IllegalStateException
add a Synchronization to the list

Parameters:
synchro - The javax.transaction.Synchronization object for the transaction associated with the target object
Throws:
RollbackException - Thrown to indicate that the transaction has been marked for rollback only.
IllegalStateException - Thrown if the transaction in the target object is in prepared state or the transaction is inactive.

addResource

public boolean addResource(XAResource xares)
                    throws IllegalStateException
add a XAResource to the list

Parameters:
xares - XAResource to register
Returns:
true if this datasource was already known
Throws:
IllegalStateException - Thrown if the transaction in the target object is in prepared state or the transaction is inactive.

addJavaxXid

public void addJavaxXid(Xid javaxxid)
add this javaxxid to the List

Parameters:
javaxxid -

getJavaxXid

public Xid getJavaxXid(int xaresindex)
Get the javaxxid at specified index in the list

Parameters:
xaresindex -
Returns:
javaxxid

getStatus

public int getStatus()
return the status of this transaction


setRollbackOnly

public void setRollbackOnly()
set the transaction "rollback only"


getXaresIndex

public int getXaresIndex(XAResource xares)
return index in resourceList of this XAResource

Parameters:
xares - the XAResource
Returns:
index


Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.