|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.entityfs.lock.NoObjectDummyLock
public class NoObjectDummyLock
This is a dummy EntityLock
implementation that is not connected to
any particular entity.
Since this object does not contain any mutable internal state, the singleton
instance INSTANCE
can be used instead of instantiating the class.
Field Summary | |
---|---|
static NoObjectDummyLock |
INSTANCE
Singleton instance that may be used instead of instantiating the class. |
Constructor Summary | |
---|---|
NoObjectDummyLock()
|
Method Summary | |
---|---|
int |
getHoldCount()
Get the hold count of the lock. |
Lockable |
getLocked()
Get the locked object. |
boolean |
isDummy()
Is this lock a dummy lock. |
boolean |
isHeldByCurrentThread()
Is this lock held by the current thread? (This is implemented by ReentrantLock but not specified in the Lock interface.) |
boolean |
isReadLock()
Returns true if this lock is a read lock. |
boolean |
isWriteLock()
Returns true if this lock is a write lock. |
void |
lock()
|
void |
lockInterruptibly()
|
Condition |
newCondition()
|
boolean |
tryLock()
|
boolean |
tryLock(long timeout,
TimeUnit tu)
|
void |
unlock()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final NoObjectDummyLock INSTANCE
Constructor Detail |
---|
public NoObjectDummyLock()
Method Detail |
---|
public boolean isReadLock()
EntityLock
true
if this lock is a read lock.
isReadLock
in interface EntityLock
true
, always.public boolean isWriteLock()
EntityLock
true
if this lock is a write lock.
isWriteLock
in interface EntityLock
true
, always.public Lockable getLocked()
EntityLock
null
.
getLocked
in interface EntityLock
null
, always.public Condition newCondition() throws UnsupportedOperationException
newCondition
in interface Lock
UnsupportedOperationException
- Always.public boolean tryLock()
tryLock
in interface Lock
true
, always.public boolean tryLock(long timeout, TimeUnit tu)
tryLock
in interface Lock
true
, always.public void unlock()
unlock
in interface Lock
public void lock()
lock
in interface Lock
public void lockInterruptibly()
lockInterruptibly
in interface Lock
public int getHoldCount()
EntityLock
Lock.lock()
has been
called minus the number of times Lock.unlock()
has been called by
the current thread.) If the hold count is 0, the lock is unlocked. The
hold count can never be less than 0.
getHoldCount
in interface EntityLock
0
, always.public boolean isHeldByCurrentThread()
EntityLock
ReentrantLock
but not specified in the Lock
interface.)
isHeldByCurrentThread
in interface EntityLock
true
, always.public boolean isDummy()
EntityLock
isDummy
in interface EntityLock
true
, always.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |