Class DummyTransactionManager
java.lang.Object
com.gigaspaces.internal.transaction.DummyTransactionManager
- All Implemented Interfaces:
Remote,ExtendedTransactionManager,TransactionConstants,TransactionManager
- Since:
- 9.6
- Author:
- Niv Ingberg
-
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 TypeMethodDescriptionvoidabort(long id) Abort the transaction.voidabort(long id, long waitFor) Abort the transaction, waiting for participants to be notified of the decision.voidvoidvoidcommit(long id) Commit the transaction.voidcommit(long id, long waitFor) Commit the transaction, waiting for participants to be notified of the decision.voidvoidcreate()create(long lease) Begin a new top-level transaction.booleandisJoin(long id, TransactionParticipant preparedPart) Remove a participant that was joined for a first time.static DummyTransactionManagerintgetState(long id) Returns the current state of the given transaction.intvoidjoin(long id, TransactionParticipant part, long crashCount) Join a transaction that is managed by this transaction manager.voidjoin(long id, TransactionParticipant part, long crashCount, int partitionId, String clusterName) voidjoin(long id, TransactionParticipant part, long crashCount, ServerTransaction userXtnObject) voidjoin(long id, TransactionParticipant part, long crashCount, ServerTransaction userXtnObject, int partitionId, String clusterName, Object clusterProxy) voidjoin(Object id, TransactionParticipant part, long crashCount) voidjoin(Object id, TransactionParticipant part, long crashCount, int partitionId, String clusterName) voidjoin(Object id, TransactionParticipant part, long crashCount, ServerTransaction userXtnObject) voidjoin(Object id, TransactionParticipant part, long crashCount, ServerTransaction userXtnObject, int partitionId, String clusterName, Object clusterProxy) booleanreturns true if this mgr which requires that the txn participants join into the txn in contrary to a mgr which the participants are known prior to txn propagationintprepare the underlying xtn designated by the rendered xid
-
Method Details
-
getInstance
-
create
- Throws:
RemoteException
-
needParticipantsJoin
Description copied from interface:TransactionManagerreturns true if this mgr which requires that the txn participants join into the txn in contrary to a mgr which the participants are known prior to txn propagation- Specified by:
needParticipantsJoinin interfaceTransactionManager- Returns:
- true if its a mgr which requires the txn participants to join
- Throws:
RemoteException
-
getTransactionManagerId
- Specified by:
getTransactionManagerIdin interfaceTransactionManager- Throws:
RemoteException
-
create
Description copied from interface:TransactionManagerBegin a new top-level transaction.- Specified by:
createin interfaceTransactionManager- Parameters:
lease- the requested lease time for the transaction- Returns:
- the transaction ID and the lease granted
- Throws:
LeaseDeniedException- if this manager is unwilling to grant the requested lease timeRemoteException- if there is a communication error
-
join
public void join(long id, TransactionParticipant part, long crashCount) throws UnknownTransactionException, CannotJoinException, CrashCountException, RemoteException Description copied from interface:TransactionManagerJoin a transaction that is managed by this transaction manager. 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.- Specified by:
joinin interfaceTransactionManager- Parameters:
id- the transaction IDpart- 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- See Also:
-
getState
Description copied from interface:TransactionManagerReturns the current state of the given transaction. The returned state can be any of theTransactionConstantsvalues.- Specified by:
getStatein interfaceTransactionManager- Parameters:
id- the transaction ID- 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:
-
commit
public void commit(long id) throws UnknownTransactionException, CannotCommitException, RemoteException Description copied from interface:TransactionManagerCommit 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 interfaceTransactionManager- Parameters:
id- the transaction ID- 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.CannotCommitException- if the transaction is being or already has been abortedRemoteException- if there is a communication error
-
commit
public void commit(long id, long waitFor) throws UnknownTransactionException, CannotCommitException, TimeoutExpiredException, RemoteException Description copied from interface:TransactionManagerCommit 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 interfaceTransactionManager- Parameters:
id- the transaction IDwaitFor- 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 transaction manager, either because the transaction ID is incorrect or because the transaction is complete and its state has been discarded by the manager.CannotCommitException- if the transaction is being or already has been abortedTimeoutExpiredException- if the transaction manager reaches a decision, but is unable to notify all participants of that decision before the specified timeout expiresRemoteException- if there is a communication error
-
abort
public void abort(long id) throws UnknownTransactionException, CannotAbortException, RemoteException Description copied from interface:TransactionManagerAbort 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 interfaceTransactionManager- Parameters:
id- the transaction ID- 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.CannotAbortException- if the transaction is known to have previously reached the COMMITTED state due to an earlier commitRemoteException- if there is a communication error
-
abort
public void abort(long id, long waitFor) throws UnknownTransactionException, CannotAbortException, TimeoutExpiredException, RemoteException Description copied from interface:TransactionManagerAbort 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 interfaceTransactionManager- Parameters:
id- the transaction IDwaitFor- 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 transaction manager, either because the transaction ID is incorrect or because the transaction is complete and its state has been discarded by the manager.CannotAbortException- if the transaction is known to have previously reached the COMMITTED state due to an earlier commitTimeoutExpiredException- if the timeout expires before all participants have been notifiedRemoteException- if there is a communication error
-
disJoin
public boolean disJoin(long id, TransactionParticipant preparedPart) throws UnknownTransactionException, RemoteException Description copied from interface:ExtendedTransactionManagerRemove a participant that was joined for a first time. called when a call to a participant returned empty so we can spare calling commit or abort on it, usually used in embedded mahalo- Specified by:
disJoinin interfaceExtendedTransactionManagerpreparedPart- The joiningTransactionParticpant- Returns:
- true if participant disjoined
- Throws:
UnknownTransactionExceptionRemoteException- See Also:
-
commit
public void commit(Object xid) throws UnknownTransactionException, CannotCommitException, RemoteException - Specified by:
commitin interfaceExtendedTransactionManager- Throws:
UnknownTransactionExceptionCannotCommitExceptionRemoteException
-
commit
public void commit(Object xid, long waitFor) throws UnknownTransactionException, CannotCommitException, TimeoutExpiredException, RemoteException - Specified by:
commitin interfaceExtendedTransactionManager- Throws:
UnknownTransactionExceptionCannotCommitExceptionTimeoutExpiredExceptionRemoteException
-
abort
public void abort(Object xid) throws UnknownTransactionException, CannotAbortException, RemoteException - Specified by:
abortin interfaceExtendedTransactionManager- Throws:
UnknownTransactionExceptionCannotAbortExceptionRemoteException
-
abort
public void abort(Object xid, long waitFor) throws UnknownTransactionException, CannotAbortException, TimeoutExpiredException, RemoteException - Specified by:
abortin interfaceExtendedTransactionManager- Throws:
UnknownTransactionExceptionCannotAbortExceptionTimeoutExpiredExceptionRemoteException
-
prepare
public int prepare(Object xid) throws CannotCommitException, UnknownTransactionException, RemoteException Description copied from interface:ExtendedTransactionManagerprepare the underlying xtn designated by the rendered xid- Specified by:
preparein interfaceExtendedTransactionManager- Throws:
CannotCommitExceptionUnknownTransactionExceptionRemoteException
-
join
public void join(Object id, TransactionParticipant part, long crashCount) throws UnknownTransactionException, CannotJoinException, CrashCountException, RemoteException - Specified by:
joinin interfaceExtendedTransactionManager- Throws:
UnknownTransactionExceptionCannotJoinExceptionCrashCountExceptionRemoteException
-
create
public TransactionManager.Created create(Object xid, long lease) throws LeaseDeniedException, RemoteException - Specified by:
createin interfaceExtendedTransactionManager- Throws:
LeaseDeniedExceptionRemoteException
-
getState
- Specified by:
getStatein interfaceExtendedTransactionManager- Throws:
UnknownTransactionExceptionRemoteException
-
join
public void join(long id, TransactionParticipant part, long crashCount, ServerTransaction userXtnObject) throws UnknownTransactionException, CannotJoinException, CrashCountException, RemoteException - Specified by:
joinin interfaceExtendedTransactionManager- Throws:
UnknownTransactionExceptionCannotJoinExceptionCrashCountExceptionRemoteException
-
join
public void join(Object id, TransactionParticipant part, long crashCount, ServerTransaction userXtnObject) throws UnknownTransactionException, CannotJoinException, CrashCountException, RemoteException - Specified by:
joinin interfaceExtendedTransactionManager- Throws:
UnknownTransactionExceptionCannotJoinExceptionCrashCountExceptionRemoteException
-
join
public void join(long id, TransactionParticipant part, long crashCount, int partitionId, String clusterName) throws UnknownTransactionException, CannotJoinException, CrashCountException, RemoteException - Specified by:
joinin interfaceExtendedTransactionManager- Throws:
UnknownTransactionExceptionCannotJoinExceptionCrashCountExceptionRemoteException
-
join
public void join(Object id, TransactionParticipant part, long crashCount, int partitionId, String clusterName) throws UnknownTransactionException, CannotJoinException, CrashCountException, RemoteException - Specified by:
joinin interfaceExtendedTransactionManager- Throws:
UnknownTransactionExceptionCannotJoinExceptionCrashCountExceptionRemoteException
-
join
public void join(long id, TransactionParticipant part, long crashCount, ServerTransaction userXtnObject, int partitionId, String clusterName, Object clusterProxy) throws UnknownTransactionException, CannotJoinException, CrashCountException, RemoteException - Specified by:
joinin interfaceExtendedTransactionManager- Throws:
UnknownTransactionExceptionCannotJoinExceptionCrashCountExceptionRemoteException
-
join
public void join(Object id, TransactionParticipant part, long crashCount, ServerTransaction userXtnObject, int partitionId, String clusterName, Object clusterProxy) throws UnknownTransactionException, CannotJoinException, CrashCountException, RemoteException - Specified by:
joinin interfaceExtendedTransactionManager- Throws:
UnknownTransactionExceptionCannotJoinExceptionCrashCountExceptionRemoteException
-