public class NestableServerTransaction extends ServerTransaction implements NestableTransaction
NestableTransaction
interface, for use
with transaction participants that implement the default transaction
semantics.NestableTransaction
,
NestableTransactionManager
,
TransactionFactory
,
Serialized FormNestableTransaction.Created
Modifier and Type | Field and Description |
---|---|
NestableServerTransaction |
parent
The parent transaction, if any.
|
id, mgr
Constructor and Description |
---|
NestableServerTransaction(AtomicSerial.GetArg arg) |
NestableServerTransaction(NestableTransactionManager mgr,
long id,
NestableServerTransaction parent)
Simple constructor.
|
Modifier and Type | Method and Description |
---|---|
NestableTransaction.Created |
create(long leaseTime)
Create a new nested transaction, with the current transaction as
parent, managed by the same transaction manager as the current
transaction.
|
NestableTransaction.Created |
create(NestableTransactionManager mgr,
long leaseTime)
Create a new nested transaction, with the current transaction as
parent, managed by the given transaction manager.
|
boolean |
enclosedBy(NestableTransaction enclosing)
Return true if the specified transaction is an ancestor of
this transaction.
|
boolean |
isNested()
Return true if the transaction has a parent, false if the transaction
is top level.
|
void |
promote(TransactionParticipant[] parts,
long[] crashCounts,
TransactionParticipant drop)
Promote the listed participants (from a subtransaction) into
this (the parent) transaction.
|
String |
toString() |
abort, abort, commit, commit, equals, getState, hashCode, join
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
abort, abort, commit, commit
public final NestableServerTransaction parent
public NestableServerTransaction(AtomicSerial.GetArg arg) throws IOException
IOException
public NestableServerTransaction(NestableTransactionManager mgr, long id, NestableServerTransaction parent)
TransactionFactory
and
NestableTransaction
methods.mgr
- the manager for this transactionid
- the transaction idparent
- the parent transaction, if anypublic NestableTransaction.Created create(NestableTransactionManager mgr, long leaseTime) throws UnknownTransactionException, CannotJoinException, LeaseDeniedException, RemoteException
NestableTransaction
create
in interface NestableTransaction
mgr
- the transaction manager to use for this transactionleaseTime
- the requested lease time for the transactionUnknownTransactionException
- if the parent transaction
is unknown to the parent transaction manager, either
because the transaction ID is incorrect or because the
transaction is no longer active and its state has been
discarded by the manager.CannotJoinException
- if the parent 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 errorpublic NestableTransaction.Created create(long leaseTime) throws UnknownTransactionException, CannotJoinException, LeaseDeniedException, RemoteException
NestableTransaction
create
in interface NestableTransaction
leaseTime
- the requested lease time for the transactionUnknownTransactionException
- if the parent transaction
is unknown to the parent transaction manager, either
because the transaction ID is incorrect or because the
transaction is no longer active and its state has been
discarded by the manager.CannotJoinException
- if the parent 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 errorpublic void promote(TransactionParticipant[] parts, long[] crashCounts, TransactionParticipant drop) throws UnknownTransactionException, CannotJoinException, CrashCountException, RemoteException
crashCounts
array.parts
- the participants being promoted to the parentcrashCounts
- the crash counts of the participantsdrop
- the manager to drop out, if anyCrashCountException
- 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 errorNestableTransactionManager.promote(long, net.jini.core.transaction.server.TransactionParticipant[], long[], net.jini.core.transaction.server.TransactionParticipant)
public boolean enclosedBy(NestableTransaction enclosing)
enclosing
- transaction to test for being an ancestorpublic boolean isNested()
ServerTransaction
isNested
in class ServerTransaction
public String toString()
toString
in class ServerTransaction
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.