@NotStorableClass public final class FilePersistenceLock extends Object
Modifier and Type | Method and Description |
---|---|
static FilePersistenceLock |
getInstance() |
void |
lock(File file)
add lock on used file
|
void |
unlock(File file)
remove lock on no more used file
|
static void |
unlockAll() |
public static FilePersistenceLock getInstance()
public void lock(File file) throws FilePersistenceException
file
- the used fileFilePersistenceException
- file already in usepublic void unlock(File file) throws FilePersistenceException
file
- the no more used fileFilePersistenceException
- file was not in use@Fortest public static void unlockAll()
Copyright © 2007-2012 Luc Peuvrier. All Rights Reserved.