|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.jini.mahalo.TxnMgrProxy
class TxnMgrProxy
A 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.
Nested Class Summary | |
---|---|
(package private) static class |
TxnMgrProxy.ConstrainableTxnMgrProxy
A subclass of TxnMgrProxy that implements RemoteMethodControl. |
Nested classes/interfaces inherited from interface net.jini.core.transaction.server.TransactionManager |
---|
TransactionManager.Created |
Field Summary | |
---|---|
(package private) TxnManager |
backend
The reference to the transaction manager service implementation |
(package private) Uuid |
proxyID
The proxy's Uuid |
private static long |
serialVersionUID
|
Fields inherited from interface net.jini.core.transaction.server.TransactionConstants |
---|
ABORTED, ACTIVE, COMMITTED, NOTCHANGED, PREPARED, VOTING |
Constructor Summary | |
---|---|
private |
TxnMgrProxy(TxnManager txnMgr,
Uuid id)
Convenience constructor. |
Method Summary | |
---|---|
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 |
commit(long id)
Commit the transaction. |
void |
commit(long id,
long waitFor)
Commit the transaction, waiting for participants to be notified of the decision. |
TransactionManager.Created |
create(long lease)
Begin a new top-level transaction. |
(package private) static TxnMgrProxy |
create(TxnManager txnMgr,
Uuid id)
Creates a transaction manager proxy, returning an instance that implements RemoteMethodControl if the server does too. |
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. |
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 |
hashCode()
Proxies for servers with the same proxyID have the same hash code. |
void |
join(long id,
TransactionParticipant part,
long crashCount)
Join a transaction that is managed by this transaction manager. |
private void |
readObject(ObjectInputStream s)
When an instance of this class is deserialized, this method is automatically invoked. |
private void |
readObjectNoData()
During deserialization of an instance of this class, if it is found that the stream contains no data, this method is automatically invoked. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
final TxnManager backend
final Uuid proxyID
Uuid
Constructor Detail |
---|
private TxnMgrProxy(TxnManager txnMgr, Uuid id)
Method Detail |
---|
static TxnMgrProxy create(TxnManager txnMgr, Uuid id)
txnMgr
- the server proxyid
- the ID of the serverpublic TransactionManager.Created create(long lease) throws LeaseDeniedException, RemoteException
TransactionManager
create
in interface TransactionManager
lease
- the requested lease time for the transaction
LeaseDeniedException
- if this manager is unwilling to
grant the requested lease time
RemoteException
- if there is a communication errorpublic void join(long id, TransactionParticipant part, long crashCount) throws UnknownTransactionException, CannotJoinException, CrashCountException, RemoteException
TransactionManager
crashCount
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 TransactionManager
id
- the transaction IDpart
- the participant joining the transactioncrashCount
- the participant's current crash count
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 transaction
RemoteException
- if there is a communication errorServerTransaction.join(net.jini.core.transaction.server.TransactionParticipant, long)
public int getState(long id) throws UnknownTransactionException, RemoteException
TransactionManager
TransactionConstants
values.
getState
in interface TransactionManager
id
- the transaction ID
int
representing the state of the transaction
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 errorServerTransaction.getState()
,
TransactionConstants
public void commit(long id) throws UnknownTransactionException, CannotCommitException, RemoteException
TransactionManager
NOTCHANGED
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 TransactionManager
id
- the transaction ID
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 aborted
RemoteException
- if there is a communication errorpublic void commit(long id, long waitFor) throws UnknownTransactionException, CannotCommitException, TimeoutExpiredException, RemoteException
TransactionManager
NOTCHANGED
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 TransactionManager
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
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 aborted
TimeoutExpiredException
- if the transaction manager reaches
a decision, but is unable to notify all participants of that
decision before the specified timeout expires
RemoteException
- if there is a communication errorpublic void abort(long id) throws UnknownTransactionException, CannotAbortException, RemoteException
TransactionManager
abort
in interface TransactionManager
id
- the transaction ID
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
commit
RemoteException
- if there is a communication errorpublic void abort(long id, long waitFor) throws UnknownTransactionException, CannotAbortException, TimeoutExpiredException, RemoteException
TransactionManager
TimeoutExpiredException
is thrown.
abort
in interface TransactionManager
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
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
commit
TimeoutExpiredException
- if the timeout expires before
all participants have been notified
RemoteException
- if there is a communication errorpublic Object getAdmin() throws RemoteException
Administrable
getAdmin
in interface Administrable
RemoteException
JoinAdmin
public Uuid getReferentUuid()
getReferentUuid
in interface ReferentUuid
Uuid
that is associated with the
resource this proxy represents. This method will not return
null
.ReferentUuid
public int hashCode()
hashCode
in class Object
public boolean equals(Object o)
proxyID
are
considered equal.
equals
in class Object
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException
InvalidObjectException
- if the state of the
deserialized instance of this class is found to be invalid.
IOException
ClassNotFoundException
private void readObjectNoData() throws ObjectStreamException
InvalidObjectException
- to indicate that there
was no data in the stream during deserialization of an
instance of this class; declaring that something is wrong.
ObjectStreamException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |