com.sun.jini.mahalo
Class GroupTransientMahalo

java.lang.Object
  extended by com.sun.jini.mahalo.GroupTransientMahalo
All Implemented Interfaces:
java.io.Serializable, java.rmi.Remote, jgroup.core.ExternalGMIListener, jgroup.core.InternalGMIListener, jgroup.core.MembershipListener, InternalGroupTransactionManager, net.jini.core.transaction.server.TransactionConstants, net.jini.core.transaction.server.TransactionManager

public class GroupTransientMahalo
extends java.lang.Object
implements net.jini.core.transaction.server.TransactionManager, jgroup.core.MembershipListener, jgroup.core.ExternalGMIListener, InternalGroupTransactionManager

Transient, non-persistent Transaction Manager with replication support. Uses GMI Leadercast semantics to create transaction and transfer state to the replicas. GMI with total ordering is used in the transaction join and voting process.

To start the Transaction Manager, it is preferred to use the com.sun.jini.start.ServiceStarter framework, which is included in the Jini distribution.

Author:
Rohnny Moland
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface net.jini.core.transaction.server.TransactionManager
net.jini.core.transaction.server.TransactionManager.Created
 
Nested classes/interfaces inherited from interface jgroup.core.MembershipListener
jgroup.core.MembershipListener.AllowDuplicateViews
 
Field Summary
 
Fields inherited from interface net.jini.core.transaction.server.TransactionConstants
ABORTED, ACTIVE, COMMITTED, NOTCHANGED, PREPARED, VOTING
 
Constructor Summary
GroupTransientMahalo(java.lang.String[] configArgs, com.sun.jini.start.LifeCycle lifeCycle)
          Construct a new instance of TxnManagerImpl and initialize Jgroup services and fields.
 
Method Summary
 void abort(long id)
           
 void abort(long id, long waitFor)
           
 void commit(long id)
           
 void commit(long id, long waitFor)
           
 net.jini.core.transaction.server.TransactionManager.Created create(long lease)
           
 java.lang.Object getState()
           
 int getState(long id)
           
 int hashCode()
           
 void hasLeft()
           
 void internalCommit(long id)
           
 void internalCreate(java.lang.Object txnMgr, long id)
          Transfers the non-deterministic state of the txn create to other members of the group.
 void join(long id, net.jini.core.transaction.server.TransactionParticipant part, long crashCount)
           
 void prepareChange()
           
 void putState(java.lang.Object state)
           
 java.lang.String toString()
           
 void viewChange(jgroup.core.View view)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GroupTransientMahalo

public GroupTransientMahalo(java.lang.String[] configArgs,
                            com.sun.jini.start.LifeCycle lifeCycle)
                     throws java.lang.Exception
Construct a new instance of TxnManagerImpl and initialize Jgroup services and fields.

Parameters:
configArgs - String array whose elements are the arguments to use when creating the server.
lifeCycle - instance of LifeCycle that, if non-null, will cause this object's unregister method to be invoked during shutdown to notify the service starter framework that the reference to this service's implementation can be 'released' for garbage collection. A value of null for this argument is allowed.
Throws:
java.lang.Exception - If there was a problem initializing the service.
Method Detail

viewChange

public void viewChange(jgroup.core.View view)
Specified by:
viewChange in interface jgroup.core.MembershipListener

prepareChange

public void prepareChange()
Specified by:
prepareChange in interface jgroup.core.MembershipListener

hasLeft

public void hasLeft()
Specified by:
hasLeft in interface jgroup.core.MembershipListener

create

@Anycast
public net.jini.core.transaction.server.TransactionManager.Created create(long lease)
                                                                   throws net.jini.core.lease.LeaseDeniedException,
                                                                          java.rmi.RemoteException
Specified by:
create in interface net.jini.core.transaction.server.TransactionManager
Throws:
net.jini.core.lease.LeaseDeniedException
java.rmi.RemoteException

join

@Atomic
public void join(long id,
                        net.jini.core.transaction.server.TransactionParticipant part,
                        long crashCount)
          throws net.jini.core.transaction.UnknownTransactionException,
                 net.jini.core.transaction.CannotJoinException,
                 net.jini.core.transaction.server.CrashCountException,
                 java.rmi.RemoteException
Specified by:
join in interface net.jini.core.transaction.server.TransactionManager
Throws:
net.jini.core.transaction.UnknownTransactionException
net.jini.core.transaction.CannotJoinException
net.jini.core.transaction.server.CrashCountException
java.rmi.RemoteException

getState

@Anycast
public int getState(long id)
             throws net.jini.core.transaction.UnknownTransactionException
Specified by:
getState in interface net.jini.core.transaction.server.TransactionManager
Throws:
net.jini.core.transaction.UnknownTransactionException

commit

@Atomic
public void commit(long id)
            throws net.jini.core.transaction.UnknownTransactionException,
                   net.jini.core.transaction.CannotCommitException,
                   java.rmi.RemoteException
Specified by:
commit in interface net.jini.core.transaction.server.TransactionManager
Throws:
net.jini.core.transaction.UnknownTransactionException
net.jini.core.transaction.CannotCommitException
java.rmi.RemoteException

commit

@Atomic
public void commit(long id,
                          long waitFor)
            throws net.jini.core.transaction.UnknownTransactionException,
                   net.jini.core.transaction.CannotCommitException,
                   net.jini.core.transaction.TimeoutExpiredException,
                   java.rmi.RemoteException
Specified by:
commit in interface net.jini.core.transaction.server.TransactionManager
Throws:
net.jini.core.transaction.UnknownTransactionException
net.jini.core.transaction.CannotCommitException
net.jini.core.transaction.TimeoutExpiredException
java.rmi.RemoteException

abort

@Atomic
public void abort(long id)
           throws net.jini.core.transaction.UnknownTransactionException,
                  net.jini.core.transaction.CannotAbortException
Specified by:
abort in interface net.jini.core.transaction.server.TransactionManager
Throws:
net.jini.core.transaction.UnknownTransactionException
net.jini.core.transaction.CannotAbortException

abort

@Atomic
public void abort(long id,
                         long waitFor)
           throws net.jini.core.transaction.UnknownTransactionException,
                  net.jini.core.transaction.CannotAbortException,
                  net.jini.core.transaction.TimeoutExpiredException
Specified by:
abort in interface net.jini.core.transaction.server.TransactionManager
Throws:
net.jini.core.transaction.UnknownTransactionException
net.jini.core.transaction.CannotAbortException
net.jini.core.transaction.TimeoutExpiredException

getState

public java.lang.Object getState()

putState

public void putState(java.lang.Object state)

internalCreate

public void internalCreate(java.lang.Object txnMgr,
                           long id)
                    throws java.rmi.RemoteException
Description copied from interface: InternalGroupTransactionManager
Transfers the non-deterministic state of the txn create to other members of the group.

Specified by:
internalCreate in interface InternalGroupTransactionManager
Parameters:
txnMgr - The TxnManagerTransaction object
id - Transaction id of current transaction
Throws:
java.rmi.RemoteException

internalCommit

public void internalCommit(long id)
                    throws net.jini.core.transaction.UnknownTransactionException,
                           net.jini.core.transaction.CannotCommitException,
                           java.rmi.RemoteException
Specified by:
internalCommit in interface InternalGroupTransactionManager
Throws:
net.jini.core.transaction.UnknownTransactionException
net.jini.core.transaction.CannotCommitException
java.rmi.RemoteException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 1998-2006 The Jgroup/ARM development team. All Rights Reserved.