Package net.jini.core.transaction.server
Interface NestableTransactionManager
- All Superinterfaces:
Remote,TransactionConstants,TransactionManager
The interface used for managers of the two-phase commit protocol for nestable transactions. All
nestable transactions must have a transaction manager that runs this protocol.
- Since:
- 1.0
- Author:
- Sun Microsystems, Inc.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.jini.core.transaction.server.TransactionManager
TransactionManager.Created -
Field Summary
Fields inherited from interface net.jini.core.transaction.server.TransactionConstants
ABORTED, ACTIVE, COMMITTED, NOTCHANGED, PREPARED, VOTING -
Method Summary
Modifier and TypeMethodDescriptioncreate(NestableTransactionManager parentMgr, long parentID, long lease) Begin a nested transaction, with the specified transaction as parent.voidpromote(long id, TransactionParticipant[] parts, long[] crashCounts, TransactionParticipant drop) Promote the listed participants into the specified transaction.Methods inherited from interface net.jini.core.transaction.server.TransactionManager
abort, abort, commit, commit, create, getState, getTransactionManagerId, join, needParticipantsJoin
-
Method Details
-
create
TransactionManager.Created create(NestableTransactionManager parentMgr, long parentID, long lease) throws UnknownTransactionException, CannotJoinException, LeaseDeniedException, RemoteException Begin a nested transaction, with the specified transaction as parent.- Parameters:
parentMgr- the manager of the parent transactionparentID- the id of the parent transactionlease- the requested lease time for the transaction- Returns:
- the created transaction and the lease granted
- Throws:
UnknownTransactionException- if the transaction is unknown to the transaction manager, either because the transaction ID is incorrect or because the transaction is complete and its state has been discarded by the manager.CannotJoinException- if the transaction is known to the manager but is no longer active.LeaseDeniedException- if this manager is unwilling to grant the requested lease timeRemoteException- if there is a communication error
-
promote
void promote(long id, TransactionParticipant[] parts, long[] crashCounts, TransactionParticipant drop) throws UnknownTransactionException, CannotJoinException, CrashCountException, RemoteException Promote the listed participants into the specified transaction. This method is for use by the manager of a subtransaction when the subtransaction commits. At this point, all participants of the subtransaction must become participants in the parent transaction. Prior to this point, the subtransaction's manager was a participant of the parent transaction, but after a successful promotion it need no longer be one (if it was not itself a participant of the subtransaction), and so it may specify itself as a participant to drop from the transaction. Otherwise, participants should not be dropped out of transactions. For each promoted participant, the participant's crash count is stored in the corresponding element of thecrashCountsarray.- Parameters:
id- the id of the parent transactionparts- the participants being promoted to the parentcrashCounts- the crash counts of the participantsdrop- the manager to drop out, if any- Throws:
CrashCountException- if the crash count provided for at least one participant differs from the crash count in a previous invocation of the same pairing of participant and transactionUnknownTransactionException- if a transaction is unknown to the transaction manager, either because the transaction ID is incorrect or because the transaction is complete and its state has been discarded by the manager.CannotJoinException- if a transaction is known to the manager but is no longer active.RemoteException- if there is a communication error- See Also:
-