|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface WriteLockable
This interface is implemented by classes that can be locked for writing. This
can for instance be an entity, or a write-enabled aspect of an entity, such
as WritableFile
.
WriteLockable
Method Summary | |
---|---|
EntityLock |
getWriteLock()
Get the write lock without locking it. |
boolean |
isWriteLockedByCurrentThread()
Does the calling thread hold a write lock for the lockable object (this)? |
EntityLock |
lockForWriting()
Lock the object for writing and return the lock. |
Method Detail |
---|
EntityLock getWriteLock()
This method always returns a lock, even if the object's file system is not locking or if the object is read only.
EntityLock lockForWriting() throws LockTimeoutException
EntityLockAdapterFactory
and
LockAcquiringStrategy
used. If this is called on an object that
is somehow connected to an Entity
object, that entity's file
systems' lock adapter factory and lock acquiring strategy is used. A
write lock can be downgraded to a read lock (by calling
ReadLockable.lockForReading()
and then releasing the write lock).
An entity in a locking read only file system may still be locked for writing.
For more discussions on locks and locking, see Entity
and
FileSystem
.
This method always returns a lock, even if the file system is not locking.
LockTimeoutException
- If the lock acquiring timed out. (It is up
to the LockAcquiringStrategy
to decide if lock acquiring can time
out.)boolean isWriteLockedByCurrentThread()
true
if the lockable object is write locked by the
current thread.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |