public class TxnManagerImpl extends Object implements TxnManager, LeaseExpirationMgr.Expirer, com.sun.jini.mahalo.log.LogRecovery, TxnSettler, com.sun.jini.constants.TimeConstants, com.sun.jini.landlord.LocalLandlord, net.jini.security.proxytrust.ServerProxyTrust, net.jini.export.ProxyAccessor
Modifier and Type | Class and Description |
---|---|
static class |
TxnManagerImpl.IdGenT |
com.sun.jini.landlord.Landlord.RenewResults
TransactionManager.Created
Modifier and Type | Field and Description |
---|---|
protected net.jini.export.Exporter |
exporter
The exporter for exporting and unexporting
|
protected LoginContext |
loginContext
The login context, for logging out
|
MAHALO
ABORTED, ACTIVE, COMMITTED, NOTCHANGED, PREPARED, VOTING
Modifier and Type | Method and Description |
---|---|
void |
abort_impl(Object id,
long waitFor) |
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 |
addLookupAttributes(net.jini.core.entry.Entry[] attrSets) |
void |
addLookupGroups(String[] groups) |
void |
addLookupLocators(net.jini.core.discovery.LookupLocator[] locators) |
void |
cancel(net.jini.id.Uuid uuid)
Cancels the lease on a
Transaction . |
Map |
cancelAll(net.jini.id.Uuid[] cookies)
Bulk cancel of leases on
Transaction s. |
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 externalXid,
long lease) |
void |
destroy()
Cleans up and exits the transaction manager.
|
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 |
disJoin(Object id,
TransactionParticipant part) |
Object |
getAdmin()
Returns the administration object for the
transaction manager.
|
TransactionManager |
getLocalProxy() |
net.jini.core.entry.Entry[] |
getLookupAttributes() |
String[] |
getLookupGroups() |
net.jini.core.discovery.LookupLocator[] |
getLookupLocators() |
Object |
getProxy() |
net.jini.security.TrustVerifier |
getProxyVerifier() |
Object |
getServiceProxy() |
int |
getState(long id)
Returns the current state of the given transaction.
|
int |
getState(Object id) |
Transaction |
getTransaction(long id)
Method from
TxnManager which produces
a Transaction from its ID. |
net.jini.id.Uuid |
getTransactionManagerId() |
protected void |
initFailed(Throwable e)
Log information about failing to initialize the service and rethrow the
appropriate exception.
|
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) |
void |
join(long id,
TransactionParticipant part,
long crashCount,
ServerTransaction userXtnObject,
int partitionId,
String clusterName,
Object clusterProxy) |
void |
join(Object xid,
TransactionParticipant part,
long crashCount) |
void |
join(Object xid,
TransactionParticipant part,
long crashCount,
int partitionId,
String clusterName) |
void |
join(Object xid,
TransactionParticipant part,
long crashCount,
ServerTransaction userXtnObject) |
void |
join(Object xid,
TransactionParticipant part,
long crashCount,
ServerTransaction userXtnObject,
int partitionId,
String clusterName,
Object clusterProxy) |
TransactionManager |
manager()
Returns a reference to the
TransactionManager
interface. |
void |
modifyLookupAttributes(net.jini.core.entry.Entry[] attrSetTemplates,
net.jini.core.entry.Entry[] attrSets) |
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
|
void |
noteUnsettledTxn(Object tid)
Informs the transaction manager to attempt to
settle a given transaction.
|
int |
prepare(Object xid)
prepare the underlying xtn designated by the rendered xid
|
void |
recover(long cookie,
com.sun.jini.mahalo.log.LogRecord rec)
This method recovers state changes resulting from
committing a transaction.
|
void |
reenterPreparedExternalXid(Object xid,
List<TransactionParticipant> parts)
given a prepared xid (retrieved from participants) reenlist it and its participants- used in XA
|
void |
removeLookupGroups(String[] groups) |
void |
removeLookupLocators(net.jini.core.discovery.LookupLocator[] locators) |
long |
renew(net.jini.id.Uuid uuid,
long extension)
Requests the renewal of a lease on a
Transaction . |
com.sun.jini.landlord.Landlord.RenewResults |
renewAll(net.jini.id.Uuid[] cookies,
long[] extensions)
Bulk renewal request of leases on
Transaction s. |
void |
setLookupGroups(String[] groups) |
void |
setLookupLocators(net.jini.core.discovery.LookupLocator[] locators) |
protected net.jini.export.Exporter exporter
protected LoginContext loginContext
public TransactionManager.Created create(long lease) throws LeaseDeniedException
TransactionManager
create
in interface TransactionManager
lease
- the requested lease time for the transactionLeaseDeniedException
- if this manager is unwilling to
grant the requested lease timepublic TransactionManager.Created create(Object externalXid, long lease) throws LeaseDeniedException
create
in interface ExtendedTransactionManager
LeaseDeniedException
public 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 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 void join(Object xid, TransactionParticipant part, long crashCount) throws UnknownTransactionException, CannotJoinException, CrashCountException, RemoteException
join
in interface ExtendedTransactionManager
UnknownTransactionException
CannotJoinException
CrashCountException
RemoteException
public void join(long id, TransactionParticipant part, long crashCount, int partitionId, String clusterName) throws UnknownTransactionException, CannotJoinException, CrashCountException, RemoteException
join
in interface ExtendedTransactionManager
UnknownTransactionException
CannotJoinException
CrashCountException
RemoteException
public void join(Object xid, TransactionParticipant part, long crashCount, int partitionId, String clusterName) throws UnknownTransactionException, CannotJoinException, CrashCountException, RemoteException
join
in interface ExtendedTransactionManager
UnknownTransactionException
CannotJoinException
CrashCountException
RemoteException
public void join(long id, TransactionParticipant part, long crashCount, ServerTransaction userXtnObject) throws UnknownTransactionException, CannotJoinException, CrashCountException, RemoteException
join
in interface ExtendedTransactionManager
UnknownTransactionException
CannotJoinException
CrashCountException
RemoteException
public void join(Object xid, TransactionParticipant part, long crashCount, ServerTransaction userXtnObject) throws UnknownTransactionException, CannotJoinException, CrashCountException, RemoteException
join
in interface ExtendedTransactionManager
UnknownTransactionException
CannotJoinException
CrashCountException
RemoteException
public void join(long id, TransactionParticipant part, long crashCount, ServerTransaction userXtnObject, int partitionId, String clusterName, Object clusterProxy) throws UnknownTransactionException, CannotJoinException, CrashCountException, RemoteException
join
in interface ExtendedTransactionManager
UnknownTransactionException
CannotJoinException
CrashCountException
RemoteException
public void join(Object xid, TransactionParticipant part, long crashCount, ServerTransaction userXtnObject, int partitionId, String clusterName, Object clusterProxy) throws UnknownTransactionException, CannotJoinException, CrashCountException, RemoteException
join
in interface ExtendedTransactionManager
UnknownTransactionException
CannotJoinException
CrashCountException
RemoteException
public boolean disJoin(long id, TransactionParticipant part) throws UnknownTransactionException, RemoteException
ExtendedTransactionManager
disJoin
in interface ExtendedTransactionManager
UnknownTransactionException
RemoteException
TransactionParticipant
public boolean disJoin(Object id, TransactionParticipant part) throws UnknownTransactionException, RemoteException
public int prepare(Object xid) throws CannotCommitException, UnknownTransactionException, RemoteException
prepare
in interface ExtendedTransactionManager
xid
- UnknownTransactionException
RemoteException
CannotCommitException
public int getState(long id) throws UnknownTransactionException
TransactionManager
TransactionConstants
values.getState
in interface TransactionManager
id
- 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.ServerTransaction.getState()
,
TransactionConstants
public int getState(Object id) throws UnknownTransactionException
getState
in interface ExtendedTransactionManager
UnknownTransactionException
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 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
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
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 commit(Object xid) throws UnknownTransactionException, CannotCommitException, RemoteException
commit
in interface ExtendedTransactionManager
UnknownTransactionException
CannotCommitException
RemoteException
public void commit(Object xid, long waitFor) throws UnknownTransactionException, CannotCommitException, TimeoutExpiredException, RemoteException
commit
in interface ExtendedTransactionManager
UnknownTransactionException
CannotCommitException
TimeoutExpiredException
RemoteException
public void abort(long id) throws UnknownTransactionException, CannotAbortException
TransactionManager
abort
in interface TransactionManager
id
- 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
commitpublic void abort(long id, long waitFor) throws UnknownTransactionException, CannotAbortException, TimeoutExpiredException
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
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 notifiedpublic void abort_impl(Object id, long waitFor) throws UnknownTransactionException, CannotAbortException, TimeoutExpiredException
public void abort(Object xid) throws UnknownTransactionException, CannotAbortException, RemoteException
abort
in interface ExtendedTransactionManager
UnknownTransactionException
CannotAbortException
RemoteException
public void abort(Object xid, long waitFor) throws UnknownTransactionException, CannotAbortException, TimeoutExpiredException, RemoteException
abort
in interface ExtendedTransactionManager
UnknownTransactionException
CannotAbortException
TimeoutExpiredException
RemoteException
public void recover(long cookie, com.sun.jini.mahalo.log.LogRecord rec) throws com.sun.jini.mahalo.log.LogException
recover
in interface com.sun.jini.mahalo.log.LogRecovery
cookie
- the transaction's IDrec
- the LogRecord
com.sun.jini.mahalo.log.LogException
public void noteUnsettledTxn(Object tid)
noteUnsettledTxn
in interface TxnSettler
tid
- the transaction's IDpublic Transaction getTransaction(long id) throws UnknownTransactionException
TxnManager
which produces
a Transaction
from its ID.getTransaction
in interface TxnManager
id
- the IDUnknownTransactionException
Transaction
,
TxnManager
public long renew(net.jini.id.Uuid uuid, long extension) throws UnknownLeaseException, LeaseDeniedException
Transaction
.renew
in interface com.sun.jini.landlord.Landlord
renew
in interface com.sun.jini.landlord.LocalLandlord
cookie
- identifies the leased resourceextension
- requested lease extensionUnknownLeaseException
LeaseDeniedException
Lease
,
LeasedResource
,
LeaseManager
public void cancel(net.jini.id.Uuid uuid) throws UnknownLeaseException
Transaction
.cancel
in interface com.sun.jini.landlord.Landlord
cancel
in interface com.sun.jini.landlord.LocalLandlord
cancel
in interface LeaseExpirationMgr.Expirer
cookie
- identifies the leased resourceUnknownLeaseException
Lease
,
LeasedResource
,
LeaseManager
public com.sun.jini.landlord.Landlord.RenewResults renewAll(net.jini.id.Uuid[] cookies, long[] extensions)
Transaction
s.renewAll
in interface com.sun.jini.landlord.Landlord
cookies
- identifies the leased resourcesextensions
- requested lease extensionsLease
,
LeasedResource
,
LeaseManager
public Map cancelAll(net.jini.id.Uuid[] cookies)
Transaction
s.cancelAll
in interface com.sun.jini.landlord.Landlord
cookies
- identifies the leased resourcesLease
,
LeasedResource
,
LeaseManager
public TransactionManager manager()
TransactionManager
interface.manager
in interface TxnManager
TransactionManager
public void reenterPreparedExternalXid(Object xid, List<TransactionParticipant> parts) throws CannotCommitException
TxnManager
reenterPreparedExternalXid
in interface TxnManager
CannotCommitException
public void destroy()
destroy
in interface com.sun.jini.admin.DestroyAdmin
public Object getAdmin()
getAdmin
in interface net.jini.admin.Administrable
public net.jini.core.entry.Entry[] getLookupAttributes()
getLookupAttributes
in interface net.jini.admin.JoinAdmin
public void addLookupAttributes(net.jini.core.entry.Entry[] attrSets)
addLookupAttributes
in interface net.jini.admin.JoinAdmin
public void modifyLookupAttributes(net.jini.core.entry.Entry[] attrSetTemplates, net.jini.core.entry.Entry[] attrSets)
modifyLookupAttributes
in interface net.jini.admin.JoinAdmin
public String[] getLookupGroups()
getLookupGroups
in interface net.jini.admin.JoinAdmin
public void addLookupGroups(String[] groups)
addLookupGroups
in interface net.jini.admin.JoinAdmin
public void removeLookupGroups(String[] groups)
removeLookupGroups
in interface net.jini.admin.JoinAdmin
public void setLookupGroups(String[] groups)
setLookupGroups
in interface net.jini.admin.JoinAdmin
public net.jini.core.discovery.LookupLocator[] getLookupLocators()
getLookupLocators
in interface net.jini.admin.JoinAdmin
public void addLookupLocators(net.jini.core.discovery.LookupLocator[] locators) throws RemoteException
addLookupLocators
in interface net.jini.admin.JoinAdmin
RemoteException
public void removeLookupLocators(net.jini.core.discovery.LookupLocator[] locators) throws RemoteException
removeLookupLocators
in interface net.jini.admin.JoinAdmin
RemoteException
public void setLookupLocators(net.jini.core.discovery.LookupLocator[] locators) throws RemoteException
setLookupLocators
in interface net.jini.admin.JoinAdmin
RemoteException
public Object getProxy()
getProxy
in interface net.jini.export.ProxyAccessor
public TransactionManager getLocalProxy()
getLocalProxy
in interface TxnManager
public Object getServiceProxy()
getServiceProxy
in interface com.sun.jini.start.ServiceProxyAccessor
protected void initFailed(Throwable e) throws Exception
e
- the exception produced by the failureException
public net.jini.security.TrustVerifier getProxyVerifier()
getProxyVerifier
in interface net.jini.security.proxytrust.ServerProxyTrust
public boolean needParticipantsJoin() throws RemoteException
needParticipantsJoin
in interface TransactionManager
RemoteException
public net.jini.id.Uuid getTransactionManagerId() throws RemoteException
getTransactionManagerId
in interface TransactionManager
RemoteException
Copyright © GigaSpaces.