public class TxnMgrProxy extends Object implements ExtendedTransactionManager, Administrable, Externalizable, ReferentUuid, MarshalPivotProvider
TxnMgrProxy is a proxy for the
transaction manager service.
This is the object passed to clients of this service.
It implements the TransactionManager and the
Administrable interfaces.TransactionManager.Created| Modifier and Type | Field and Description |
|---|---|
Uuid |
proxyID
The proxy's
Uuid |
ABORTED, ACTIVE, COMMITTED, NOTCHANGED, PREPARED, VOTING| Constructor and Description |
|---|
TxnMgrProxy() |
| Modifier and Type | Method and Description |
|---|---|
void |
abort(long id)
Abort the transaction.
|
void |
abort(long id,
long waitFor)
Abort the transaction, waiting for participants to be notified of
the decision.
|
void |
abort(Object xid) |
void |
abort(Object xid,
long waitFor) |
void |
commit(long id)
Commit the transaction.
|
void |
commit(long id,
long waitFor)
Commit the transaction, waiting for participants to be notified of
the decision.
|
void |
commit(Object xid) |
void |
commit(Object xid,
long waitFor) |
TransactionManager.Created |
create(long lease)
Begin a new top-level transaction.
|
TransactionManager.Created |
create(Object xid,
long lease) |
static TxnMgrProxy |
create(TxnManager txnMgr,
TxnManager direct,
Uuid id) |
TxnMgrProxy |
createLightProxy() |
boolean |
disJoin(long id,
TransactionParticipant part)
Remove 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
|
boolean |
equals(Object o)
Proxies for servers with the same
proxyID are
considered equal. |
Object |
getAdmin()
Returns an object that implements whatever administration interfaces
are appropriate for the particular service.
|
MarshalPivot |
getMarshalPivot() |
TxnManager |
getProxy() |
Uuid |
getReferentUuid()
Returns the universally unique identifier that has been assigned to the
resource this proxy represents.
|
int |
getState(long id)
Returns the current state of the given transaction.
|
int |
getState(Object xid) |
Uuid |
getTransactionManagerId() |
int |
hashCode()
Proxies for servers with the same proxyID have the same hash code.
|
boolean |
isEmbeddedMgr() |
void |
join(long id,
TransactionParticipant part,
long crashCount)
Join a transaction that is managed by this transaction manager.
|
void |
join(long id,
TransactionParticipant part,
long crashCount,
int partitionId,
String clusterName) |
void |
join(long id,
TransactionParticipant part,
long crashCount,
ServerTransaction userXtnObject)
Deprecated.
|
void |
join(long id,
TransactionParticipant part,
long crashCount,
ServerTransaction userXtnObject,
int partitionId,
String clusterName,
Object clusterProxy) |
void |
join(Object id,
TransactionParticipant part,
long crashCount) |
void |
join(Object id,
TransactionParticipant part,
long crashCount,
int partitionId,
String clusterName) |
void |
join(Object id,
TransactionParticipant part,
long crashCount,
ServerTransaction userXtnObject)
Deprecated.
|
void |
join(Object id,
TransactionParticipant part,
long crashCount,
ServerTransaction userXtnObject,
int partitionId,
String clusterName,
Object clusterProxy) |
boolean |
needParticipantsJoin()
returns 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
|
int |
prepare(Object xid)
prepare the underlying xtn designated by the rendered xid
|
void |
readExternal(ObjectInput in) |
void |
reenterPreparedExternalXid(Object xid,
List<TransactionParticipant> parts)
Retrieves a
Transaction given the
transaction's ID. |
String |
toString() |
void |
writeExternal(ObjectOutput out) |
public Uuid proxyID
Uuidpublic static TxnMgrProxy create(TxnManager txnMgr, TxnManager direct, Uuid id)
public TxnMgrProxy createLightProxy()
public TransactionManager.Created create(long lease) throws LeaseDeniedException, RemoteException
TransactionManagercreate in interface TransactionManagerlease - the requested lease time for the transactionLeaseDeniedException - if this manager is unwilling to
grant the requested lease timeRemoteException - if there is a communication errorpublic void join(long id,
TransactionParticipant part,
long crashCount)
throws UnknownTransactionException,
CannotJoinException,
CrashCountException,
RemoteException
TransactionManagercrashCount marks 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.join in interface TransactionManagerid - the transaction IDpart - the participant joining the transactioncrashCount - the participant's current crash countUnknownTransactionException - 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 errorServerTransaction.join(net.jini.core.transaction.server.TransactionParticipant, long)public boolean disJoin(long id,
TransactionParticipant part)
throws UnknownTransactionException,
RemoteException
ExtendedTransactionManagerdisJoin in interface ExtendedTransactionManagerUnknownTransactionExceptionRemoteExceptionTransactionParticipantpublic int getState(long id)
throws UnknownTransactionException,
RemoteException
TransactionManagerTransactionConstants values.getState in interface TransactionManagerid - the transaction IDint representing the state of the transactionUnknownTransactionException - 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 errorServerTransaction.getState(),
TransactionConstantspublic void commit(long id)
throws UnknownTransactionException,
CannotCommitException,
RemoteException
TransactionManagerNOTCHANGED
or the COMMITTED state, 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), CannotCommitException is thrown
without waiting for the transaction manager to notify all participants
of the decision.commit in interface TransactionManagerid - the transaction IDUnknownTransactionException - 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 errorpublic void commit(long id,
long waitFor)
throws UnknownTransactionException,
CannotCommitException,
TimeoutExpiredException,
RemoteException
TransactionManagerNOTCHANGED or the
COMMITTED state, 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),
CannotCommitException is 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, then
TimeoutExpiredException is thrown. If the specified
timeout expires before the transaction manager reaches a decision,
TimeoutExpiredException is not thrown until the
manager reaches a decision.commit in interface TransactionManagerid - the transaction IDwaitFor - timeout to wait, from the start of the call until
all participants have been notified of the transaction manager's
decisionUnknownTransactionException - 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 errorpublic void abort(long id)
throws UnknownTransactionException,
CannotAbortException,
RemoteException
TransactionManagerabort in interface TransactionManagerid - the transaction IDUnknownTransactionException - 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 errorpublic void abort(long id,
long waitFor)
throws UnknownTransactionException,
CannotAbortException,
TimeoutExpiredException,
RemoteException
TransactionManagerTimeoutExpiredException
is thrown.abort in interface TransactionManagerid - the transaction IDwaitFor - timeout to wait, from the start of the call until
all participants have been notified of the transaction manager's
decisionUnknownTransactionException - 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 errorpublic int prepare(Object xid) throws CannotCommitException, UnknownTransactionException, RemoteException
ExtendedTransactionManagerprepare in interface ExtendedTransactionManagerUnknownTransactionExceptionRemoteExceptionCannotCommitExceptionpublic void commit(Object xid) throws UnknownTransactionException, CannotCommitException, RemoteException
commit in interface ExtendedTransactionManagerUnknownTransactionExceptionCannotCommitExceptionRemoteExceptionpublic void commit(Object xid, long waitFor) throws UnknownTransactionException, CannotCommitException, TimeoutExpiredException, RemoteException
commit in interface ExtendedTransactionManagerUnknownTransactionExceptionCannotCommitExceptionTimeoutExpiredExceptionRemoteExceptionpublic void abort(Object xid) throws UnknownTransactionException, CannotAbortException, RemoteException
abort in interface ExtendedTransactionManagerUnknownTransactionExceptionCannotAbortExceptionRemoteExceptionpublic void abort(Object xid, long waitFor) throws UnknownTransactionException, CannotAbortException, TimeoutExpiredException, RemoteException
abort in interface ExtendedTransactionManagerUnknownTransactionExceptionCannotAbortExceptionTimeoutExpiredExceptionRemoteExceptionpublic TransactionManager.Created create(Object xid, long lease) throws LeaseDeniedException, RemoteException
create in interface ExtendedTransactionManagerLeaseDeniedExceptionRemoteExceptionpublic int getState(Object xid) throws UnknownTransactionException, RemoteException
getState in interface ExtendedTransactionManagerUnknownTransactionExceptionRemoteExceptionpublic void join(Object id, TransactionParticipant part, long crashCount) throws UnknownTransactionException, CannotJoinException, CrashCountException, RemoteException
join in interface ExtendedTransactionManagerUnknownTransactionExceptionCannotJoinExceptionCrashCountExceptionRemoteException@Deprecated public void join(long id, TransactionParticipant part, long crashCount, ServerTransaction userXtnObject) throws UnknownTransactionException, CannotJoinException, CrashCountException, RemoteException
join in interface ExtendedTransactionManagerUnknownTransactionExceptionCannotJoinExceptionCrashCountExceptionRemoteException@Deprecated public void join(Object id, TransactionParticipant part, long crashCount, ServerTransaction userXtnObject) throws UnknownTransactionException, CannotJoinException, CrashCountException, RemoteException
join in interface ExtendedTransactionManagerUnknownTransactionExceptionCannotJoinExceptionCrashCountExceptionRemoteExceptionpublic void join(long id,
TransactionParticipant part,
long crashCount,
int partitionId,
String clusterName)
throws UnknownTransactionException,
CannotJoinException,
CrashCountException,
RemoteException
join in interface ExtendedTransactionManagerUnknownTransactionExceptionCannotJoinExceptionCrashCountExceptionRemoteExceptionpublic void join(Object id, TransactionParticipant part, long crashCount, int partitionId, String clusterName) throws UnknownTransactionException, CannotJoinException, CrashCountException, RemoteException
join in interface ExtendedTransactionManagerUnknownTransactionExceptionCannotJoinExceptionCrashCountExceptionRemoteExceptionpublic void join(long id,
TransactionParticipant part,
long crashCount,
ServerTransaction userXtnObject,
int partitionId,
String clusterName,
Object clusterProxy)
throws UnknownTransactionException,
CannotJoinException,
CrashCountException,
RemoteException
join in interface ExtendedTransactionManagerUnknownTransactionExceptionCannotJoinExceptionCrashCountExceptionRemoteExceptionpublic void join(Object id, TransactionParticipant part, long crashCount, ServerTransaction userXtnObject, int partitionId, String clusterName, Object clusterProxy) throws UnknownTransactionException, CannotJoinException, CrashCountException, RemoteException
join in interface ExtendedTransactionManagerUnknownTransactionExceptionCannotJoinExceptionCrashCountExceptionRemoteExceptionpublic void reenterPreparedExternalXid(Object xid, List<TransactionParticipant> parts) throws RemoteException, CannotCommitException
Transaction given the
transaction's ID.id - the idRemoteExceptionCannotCommitExceptionpublic Object getAdmin() throws RemoteException
AdministrablegetAdmin in interface AdministrableRemoteExceptionJoinAdminpublic Uuid getReferentUuid()
getReferentUuid in interface ReferentUuidUuid that is associated with the
resource this proxy represents. This method will not return
null.ReferentUuidpublic int hashCode()
public boolean equals(Object o)
proxyID are
considered equal.public TxnManager getProxy()
public boolean needParticipantsJoin()
needParticipantsJoin in interface TransactionManagerpublic boolean isEmbeddedMgr()
public void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic MarshalPivot getMarshalPivot() throws RemoteException
getMarshalPivot in interface MarshalPivotProviderRemoteExceptionpublic Uuid getTransactionManagerId() throws RemoteException
getTransactionManagerId in interface TransactionManagerRemoteExceptionCopyright © GigaSpaces.