|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuk.ac.rdg.resc.jstyx.server.StyxFile
uk.ac.rdg.resc.jstyx.server.AsyncStyxFile
uk.ac.rdg.resc.jstyx.server.MonitoredFileOnDisk
public class MonitoredFileOnDisk
A file on disk that is continuously monitored. This is basically an AsyncStyxFile that wraps a FileOnDisk, with a separate thread that monitors the underlying file (checks for changes to the last modified time and length of the file). Note that the underlying file does not have to exist at the time the MonitoredFileOnDisk object is constructed or at the time the monitor is started.
| Field Summary |
|---|
| Fields inherited from class uk.ac.rdg.resc.jstyx.server.AsyncStyxFile |
|---|
baseFile |
| Fields inherited from class uk.ac.rdg.resc.jstyx.server.StyxFile |
|---|
auth, directory, lastModifiedTime, name, parent |
| Constructor Summary | |
|---|---|
MonitoredFileOnDisk(java.io.File file)
Creates a new instance of MonitoredFileOnDisk that monitors the underlying file every 2 seconds. |
|
MonitoredFileOnDisk(java.io.File file,
long monitorInterval)
Creates a new instance of MonitoredFileOnDisk. |
|
MonitoredFileOnDisk(java.lang.String filename)
Creates a new instance of MonitoredFileOnDisk that monitors the underlying file every 2 seconds. |
|
MonitoredFileOnDisk(java.lang.String name,
java.io.File file,
long monitorInterval)
Creates a new instance of MonitoredFileOnDisk. |
|
MonitoredFileOnDisk(java.lang.String filename,
long monitorInterval)
Creates a new instance of MonitoredFileOnDisk. |
|
| Method Summary | |
|---|---|
ULong |
getLength()
|
static void |
main(java.lang.String[] args)
Simple test program |
void |
run()
|
void |
startMonitoring()
Starts monitoring the file |
void |
stopMonitoring()
Stops monitoring the file |
| Methods inherited from class uk.ac.rdg.resc.jstyx.server.AsyncStyxFile |
|---|
clientDisconnected, delete, fileContentsChanged, fileContentsChanged, getBaseFile, read, setMinReplyInterval, write |
| Methods inherited from class uk.ac.rdg.resc.jstyx.server.StyxFile |
|---|
addChangeListener, addClient, checkSetLastModifiedTime, checkSetLength, checkSetMode, checkSetName, clientConnected, contentsChanged, fireContentsChanged, getClient, getDirEntry, getFullPath, getGroup, getName, getNumClients, getOwner, getParent, getPermissions, getQid, getVersion, incrementVersion, isAppendOnly, isAuth, isDirectory, isExclusive, processAndReplyRead, processAndReplyRead, processAndReplyRead, refresh, remove, removeChangeListener, removeClient, rename, replyRead, replyRead, replyRead, replyRead, replyRead, replyWrite, setLastAccessTime, setLastModified, setLength, setMode, setName, setPermissions, setReadOnly |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MonitoredFileOnDisk(java.lang.String filename,
long monitorInterval)
throws StyxException
filename - The name of the underlying file to monitor. Note that this
file does not need to exist yetmonitorInterval - The time in milliseconds between each check to see
if the file has changed
StyxException - if the file name is illegal
public MonitoredFileOnDisk(java.lang.String filename)
throws StyxException
filename - The name of the underlying file to monitor. Note that this
file does not need to exist yet
StyxException - if the file name is illegal
public MonitoredFileOnDisk(java.lang.String name,
java.io.File file,
long monitorInterval)
throws StyxException
name - The name of the file as it will appear in the Styx namespacefile - The underlying file to monitor. Note that this file does not
need to exist yetmonitorInterval - The time in milliseconds between each check to see
if the file has changed
StyxException - if the file name is illegal
public MonitoredFileOnDisk(java.io.File file,
long monitorInterval)
throws StyxException
file - The underlying file to monitor. Note that this file does not
need to exist yetmonitorInterval - The time in milliseconds between each check to see
if the file has changed
StyxException - if the file name is illegal
public MonitoredFileOnDisk(java.io.File file)
throws StyxException
file - The underlying file to monitor. Note that this file does not
need to exist yet
StyxException - if the file name is illegal| Method Detail |
|---|
public void run()
run in interface java.lang.Runnablepublic ULong getLength()
getLength in class AsyncStyxFilepublic void startMonitoring()
public void stopMonitoring()
public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||