|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.sgs.impl.kernel.AbstractAccessCoordinator
com.sun.sgs.impl.kernel.TrackingAccessCoordinator
class TrackingAccessCoordinator
A package-private implementation of AccessCoordinator that is
used by the system to track access to objects and handle any possible
conflict. This implementation is also responsible for reporting
the access detail to the profiling system.
This implementation provides the option to keep detail on a backlog of
past transactions to discover what may have caused conflict. This is
currently only useful for ProfileListeners that wish to diplay
this detail. By default this backlog tracking is disabled. To enable,
set the com.sun.sgs.impl.kernel.TrackingAccessCoordinator.queue.size
property to some positive value indicating the length of backlog to use.
Note that with each transaction failure this backlog will be scanned
to find a conflicting transaction, so a larger backlog may provide more
detail about failure but will also be more compute-intensive.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.sun.sgs.impl.kernel.AbstractAccessCoordinator |
|---|
AbstractAccessCoordinator.AbstractAccessReporter<T> |
| Field Summary | |
|---|---|
(package private) static String |
BACKLOG_QUEUE_PROPERTY
The property to set the size of the backlog and enable transaction conflict detail reporting. |
| Fields inherited from class com.sun.sgs.impl.kernel.AbstractAccessCoordinator |
|---|
profileCollectorHandle, txnProxy |
| Constructor Summary | |
|---|---|
TrackingAccessCoordinator(Properties properties,
TransactionProxy txnProxy,
ProfileCollectorHandle profileCollector)
Creates an instance of TrackingAccessCoordinator. |
|
| Method Summary | ||
|---|---|---|
void |
abort(Transaction txn)
Tells the participant to abort its involvement with the given transaction. |
|
void |
commit(Transaction txn)
Tells the participant to commit its state associated with the given transaction. |
|
Transaction |
getConflictingTransaction(Transaction txn)
Find out what transaction, if still active, caused the given transaction to fail due to conflict. |
|
String |
getTypeName()
Returns the fully qualified type name of the participant. |
|
void |
notifyNewTransaction(Transaction txn,
long requestedStartTime,
int tryCount)
Notifies the coordinator that a new transaction is starting. |
|
boolean |
prepare(Transaction txn)
Tells the participant to prepare for commiting its state associated with the given transaction. |
|
void |
prepareAndCommit(Transaction txn)
Tells the participant to both prepare and commit its state associated with the given transaction. |
|
|
registerAccessSource(String sourceName,
Class<T> objectIdType)
Register as a provider of shared objects, and therefore a possible source of conflict between transactions. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
static final String BACKLOG_QUEUE_PROPERTY
| Constructor Detail |
|---|
TrackingAccessCoordinator(Properties properties,
TransactionProxy txnProxy,
ProfileCollectorHandle profileCollector)
TrackingAccessCoordinator.
IllegalArgumentException - if the requested backlog queue size
is not a valid number greater than 0| Method Detail |
|---|
public <T> AccessReporter<T> registerAccessSource(String sourceName,
Class<T> objectIdType)
DataService which provides access to
ManagedObjects and name bindings). This ensures that
conflict is managed for access to the reported objects, and
that a report of all accesses is available through profiling.
registerAccessSource in interface AccessCoordinatorT - the type of the id object used to report accessessourceName - the name of the source of objects which may
cause conflict on accessobjectIdType - the type of the identifier that will be used
to identify accessed objects
AccessReporter used to notify the system
of access to shared objectspublic Transaction getConflictingTransaction(Transaction txn)
getConflictingTransaction in interface AccessCoordinatortxn - a Transaction that failed due to conflict
Transaction that caused the provided
Transaction to fail due to conflict, or
null if there is no such active Transaction
public void notifyNewTransaction(Transaction txn,
long requestedStartTime,
int tryCount)
notifyNewTransaction in interface AccessCoordinatorHandletxn - the transactionrequestedStartTime - the time in milliseconds that the task
associated with the transaction was originally requested to
starttryCount - the number of times that transactions have been
attempted for the task associated with txnpublic boolean prepare(Transaction txn)
boolean
flag stating whether the prepared state is read-only, meaning that no
external state is modified by this participant. If this method
returns true, then neither commit nor abort
will be called.
If this method throws an exception, then the preparation failed, and the transaction will be aborted. If this method completes successfully, then the participant is required to be able to commit the transaction without failure.
prepare in interface TransactionParticipanttxn - the Transaction object
public void commit(Transaction txn)
commit in interface TransactionParticipanttxn - the Transaction objectpublic void prepareAndCommit(Transaction txn)
prepareAndCommit in interface TransactionParticipanttxn - the Transaction objectpublic void abort(Transaction txn)
abort in interface TransactionParticipanttxn - the Transaction objectpublic String getTypeName()
Service, this
will typically be the Service's type name.
getTypeName in interface TransactionParticipant
|
RedDwarf, Version 0.10.1 2010-03-14 10:56:12 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||