org.abstracthorizon.danube.webdav.fs
Class FSLockingMechanism
java.lang.Object
org.abstracthorizon.danube.webdav.lock.impl.SimpleInMemoryLockingMechanism
org.abstracthorizon.danube.webdav.fs.FSLockingMechanism
- All Implemented Interfaces:
- LockingMechanism
public class FSLockingMechanism
- extends SimpleInMemoryLockingMechanism
Locking mechanism that locks files on the file system by using
RandomAccessFile
to open the file with "rw"
attributes. Unlocking is done by closing that file.
Note: So far it is confirmed that it works only on Windows machines
- Author:
- Daniel Sendula
Methods inherited from class org.abstracthorizon.danube.webdav.lock.impl.SimpleInMemoryLockingMechanism |
createLock, createLockImpl, findLock, getHarvestMinimumInterval, getLocks, getResources, getSupportedLockScopes, harvestLocks, isAccessAllowed, isLocked, removeLock, removeLocks, setHarvestMinimumInterval |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
fsLocks
protected Map<Object,RandomAccessFile> fsLocks
- Map of locks
FSLockingMechanism
public FSLockingMechanism()
- Constructor
lockResource
public boolean lockResource(Lock lock,
Object resource)
- Locks the file
- Specified by:
lockResource
in interface LockingMechanism
- Overrides:
lockResource
in class SimpleInMemoryLockingMechanism
- Parameters:
lock
- lockresource
- a file
- Returns:
true
if file is locked
unlockResources
public void unlockResources(Lock lock)
- Unlocks the file
- Specified by:
unlockResources
in interface LockingMechanism
- Overrides:
unlockResources
in class SimpleInMemoryLockingMechanism
- Parameters:
lock
- lock
Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.