public class SynchronizedDirectory
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected int |
busyCount |
protected java.lang.Thread |
lockOwner |
Constructor and Description |
---|
SynchronizedDirectory(java.io.File dir)
Instantiate with a known directory.
|
Modifier and Type | Method and Description |
---|---|
java.io.File |
getDirectory()
Returns the directory of interest.
|
void |
lock()
Used to "grab" the lock on the directory of interest.
|
void |
notifyMoreFiles()
Used by a producer to notify any consumers that files have been
placed in the directory of interest.
|
void |
unlock()
Release the lock on the directory.
|
java.lang.String[] |
waitForMoreFiles(java.io.FilenameFilter f)
Used by a thread that consumes files from the directory of interest.
|
public SynchronizedDirectory(java.io.File dir)
public void lock()
public void unlock()
public java.io.File getDirectory()
public java.lang.String[] waitForMoreFiles(java.io.FilenameFilter f)
f
- A required FilenameFilter for identifying only files of
interest.public void notifyMoreFiles()