Package org.eclipse.tycho.core.locking
Class FileLockerImpl
- java.lang.Object
-
- org.eclipse.tycho.core.locking.FileLockerImpl
-
- All Implemented Interfaces:
FileLocker
public class FileLockerImpl extends Object implements FileLocker
-
-
Constructor Summary
Constructors Constructor Description FileLockerImpl(File file, org.eclipse.osgi.service.datalocation.Location anyLocation)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isLocked()
Whether the file associated with this locker object is currently locked (by this process or any other process).void
lock()
Equivalent to {FileLocker.lock(long)
with a timeout argument of 10000 milliseconds.void
lock(long timeout)
Attempt to lock the file associated with this locker object.void
release()
Release the lock if acquired.
-
-
-
Constructor Detail
-
FileLockerImpl
public FileLockerImpl(File file, org.eclipse.osgi.service.datalocation.Location anyLocation)
-
-
Method Detail
-
lock
public void lock()
Description copied from interface:FileLocker
Equivalent to {FileLocker.lock(long)
with a timeout argument of 10000 milliseconds.- Specified by:
lock
in interfaceFileLocker
-
lock
public void lock(long timeout)
Description copied from interface:FileLocker
Attempt to lock the file associated with this locker object. Note that technically, not the file itself is locked, but an empty marker file next to it.- Specified by:
lock
in interfaceFileLocker
- Parameters:
timeout
- timeout in milliseconds
-
release
public void release()
Description copied from interface:FileLocker
Release the lock if acquired. Also removes the lock marker file.- Specified by:
release
in interfaceFileLocker
-
isLocked
public boolean isLocked()
Description copied from interface:FileLocker
Whether the file associated with this locker object is currently locked (by this process or any other process).- Specified by:
isLocked
in interfaceFileLocker
-
-