public synchronized FileLock lock() throws IOException { if (lock != null) { FileLock f = (FileLock) lock.get(); if (f != null) { FileAlreadyLockedException alreadyLockedException = new FileAlreadyLockedException(getPath()); alreadyLockedException.initCause(lockedBy); throw alreadyLockedException; } } Set<? extends FileSystem> set = getMultiFileSystem().createLocksOn(getPath()); MfLock l = new MfLock(leader, delegates(), set); lock = new WeakReference<MfLock>(l); assert (lockedBy = new Throwable("Locked by:")) != null; //NOI18N return l; }
public synchronized FileLock lock () throws IOException { if (lock != null) { FileLock f = (FileLock)lock.get (); if (f != null) { // [PENDING] construct localized message throw new FileAlreadyLockedException (getPath ()); } } java.util.Set set = getMultiFileSystem ().createLocksOn (getPath ()); FileLock l = new MfLock (leader, delegates (), set); lock = new WeakReference (l); // Thread.dumpStack (); // System.out.println ("Locking file: " + this); // NOI18N return l; }
public synchronized FileLock lock () throws IOException { if (lock != null) { FileLock f = (FileLock)lock.get (); if (f != null) { // [PENDING] construct localized message throw new FileAlreadyLockedException (getPath ()); } } java.util.Set set = getMultiFileSystem ().createLocksOn (getPath ()); FileLock l = new MfLock (leader, delegates (), set); lock = new WeakReference (l); // Thread.dumpStack (); // System.out.println ("Locking file: " + this); // NOI18N return l; }