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.
|
EMBEDDED_CRASH_COUNT, id, mgr
Constructor and Description |
---|
NestableServerTransaction()
Do not use.
|
NestableServerTransaction(NestableTransactionManager mgr,
long id,
NestableServerTransaction parent,
long lease)
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.
|
void |
readExternal(ObjectInput in) |
String |
toString() |
void |
writeExternal(ObjectOutput out) |
abort, abort, commit, commit, create, createCopy, createInstance, equals, getLease, getMetaData, getState, getTransactionManager, hashCode, initEmbedded, isEmbeddedMgrInProxy, isEmbeddedMgrProxySideInstance, isXid, join, join, join, joinIfNeededAndEmbedded, joinIfNeededAndEmbedded, needParticipantsJoin, readFromSwap, setEmbeddedMgrProxySideInstance, setLease, setMetaData, writeToSwap
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
abort, abort, commit, commit
public NestableServerTransaction parent
public NestableServerTransaction()
public NestableServerTransaction(NestableTransactionManager mgr, long id, NestableServerTransaction parent, long lease)
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
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
writeExternal
in class ServerTransaction
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
readExternal
in class ServerTransaction
IOException
ClassNotFoundException
Copyright © GigaSpaces.