|
GigaSpaces XAP 10.1 API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.jini.mahalo.TxnManagerImpl
public class TxnManagerImpl
An implementation of the Jini(TM) Transaction Specification.
| Nested Class Summary | |
|---|---|
static class |
TxnManagerImpl.IdGenT
|
| Nested classes/interfaces inherited from interface com.sun.jini.landlord.Landlord |
|---|
Landlord.RenewResults |
| Nested classes/interfaces inherited from interface net.jini.core.transaction.server.TransactionManager |
|---|
TransactionManager.Created |
| Field Summary | |
|---|---|
protected Exporter |
exporter
The exporter for exporting and unexporting |
protected LoginContext |
loginContext
The login context, for logging out |
| Fields inherited from interface com.sun.jini.mahalo.TxnManager |
|---|
MAHALO |
| Fields inherited from interface net.jini.core.transaction.server.TransactionConstants |
|---|
ABORTED, ACTIVE, COMMITTED, NOTCHANGED, PREPARED, VOTING |
| Fields inherited from interface com.sun.jini.constants.TimeConstants |
|---|
DAYS, HOURS, MINUTES, SECONDS |
| Method Summary | |
|---|---|
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(Entry[] attrSets)
Add attribute sets for the service. |
void |
addLookupGroups(String[] groups)
Add new groups to the set to join. |
void |
addLookupLocators(LookupLocator[] locators)
Add locators for specific new lookup services to join. |
void |
cancel(Uuid uuid)
Cancels the lease on a Transaction. |
Map |
cancelAll(Uuid[] cookies)
Bulk cancel of leases on Transactions. |
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()
|
Entry[] |
getLookupAttributes()
Get the current attribute sets for the service. |
String[] |
getLookupGroups()
Get the list of groups to join. |
LookupLocator[] |
getLookupLocators()
Get the list of locators of specific lookup services to join. |
Object |
getProxy()
Returns a proxy object for this remote object. |
TrustVerifier |
getProxyVerifier()
Returns a TrustVerifier that can be used to verify that
a proxy can be trusted as a proxy for the service; that is, the
isTrustedObject method of the
returned verifier can be called with a candidate proxy. |
Object |
getServiceProxy()
Returns a proxy object for this object. |
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. |
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(Entry[] attrSetTemplates,
Entry[] attrSets)
Modify the current attribute sets, using the same semantics as ServiceRegistration.modifyAttributes. |
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,
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)
Remove groups from the set to join. |
void |
removeLookupLocators(LookupLocator[] locators)
Remove locators for specific lookup services from the set to join. |
long |
renew(Uuid uuid,
long extension)
Requests the renewal of a lease on a Transaction. |
Landlord.RenewResults |
renewAll(Uuid[] cookies,
long[] extensions)
Bulk renewal request of leases on Transactions. |
void |
setLookupGroups(String[] groups)
Replace the list of groups to join with a new list. |
void |
setLookupLocators(LookupLocator[] locators)
Replace the list of locators of specific lookup services to join with a new list. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Exporter exporter
protected LoginContext loginContext
| Method Detail |
|---|
public TransactionManager.Created create(long lease)
throws LeaseDeniedException
TransactionManager
create in interface TransactionManagerlease - the requested lease time for the transaction
LeaseDeniedException - if this manager is unwilling to
grant the requested lease time
public TransactionManager.Created create(Object externalXid,
long lease)
throws LeaseDeniedException
create in interface ExtendedTransactionManagerLeaseDeniedException
public 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 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 void join(Object xid,
TransactionParticipant part,
long crashCount)
throws UnknownTransactionException,
CannotJoinException,
CrashCountException,
RemoteException
join in interface ExtendedTransactionManagerUnknownTransactionException
CannotJoinException
CrashCountException
RemoteException
public void join(long id,
TransactionParticipant part,
long crashCount,
int partitionId,
String clusterName)
throws UnknownTransactionException,
CannotJoinException,
CrashCountException,
RemoteException
join in interface ExtendedTransactionManagerUnknownTransactionException
CannotJoinException
CrashCountException
RemoteException
public void join(Object xid,
TransactionParticipant part,
long crashCount,
int partitionId,
String clusterName)
throws UnknownTransactionException,
CannotJoinException,
CrashCountException,
RemoteException
join in interface ExtendedTransactionManagerUnknownTransactionException
CannotJoinException
CrashCountException
RemoteException
public void join(long id,
TransactionParticipant part,
long crashCount,
ServerTransaction userXtnObject)
throws UnknownTransactionException,
CannotJoinException,
CrashCountException,
RemoteException
join in interface ExtendedTransactionManagerUnknownTransactionException
CannotJoinException
CrashCountException
RemoteException
public void join(Object xid,
TransactionParticipant part,
long crashCount,
ServerTransaction userXtnObject)
throws UnknownTransactionException,
CannotJoinException,
CrashCountException,
RemoteException
join in interface ExtendedTransactionManagerUnknownTransactionException
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 ExtendedTransactionManagerUnknownTransactionException
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 ExtendedTransactionManagerUnknownTransactionException
CannotJoinException
CrashCountException
RemoteException
public boolean disJoin(long id,
TransactionParticipant part)
throws UnknownTransactionException,
RemoteException
ExtendedTransactionManager
disJoin in interface ExtendedTransactionManagerUnknownTransactionException
RemoteExceptionTransactionParticipant
public boolean disJoin(Object id,
TransactionParticipant part)
throws UnknownTransactionException,
RemoteException
UnknownTransactionException
RemoteException
public int prepare(Object xid)
throws CannotCommitException,
UnknownTransactionException,
RemoteException
prepare in interface ExtendedTransactionManagerxid -
UnknownTransactionException
RemoteException
CannotCommitException
public int getState(long id)
throws UnknownTransactionException
TransactionManagerTransactionConstants values.
getState in interface TransactionManagerid - 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.ServerTransaction.getState(),
TransactionConstants
public int getState(Object id)
throws UnknownTransactionException
getState in interface ExtendedTransactionManagerUnknownTransactionException
public 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 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 error
public 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
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 error
public void commit(Object xid)
throws UnknownTransactionException,
CannotCommitException,
RemoteException
commit in interface ExtendedTransactionManagerUnknownTransactionException
CannotCommitException
RemoteException
public void commit(Object xid,
long waitFor)
throws UnknownTransactionException,
CannotCommitException,
TimeoutExpiredException,
RemoteException
commit in interface ExtendedTransactionManagerUnknownTransactionException
CannotCommitException
TimeoutExpiredException
RemoteException
public void abort(long id)
throws UnknownTransactionException,
CannotAbortException
TransactionManager
abort in interface TransactionManagerid - 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
public void abort(long id,
long waitFor)
throws UnknownTransactionException,
CannotAbortException,
TimeoutExpiredException
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
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
public void abort_impl(Object id,
long waitFor)
throws UnknownTransactionException,
CannotAbortException,
TimeoutExpiredException
UnknownTransactionException
CannotAbortException
TimeoutExpiredException
public void abort(Object xid)
throws UnknownTransactionException,
CannotAbortException,
RemoteException
abort in interface ExtendedTransactionManagerUnknownTransactionException
CannotAbortException
RemoteException
public void abort(Object xid,
long waitFor)
throws UnknownTransactionException,
CannotAbortException,
TimeoutExpiredException,
RemoteException
abort in interface ExtendedTransactionManagerUnknownTransactionException
CannotAbortException
TimeoutExpiredException
RemoteException
public void recover(long cookie,
LogRecord rec)
throws LogException
recover in interface LogRecoverycookie - the transaction's IDrec - the LogRecord
LogExceptionpublic void noteUnsettledTxn(Object tid)
noteUnsettledTxn in interface TxnSettlertid - the transaction's ID
public Transaction getTransaction(long id)
throws UnknownTransactionException
TxnManager which produces
a Transaction from its ID.
getTransaction in interface TxnManagerid - the ID
UnknownTransactionExceptionTransaction,
TxnManager
public long renew(Uuid uuid,
long extension)
throws UnknownLeaseException,
LeaseDeniedException
Transaction.
renew in interface Landlordrenew in interface LocalLandlordcookie - identifies the leased resourceextension - requested lease extension
UnknownLeaseException - if landlord does not know about
a lease with the specified cookie
LeaseDeniedException - if the landlord is unwilling to
renew the leaseLease,
LeasedResource,
LeaseManager
public void cancel(Uuid uuid)
throws UnknownLeaseException
Transaction.
cancel in interface Landlordcancel in interface LocalLandlordcancel in interface LeaseExpirationMgr.Expirercookie - identifies the leased resource
UnknownLeaseException - if landlord does not know about
a lease with the specified cookieLease,
LeasedResource,
LeaseManager
public Landlord.RenewResults renewAll(Uuid[] cookies,
long[] extensions)
Transactions.
renewAll in interface Landlordcookies - identifies the leased resourcesextensions - requested lease extensions
Lease,
LeasedResource,
LeaseManagerpublic Map cancelAll(Uuid[] cookies)
Transactions.
cancelAll in interface Landlordcookies - identifies the leased resources
cookies
could be cancelled return null. Otherwise,
return a Map that for each failed cancel
attempt maps the corresponding cookie object to an
exception describing the failure.Lease,
LeasedResource,
LeaseManagerpublic TransactionManager manager()
TransactionManager
interface.
manager in interface TxnManagerTransactionManager
public void reenterPreparedExternalXid(Object xid,
List<TransactionParticipant> parts)
throws CannotCommitException
TxnManager
reenterPreparedExternalXid in interface TxnManagerCannotCommitExceptionpublic void destroy()
destroy in interface DestroyAdminpublic Object getAdmin()
getAdmin in interface AdministrableJoinAdminpublic Entry[] getLookupAttributes()
JoinAdmin
getLookupAttributes in interface JoinAdminpublic void addLookupAttributes(Entry[] attrSets)
JoinAdmin
addLookupAttributes in interface JoinAdminattrSets - the attribute sets to add
public void modifyLookupAttributes(Entry[] attrSetTemplates,
Entry[] attrSets)
JoinAdmin
modifyLookupAttributes in interface JoinAdminattrSetTemplates - the templates for matching attribute setsattrSets - the modifications to make to matching setsServiceRegistration.modifyAttributes(net.jini.core.entry.Entry[], net.jini.core.entry.Entry[])public String[] getLookupGroups()
JoinAdmin
getLookupGroups in interface JoinAdminJoinAdmin.setLookupGroups(java.lang.String[])public void addLookupGroups(String[] groups)
JoinAdmin
addLookupGroups in interface JoinAdmingroups - groups to joinJoinAdmin.removeLookupGroups(java.lang.String[])public void removeLookupGroups(String[] groups)
JoinAdmin
removeLookupGroups in interface JoinAdmingroups - groups to leaveJoinAdmin.addLookupGroups(java.lang.String[])public void setLookupGroups(String[] groups)
JoinAdmin
setLookupGroups in interface JoinAdmingroups - groups to joinJoinAdmin.getLookupGroups()public LookupLocator[] getLookupLocators()
JoinAdmin
getLookupLocators in interface JoinAdminJoinAdmin.setLookupLocators(net.jini.core.discovery.LookupLocator[])
public void addLookupLocators(LookupLocator[] locators)
throws RemoteException
JoinAdmin
addLookupLocators in interface JoinAdminlocators - locators of specific lookup services to join
RemoteExceptionJoinAdmin.removeLookupLocators(net.jini.core.discovery.LookupLocator[])
public void removeLookupLocators(LookupLocator[] locators)
throws RemoteException
JoinAdmin
removeLookupLocators in interface JoinAdminlocators - locators of specific lookup services to leave
RemoteExceptionJoinAdmin.addLookupLocators(net.jini.core.discovery.LookupLocator[])
public void setLookupLocators(LookupLocator[] locators)
throws RemoteException
JoinAdmin
setLookupLocators in interface JoinAdminlocators - locators of specific lookup services to join
RemoteExceptionJoinAdmin.getLookupLocators()public Object getProxy()
ProxyAccessornull is returned.
getProxy in interface ProxyAccessornullpublic TransactionManager getLocalProxy()
getLocalProxy in interface TxnManagerpublic Object getServiceProxy()
ServiceProxyAccessornull.
getServiceProxy in interface ServiceProxyAccessor
protected void initFailed(Throwable e)
throws Exception
e - the exception produced by the failure
Exceptionpublic TrustVerifier getProxyVerifier()
ServerProxyTrustTrustVerifier that can be used to verify that
a proxy can be trusted as a proxy for the service; that is, the
isTrustedObject method of the
returned verifier can be called with a candidate proxy. The verifier
should be able to verify all proxies for the service, including
proxies for resources (such as leases and registrations).
getProxyVerifier in interface ServerProxyTrustTrustVerifier that can be used to verify that
a proxy can be trusted as a proxy for the service
public boolean needParticipantsJoin()
throws RemoteException
needParticipantsJoin in interface TransactionManagerRemoteException
public Uuid getTransactionManagerId()
throws RemoteException
getTransactionManagerId in interface TransactionManagerRemoteException
|
GigaSpaces XAP 10.1 API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||