org.objectweb.jotm

Class SubCoordinator

Implemented Interfaces:
Remote, Resource

public class SubCoordinator
extends PortableRemoteObject
implements 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

Fields inherited from interface org.objectweb.jotm.Resource

VOTE_COMMIT, VOTE_READONLY, VOTE_ROLLBACK

Method Summary

void
addJavaXid(Xid javaxxid)
boolean
addResource(XAResource xares)
add a XAResource to the list
void
addSynchronization(Synchronization synchro)
add a Synchronization to the list
void
commit()
phase 2 of the 2PC.
void
commit_one_phase()
commit 1 phase.
void
forget()
forget heuristics about this transaction.
Xid
getJavaxXid(int xaresindex)
int
getStatus()
return the status of this transaction
int
getXaresIndex(XAResource xares)
int
prepare()
phase 1 of the 2PC.
void
rollback()
rollback transaction
void
setRollbackOnly()
set the transaction "rollback only"

Method Details

addJavaXid

public void addJavaXid(Xid javaxxid)


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


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


commit

public void commit()
            throws RemoteException
phase 2 of the 2PC.
Specified by:
commit in interface Resource


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 Resource


forget

public void forget()
            throws RemoteException
forget heuristics about this transaction.
Specified by:
forget in interface Resource


getJavaxXid

public Xid getJavaxXid(int xaresindex)


getStatus

public int getStatus()
return the status of this transaction


getXaresIndex

public int getXaresIndex(XAResource xares)


prepare

public int prepare()
            throws RemoteException
phase 1 of the 2PC.
Specified by:
prepare in interface Resource

Returns:
int vote commit, rollback, or readonly.


rollback

public void rollback()
            throws RemoteException
rollback transaction
Specified by:
rollback in interface Resource


setRollbackOnly

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