net.jini.core.transaction.server
Class ServerTransaction
java.lang.Object
|
+--net.jini.core.transaction.server.ServerTransaction
- Direct Known Subclasses:
- NestableServerTransaction
- public class ServerTransaction
- extends java.lang.Object
- implements Transaction, java.io.Serializable
Class implementing the Transaction
interface, for use with
transaction participants that implement the default transaction semantics.
- See Also:
Transaction
,
NestableServerTransaction
,
TransactionManager
,
TransactionFactory
, Serialized Form
Method Summary |
void |
abort()
|
void |
abort(long waitFor)
|
void |
commit()
|
void |
commit(long waitFor)
|
boolean |
equals(java.lang.Object other)
Two instances are equal if they have the same transaction manager
and the same transaction id. |
int |
getState()
Returns the current state of the transaction. |
int |
hashCode()
|
boolean |
isNested()
Return true if the transaction has a parent, false if the transaction
is top level. |
void |
join(TransactionParticipant part,
long crashCount)
Join the transaction. |
Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
notify,
notifyAll,
toString,
wait,
wait,
wait |
mgr
public final TransactionManager mgr
- The transaction manager.
id
public final long id
- The transaction id.
ServerTransaction
public ServerTransaction(TransactionManager mgr,
long id)
- Simple constructor. Clients should not call this directly, but
should instead use
TransactionFactory
.
- Parameters:
mgr
- the manager for this transactionid
- the transaction id
hashCode
public int hashCode()
- Overrides:
- hashCode in class java.lang.Object
equals
public boolean equals(java.lang.Object other)
- Two instances are equal if they have the same transaction manager
and the same transaction id.
- Overrides:
- equals in class java.lang.Object
commit
public void commit()
throws UnknownTransactionException,
CannotCommitException,
java.rmi.RemoteException
- Specified by:
- commit in interface Transaction
commit
public void commit(long waitFor)
throws UnknownTransactionException,
CannotCommitException,
TimeoutExpiredException,
java.rmi.RemoteException
- Specified by:
- commit in interface Transaction
abort
public void abort()
throws UnknownTransactionException,
CannotAbortException,
java.rmi.RemoteException
- Specified by:
- abort in interface Transaction
abort
public void abort(long waitFor)
throws UnknownTransactionException,
CannotAbortException,
TimeoutExpiredException,
java.rmi.RemoteException
- Specified by:
- abort in interface Transaction
join
public void join(TransactionParticipant part,
long crashCount)
throws UnknownTransactionException,
CannotJoinException,
CrashCountException,
java.rmi.RemoteException
- Join the transaction. The
crashCount
marks the state of
the storage used by the participant for transactions. If the
participant attempts to join a transaction more than once, the crash
counts must be the same. Each system crash or other event that
destroys the state of the participant's unprepared transaction storage
must cause the crash count to increase by at least one.
- Parameters:
part
- the participant joining the transactioncrashCount
- the participant's current crash count- See Also:
join(net.jini.core.transaction.server.TransactionParticipant, long)
getState
public int getState()
throws UnknownTransactionException,
java.rmi.RemoteException
- Returns the current state of the transaction. The returned
state can be any of the
TransactionConstants
values.
- See Also:
getState()
,
TransactionConstants
isNested
public boolean isNested()
- Return true if the transaction has a parent, false if the transaction
is top level.
Copyright © 1999 Sun Microsystems, Inc. All rights reserved