@ThreadSafe public final class ScreenLock extends Object
Modifier and Type | Method and Description |
---|---|
void |
acquire(Object newOwner)
Acquires this lock.
|
boolean |
acquired()
Indicates whether this lock is already acquired.
|
boolean |
acquiredBy(Object possibleOwner)
Indicates whether this lock was acquired by the given object.
|
static ScreenLock |
instance()
Returns the singleton instance of this class.
|
void |
release(Object currentOwner)
Releases this lock.
|
public void acquire(Object newOwner)
newOwner
- the new owner of the lock.public void release(Object currentOwner)
currentOwner
- the current owner of the lock.ScreenLockException
- if the lock has not been previously acquired.ScreenLockException
- if the given owner is not the same as the current owner of the lock.public boolean acquiredBy(Object possibleOwner)
possibleOwner
- the given object, which could be owning the lock.true
if the given object is owning the lock; false
otherwise.public boolean acquired()
true
if the lock is already acquired; false
otherwise.acquiredBy(Object)
public static ScreenLock instance()
Copyright © 2007-2012 FEST (Fixtures for Easy Software Testing). All Rights Reserved.