|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread com.isti.util.IstiThread com.isti.util.IstiNotifyThread com.isti.util.FileMonPollingThread
Class FileMonPollingThread defines a thread for monitoring a file via a 'FileDataMonitor' object.
Nested Class Summary | |
static interface |
FileMonPollingThread.FileDataCallBack
Interface FileDataCallBack defines a call-back method to be invoked when new file data is available. |
Field Summary | |
static byte[] |
ERROR_ARRAY
Empty array used to indicate error. |
protected int |
fileAccessTimeOutMs
|
protected FileMonPollingThread.FileDataCallBack |
fileDataCallBackObj
|
protected FileDataMonitor |
fileDataMonitorObj
|
protected long |
maxReadBytesLimit
|
protected int |
pollingIntervalMs
|
Fields inherited from class com.isti.util.IstiThread |
DEFAULT_TERMINATE_WAIT_TIME, terminateFlag |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
FileMonPollingThread(java.lang.String fNameStr,
int pollingIntervalMs,
int fileAccessTimeOutMs,
long maxReadBytesLimit,
FileMonPollingThread.FileDataCallBack fileDataCallBackObj)
Creates a thread for monitoring a file via a 'FileDataMonitor' object. |
Method Summary | |
byte[] |
checkReadFileData()
Checks if the file has been modified and returns its contents if so. |
boolean |
getErrorMessageFlag()
Returns the status of the error message. |
java.lang.String |
getErrorMessageString()
Returns the current error message (if any). |
FileDataMonitor |
getFileDataMonitorObj()
Returns the 'FileDataMonitor' object used by this object. |
void |
run()
Executing method for file-monitoring thread. |
Methods inherited from class com.isti.util.IstiNotifyThread |
sleep, terminate |
Methods inherited from class com.isti.util.IstiThread |
clearThreadWaitNotifyFlag, isTerminated, nextThreadNum, notifyThread, start, terminate, waitForNotify, waitForNotify, waitForTerminate, waitForTerminate, wasStarted |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final byte[] ERROR_ARRAY
protected final FileDataMonitor fileDataMonitorObj
protected final int pollingIntervalMs
protected final int fileAccessTimeOutMs
protected final long maxReadBytesLimit
protected final FileMonPollingThread.FileDataCallBack fileDataCallBackObj
Constructor Detail |
public FileMonPollingThread(java.lang.String fNameStr, int pollingIntervalMs, int fileAccessTimeOutMs, long maxReadBytesLimit, FileMonPollingThread.FileDataCallBack fileDataCallBackObj)
fNameStr
- name of input file to be read and monitored.pollingIntervalMs
- number of milliseconds to wait between
polls of the input file.fileAccessTimeOutMs
- timeout value for file access, or 0 for
infinite.maxReadBytesLimit
- maximum number of bytes to read from file,
or 0 for no limit.fileDataCallBackObj
- call-back object to be invoked when changes
in the file data are detected.Method Detail |
public void run()
public byte[] checkReadFileData()
public FileDataMonitor getFileDataMonitorObj()
public boolean getErrorMessageFlag()
public java.lang.String getErrorMessageString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |