Class LockingRevFile
- java.lang.Object
-
- com.zfabrik.components.provider.util.LockingRevFile
-
- All Implemented Interfaces:
Lock
public class LockingRevFile extends java.lang.Object implements Lock
A file system lock with properties. This is used by component repository implementations to manage concurrency in update decisions of locally managed resources. The typical usage of this class isLockingRevFile lrf = new LockingRevFile(f); lrf.open(); try { // do some checking based on lrf.properties() // do whatever updates needed // update lrf.properties() as required // persist updates lrf.update(); } finally { lrf.close(); }
- Author:
- hb
-
-
Constructor Summary
Constructors Constructor Description LockingRevFile(java.io.File file)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
boolean
exists()
void
open()
java.util.Properties
properties()
void
update()
-
-
-
Method Detail
-
exists
public boolean exists()
-
open
public void open() throws java.io.IOException
-
properties
public java.util.Properties properties()
- Specified by:
properties
in interfaceLock
-
update
public void update() throws java.io.IOException
-
-