com.sun.jini.mahalo
Class PassiveGroupMahalo

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

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

This class is to be used together with the com.sun.jini.start.ServiceStarter framework to start a group enabled transient implementation of Mahalo.

Author:
Rohnny Moland, Heine Kolltveit
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
PassiveGroupMahalo(java.lang.String[] configArgs, com.sun.jini.start.LifeCycle lifeCycle)
          Constructs a transaction manager with replication support.
 
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)
           
protected static InternalPassiveGroupTransactionManager getIPGTM()
          Get an InternalPassiveGroupTransactionManager.
 int getState(long id)
           
 java.lang.Object getState(jgroup.core.MemberId[] dests)
           
 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)
          FIXME: This should be "passively" replicated as well.
 void prepareChange()
           
 void printTxns(java.util.Map<java.lang.Long,GroupTxnManagerTransaction> txns)
          Prints transactions debug/state info.
 void putState(java.lang.Object state, jgroup.core.MemberId[] sources)
           
 java.lang.String toString()
           
 void transCommitted(long id)
           
 void transPrepared(java.lang.Object txnMgr, long tid)
          Transfers the state of the txn to other members of the group.
 void viewChange(jgroup.core.View view)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PassiveGroupMahalo

public PassiveGroupMahalo(java.lang.String[] configArgs,
                          com.sun.jini.start.LifeCycle lifeCycle)
                   throws java.lang.Exception
Constructs a transaction manager with replication support.

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
FIXME: This should be "passively" replicated as well.

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

@Anycast
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

@Anycast
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

@Anycast
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

@Anycast
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(jgroup.core.MemberId[] dests)

putState

public void putState(java.lang.Object state,
                     jgroup.core.MemberId[] sources)

transPrepared

public void transPrepared(java.lang.Object txnMgr,
                          long tid)
                   throws java.rmi.RemoteException
Description copied from interface: InternalPassiveGroupTransactionManager
Transfers the state of the txn to other members of the group.

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

transCommitted

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

printTxns

public void printTxns(java.util.Map<java.lang.Long,GroupTxnManagerTransaction> txns)
Prints transactions debug/state info.


toString

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

getIPGTM

protected static InternalPassiveGroupTransactionManager getIPGTM()
Get an InternalPassiveGroupTransactionManager.

Returns:
The InternalPassiveGroupTransactionManager

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


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