|
Jacson | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.spieleck.app.jacson.PluginBase de.spieleck.app.jacson.source.ChunkSourceBase de.spieleck.app.jacson.source.TailSource
Implement a JacsonChunkSource
which is continuously running
and monitoring files for changes.
Note1: This works under the char = byte assumption, i.e.
does not treat unicode right!
Note2: This is Java and their might be problems which
are so plattform dependand, that there is no Java solutions (e.g.
I do not expect this to help with lock rollovers and inodes...)
Nested Class Summary | |
class |
TailSource.MetaThread
The MetaThread enqueues the changing files |
protected class |
TailSource.WatchedFile
Encapsulate a file with the ability to check for new bytes and a Runnable to fetch new bytes. |
Field Summary | |
protected java.util.LinkedList |
chunkQueue
The queue of Chunks to be returned |
protected int |
deltaTime
Delay between inspections of queue |
static java.lang.String |
JACSON_STATE_CHUNK_TYPE
|
protected java.lang.Thread |
metaThread
The thread watching ALL files for change |
protected ThreadPool |
threads
A ThreadPool of assignments to read files. |
protected TaskQueue |
tQueue
The threads are queued into above pool by the ThreadQueue. |
protected java.util.List |
watched
The watched Resources |
protected int |
workers
The number of worker Threads |
Constructor Summary | |
TailSource()
|
Method Summary | |
void |
addWatch(java.lang.String label,
java.lang.String fName)
Add file to be watched. |
void |
join()
Wait for finish. |
java.lang.String |
message()
|
java.lang.String |
nextChunk()
Deliver a sequence of chunks (that is Strings). |
void |
setDeltaTime(int deltaTime)
Set the delay between file checks |
void |
setWorkers(int workers)
Set the number of workers |
void |
startWatching()
Start watching on the files. |
Methods inherited from class de.spieleck.app.jacson.PluginBase |
getRegReport, getRegState, registerReport, registerState, summary |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.spieleck.app.jacson.JacsonStately |
registerState |
Methods inherited from interface de.spieleck.app.jacson.JacsonReporting |
registerReport, summary |
Field Detail |
public static final java.lang.String JACSON_STATE_CHUNK_TYPE
protected java.lang.Thread metaThread
protected ThreadPool threads
protected TaskQueue tQueue
protected int deltaTime
protected int workers
protected java.util.List watched
protected java.util.LinkedList chunkQueue
Constructor Detail |
public TailSource()
Method Detail |
public void setWorkers(int workers)
public void setDeltaTime(int deltaTime)
public void addWatch(java.lang.String label, java.lang.String fName) throws java.io.IOException
java.io.IOException
public void startWatching()
public java.lang.String nextChunk() throws JacsonException
JacsonChunkSource
JacsonException
public void join()
public java.lang.String message()
|
Spieleck | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |