Class GSServerTransaction
java.lang.Object
net.jini.core.transaction.server.ServerTransaction
com.gigaspaces.client.transaction.xa.GSServerTransaction
- All Implemented Interfaces:
ISwapExternalizable,SmartExternalizable,Externalizable,Serializable,ManagedTransaction,Transaction
Title: GSServerTransaction Description: Extends the ServerTransaction to hold Object id
should only be used as a key.
- Version:
- 4.5
- Author:
- Guy Korland
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.jini.core.transaction.Transaction
Transaction.Created -
Field Summary
Fields inherited from class net.jini.core.transaction.server.ServerTransaction
EMBEDDED_CRASH_COUNT, id, mgr -
Constructor Summary
ConstructorsConstructorDescriptionDo not use!.CtorGSServerTransaction(TransactionManager tm, Object id, long lease) GSServerTransaction(TransactionManager tm, Object id, TransactionParticipantDataImpl metaData) -
Method Summary
Modifier and TypeMethodDescriptionvoidabort()Abort the transaction.voidabort(long l) Abort the transaction, waiting for participants to be notified of the decision.voidcommit()Commit the transaction.voidcommit(long l) Commit the transaction, waiting for participants to be notified of the decision.static GSServerTransactioncreate(TransactionManager tm, Object id, long lease) protected ServerTransactionCreates an instance of this class for cloning using theServerTransaction.createCopy()method.booleanTwo instances are equal if they have the same transaction manager and the same transaction id.getId()intgetState()Returns the current state of the transaction.inthashCode()booleanisXid()voidjoin(TransactionParticipant part, long crashCount) Join the transaction.voidjoin(TransactionParticipant part, long crashCount, int partitionId, String clusterName) protected voidjoin(TransactionParticipant part, long crashCount, int partitionId, String clusterName, Object proxy) voidtoString()voidMethods inherited from class net.jini.core.transaction.server.ServerTransaction
create, getLease, getMetaData, getTransactionManager, initEmbedded, isEmbeddedMgrInProxy, isEmbeddedMgrProxySideInstance, isNested, joinIfNeededAndEmbedded, joinIfNeededAndEmbedded, needParticipantsJoin, readFromSwap, setEmbeddedMgrProxySideInstance, setLease, setMetaData, writeToSwapMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.gigaspaces.serialization.SmartExternalizable
enabledSmartExternalizableWithReference
-
Constructor Details
-
GSServerTransaction
public GSServerTransaction()Do not use!. Externalizable only. -
GSServerTransaction
-
GSServerTransaction
Ctor- Parameters:
tm- the local transaction manager for current transactionid- unique id for the transaction, should beXidfor XA transactions
-
GSServerTransaction
public GSServerTransaction(TransactionManager tm, Object id, TransactionParticipantDataImpl metaData)
-
-
Method Details
-
create
public static GSServerTransaction create(TransactionManager tm, Object id, long lease) throws RemoteException - Throws:
RemoteException
-
hashCode
public int hashCode()- Overrides:
hashCodein classServerTransaction
-
equals
Description copied from class:ServerTransactionTwo instances are equal if they have the same transaction manager and the same transaction id.- Overrides:
equalsin classServerTransaction
-
toString
- Overrides:
toStringin classServerTransaction
-
commit
Description copied from interface:TransactionCommit the transaction. Commit asks the transaction manager to execute the voting process with the participants. Returns if the transaction successfully reaches either theNOTCHANGEDor theCOMMITTEDstate, without waiting for the transaction manager to notify all participants of the decision. If the transaction must be aborted (because one or more participants are unable to prepare),CannotCommitExceptionis thrown without waiting for the transaction manager to notify all participants of the decision.- Specified by:
commitin interfaceTransaction- Overrides:
commitin classServerTransaction- Throws:
UnknownTransactionException- if the transaction is unknown to the manager. This may be because the transaction ID was incorrect, or because the transaction has proceeded to cleanup due to an earlier commit or abort, and has been forgotten.CannotCommitException- if the transaction reaches the ABORTED state, or is known to have previously reached that state due to an earlier commit or abort.RemoteException- if a communication error occurs.
-
commit
public void commit(long l) throws UnknownTransactionException, CannotCommitException, TimeoutExpiredException, RemoteException Description copied from interface:TransactionCommit the transaction, waiting for participants to be notified of the decision. Commit asks the transaction manager to execute the voting process with the participants. Returns if the transaction successfully reaches either theNOTCHANGEDor theCOMMITTEDstate, and the transaction manager has notified all participants of the decision, before the specified timeout expires. If the transaction must be aborted (because one or more participants are unable to prepare),CannotCommitExceptionis thrown if the transaction manager is able to notify all participants of the decision before the specified timeout expires. If the transaction manager reaches a decision, but is unable to notify all participants of that decision before the specified timeout expires, thenTimeoutExpiredExceptionis thrown. If the specified timeout expires before the transaction manager reaches a decision,TimeoutExpiredExceptionis not thrown until the manager reaches a decision.- Specified by:
commitin interfaceTransaction- Overrides:
commitin classServerTransaction- Parameters:
l- timeout to wait, from the start of the call until all participants have been notified of the transaction manager's decision- Throws:
UnknownTransactionException- if the transaction is unknown to the manager. This may be because the transaction ID was incorrect, or because the transaction has proceeded to cleanup due to an earlier commit or abort, and has been forgotten.CannotCommitException- if the transaction reaches the ABORTED state, or is known to have previously reached that state due to an earlier commit or abort.TimeoutExpiredException- if the timeout expires before all participants have been notified.RemoteException- if a communication error occurs.
-
abort
Description copied from interface:TransactionAbort the transaction. This can be called at any time by any object holding a reference to the transaction. Abort asks the transaction manager to abort the transaction and to notify each participant of the decision, resulting in them rolling back any state changes made as part of the transaction. Returns as soon as the transaction manager records the abort decision, without waiting for the transaction manager to notify all participants of the decision.- Specified by:
abortin interfaceTransaction- Overrides:
abortin classServerTransaction- Throws:
UnknownTransactionException- if the transaction is unknown to the manager. This may be because the transaction ID was incorrect, or because the transaction has proceeded to cleanup due to an earlier commit or abort, and has been forgotten.CannotAbortException- if the transaction is known to have previously reached the COMMITTED state due to an earlier commit.RemoteException- if a communication error occurs.
-
abort
public void abort(long l) throws UnknownTransactionException, CannotAbortException, TimeoutExpiredException, RemoteException Description copied from interface:TransactionAbort the transaction, waiting for participants to be notified of the decision. This can be called at any time by any object holding a reference to the transaction. Abort asks the transaction manager to abort the transaction and to notify each participant of the decision, resulting in them rolling back any state changes made as part of the transaction. Returns if the transaction manager records the decision and is able to notify all participants of the decision before the specified timeout expires. If the transaction manager is unable to notify all participants of the decision before the specified timeout expires, thenTimeoutExpiredExceptionis thrown.- Specified by:
abortin interfaceTransaction- Overrides:
abortin classServerTransaction- Parameters:
l- timeout to wait, from the start of the call until all participants have been notified of the transaction manager's decision.- Throws:
UnknownTransactionException- if the transaction is unknown to the manager. This may be because the transaction ID was incorrect, or because the transaction has proceeded to cleanup due to an earlier commit or abort, and has been forgotten.CannotAbortException- if the transaction is known to have previously reached the COMMITTED state due to an earlier commit.TimeoutExpiredException- if the timeout expires before all participants have been notified.RemoteException- if a communication error occurs.
-
join
public void join(TransactionParticipant part, long crashCount) throws UnknownTransactionException, CannotJoinException, CrashCountException, RemoteException Description copied from class:ServerTransactionJoin the transaction. ThecrashCountmarks 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.- Overrides:
joinin classServerTransaction- Parameters:
part- the participant joining the transactioncrashCount- the participant's current crash count- 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.CrashCountException- if the crash count provided for the participant differs from the crash count in a previous invocation of the same pairing of participant and transactionRemoteException- if there is a communication error
-
join
protected void join(TransactionParticipant part, long crashCount, int partitionId, String clusterName, Object proxy) throws UnknownTransactionException, CannotJoinException, CrashCountException, RemoteException - Overrides:
joinin classServerTransaction- Throws:
UnknownTransactionExceptionCannotJoinExceptionCrashCountExceptionRemoteException
-
join
public void join(TransactionParticipant part, long crashCount, int partitionId, String clusterName) throws UnknownTransactionException, CannotJoinException, CrashCountException, RemoteException - Overrides:
joinin classServerTransaction- Throws:
UnknownTransactionExceptionCannotJoinExceptionCrashCountExceptionRemoteException
-
getState
Description copied from class:ServerTransactionReturns the current state of the transaction. The returned state can be any of theTransactionConstantsvalues.- Overrides:
getStatein classServerTransaction- Returns:
- an
intrepresenting the state of the transaction - 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.RemoteException- if there is a communication error- See Also:
-
getId
- Returns:
- Returns the id.
-
isXid
public boolean isXid()- Overrides:
isXidin classServerTransaction
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Overrides:
writeExternalin classServerTransaction- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Overrides:
readExternalin classServerTransaction- Throws:
IOExceptionClassNotFoundException
-
createInstance
Description copied from class:ServerTransactionCreates an instance of this class for cloning using theServerTransaction.createCopy()method.- Overrides:
createInstancein classServerTransaction
-
createCopy
- Overrides:
createCopyin classServerTransaction
-