|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
org.nuiton.wikitty.WikittyServiceNotifier.EventThread
public static class WikittyServiceNotifier.EventThread
Thread utilise pour envoyer les events. On rend accessible ce thread pour pouvoir y acceder depuis l'exterieur (pour l'instant pour les tests mais peut-etre plus tard du monitoring). Il permet a un thread d'attendre qu'un evenement leve a une certaine heure est bien ete dispatchee grace a la methode waitfor
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
protected org.nuiton.util.ListenerSet<WikittyServiceListener> |
allWikittyServiceListeners
Wikitty service listener (all event). |
protected java.util.concurrent.LinkedBlockingQueue<WikittyServiceEvent> |
eventToSend
reference vers la collection qui contient les events a envoyer |
protected long |
lastEventTime
heure du dernier event envoye |
protected org.nuiton.util.ListenerSet<WikittyServiceListener> |
localWikittyServiceListeners
Wikitty service listener (only for local event). |
protected boolean |
mustBeRunning
|
protected org.nuiton.util.ListenerSet<WikittyServiceListener> |
remoteWikittyServiceListeners
Wikitty service listener (only for remote event). |
protected java.util.SortedMap<java.lang.Long,java.lang.Object> |
waiter
|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
WikittyServiceNotifier.EventThread(java.util.concurrent.LinkedBlockingQueue<WikittyServiceEvent> eventToSend,
org.nuiton.util.ListenerSet<WikittyServiceListener> allWikittyServiceListeners,
org.nuiton.util.ListenerSet<WikittyServiceListener> localWikittyServiceListeners,
org.nuiton.util.ListenerSet<WikittyServiceListener> remoteWikittyServiceListeners)
|
|
| Method Summary | |
|---|---|
protected void |
askStop()
demande l'arret du thread, ne doit ĂȘtre appeler que par le finalize du WikittyServiceNotifier |
protected void |
processEventQueue()
|
void |
run()
|
boolean |
stopAsked()
retourne vrai si on a demande l'arret du thread |
void |
waitFor(long eventTime)
thread that want wait for particulare event to be processed, can be call this method with event time in argument. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected boolean mustBeRunning
protected java.util.SortedMap<java.lang.Long,java.lang.Object> waiter
protected java.util.concurrent.LinkedBlockingQueue<WikittyServiceEvent> eventToSend
protected org.nuiton.util.ListenerSet<WikittyServiceListener> allWikittyServiceListeners
protected org.nuiton.util.ListenerSet<WikittyServiceListener> localWikittyServiceListeners
protected org.nuiton.util.ListenerSet<WikittyServiceListener> remoteWikittyServiceListeners
protected long lastEventTime
| Constructor Detail |
|---|
public WikittyServiceNotifier.EventThread(java.util.concurrent.LinkedBlockingQueue<WikittyServiceEvent> eventToSend,
org.nuiton.util.ListenerSet<WikittyServiceListener> allWikittyServiceListeners,
org.nuiton.util.ListenerSet<WikittyServiceListener> localWikittyServiceListeners,
org.nuiton.util.ListenerSet<WikittyServiceListener> remoteWikittyServiceListeners)
| Method Detail |
|---|
protected void askStop()
public boolean stopAsked()
public void waitFor(long eventTime)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void run()
run in interface java.lang.Runnablerun in class java.lang.Threadprotected void processEventQueue()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||