public class NIOLockManager extends Object implements LockManager
File lock manager implementation that uses the Java NIO file locking capabilities.
| Constructor and Description |
|---|
NIOLockManager() |
| Modifier and Type | Method and Description |
|---|---|
FileLock |
createLockObject(SrvSession sess,
TreeConnection tree,
NetworkFile file,
long offset,
long len,
int pid)
Create a lock object, allows the FileLock object to be extended
|
void |
lockFile(SrvSession sess,
TreeConnection tree,
NetworkFile file,
FileLock lock)
Lock a byte range within a file, or the whole file.
|
void |
releaseLocksForFile(SrvSession sess,
TreeConnection tree,
NetworkFile file)
Release all locks that a session has on a file.
|
void |
unlockFile(SrvSession sess,
TreeConnection tree,
NetworkFile file,
FileLock lock)
Unlock a byte range within a file, or the whole file
|
public void lockFile(SrvSession sess, TreeConnection tree, NetworkFile file, FileLock lock) throws LockConflictException, IOException
lockFile in interface LockManagersess - SrvSessiontree - TreeConnectionfile - NetworkFilelock - FileLockLockConflictExceptionIOExceptionpublic void unlockFile(SrvSession sess, TreeConnection tree, NetworkFile file, FileLock lock) throws NotLockedException, IOException
unlockFile in interface LockManagersess - SrvSessiontree - TreeConnectionfile - NetworkFilelock - FileLockNotLockedExceptionIOExceptionpublic FileLock createLockObject(SrvSession sess, TreeConnection tree, NetworkFile file, long offset, long len, int pid)
createLockObject in interface LockManagersess - SrvSessiontree - TreeConnectionfile - NetworkFileoffset - longlen - longpid - intpublic void releaseLocksForFile(SrvSession sess, TreeConnection tree, NetworkFile file)
releaseLocksForFile in interface LockManagersess - SrvSessiontree - TreeConnectionfile - NetworkFileCopyright © 2005–2016 Alfresco Software. All rights reserved.