|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.sgs.impl.util.lock.Locker<K>
com.sun.sgs.impl.util.lock.BasicLocker<K>
com.sun.sgs.impl.util.lock.TxnLocker<K>
K - the type of keypublic class TxnLocker<K>
Records information about an entity that requests locks from a TxnLockManager as part of a transaction.
| Field Summary | |
|---|---|
protected long |
requestedStartTime
The time in milliseconds when the associated transaction was originally requested to start. |
protected Transaction |
txn
The associated transaction. |
| Fields inherited from class com.sun.sgs.impl.util.lock.Locker |
|---|
lockManager |
| Constructor Summary | |
|---|---|
TxnLocker(TxnLockManager<K> lockManager,
Transaction txn,
long requestedStartTime)
Creates an instance of this class. |
|
| Method Summary | |
|---|---|
protected void |
clearConflict()
Clears the conflict that should cause this locker's current request to be denied. |
protected LockConflict<K> |
getConflict()
Checks if there is a conflict that should cause this locker's current request to be denied. |
protected long |
getLockTimeoutTime(long now,
long lockTimeout)
Returns the time when a lock attempt should stop, given the current time and the lock timeout supplied by the caller. |
long |
getRequestedStartTime()
Returns the time in milliseconds that the transaction associated with this locker was originally requested to start, as specified in the constructor. |
Transaction |
getTransaction()
Returns the transaction associated with this locker. |
protected void |
setConflict(LockConflict<K> conflict)
Specifies a conflict that should cause this locker's current request to be denied, and notifies waiters. |
| Methods inherited from class com.sun.sgs.impl.util.lock.BasicLocker |
|---|
getWaitingFor, setWaitingFor |
| Methods inherited from class com.sun.sgs.impl.util.lock.Locker |
|---|
checkAllowSync, getLockManager, newLockRequest, noteSync, noteUnsync |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Transaction txn
protected final long requestedStartTime
| Constructor Detail |
|---|
public TxnLocker(TxnLockManager<K> lockManager,
Transaction txn,
long requestedStartTime)
lockManager - the lock manager for this lockertxn - the associated transactionrequestedStartTime - the time in milliseconds that the task
associated with the transaction was originally
requested to start
IllegalArgumentException - if requestedStartTime
is less than 0| Method Detail |
|---|
public Transaction getTransaction()
public long getRequestedStartTime()
protected long getLockTimeoutTime(long now,
long lockTimeout)
This implementation stops the lock attempt when the transaction ends.
getLockTimeoutTime in class Locker<K>now - the current time in millisecondslockTimeout - the amount of time in milliseconds to wait for a
lock
protected LockConflict<K> getConflict()
null if there was no
conflict.
The default implementation of this method always returns null.
This implementation returns the conflict recorded for this locker.
getConflict in class Locker<K>null
IllegalStateExceptionprotected void clearConflict()
null return
value from getConflict with a type field
equal to DEADLOCK, then the conflict
cannot be cleared and IllegalStateException will be thrown. The default implementation of this method does nothing.
This implementation checks for deadlocks and notifies waiters.
clearConflict in class Locker<K>IllegalStateException - if the conflict is a deadlockprotected void setConflict(LockConflict<K> conflict)
conflict - the conflicting request
IllegalStateException - if a conflicting request has already been
specified
|
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 | |||||||||