|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Thread
org.ceryle.wiki.plugin.chat.WikiChatManager
public class WikiChatManager
Provides a manager for chat events occurring on any wiki pages
within a single WikiEngine. These are generated by the
WikiChatPlugin, with this
manager providing the page-specific filtering so that a single
manager currently handles all chat activity for the
WikiEngine.
Note that prior to firing an WikiChatEvent meant to be managed
by this class, one should call active() so that it
doesn't kill itself prior to processing the event.
See the notes regarding the per-WikiEngine or per-WikiPage decision
on WikiChatManagerFactory.
WikiEvent,
WikiEventListener,
WikiChatEvent| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
static int |
default_lifespan
The default value for the delay before the WikiChatManager dies. |
protected static org.apache.log4j.Logger |
log
|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
protected |
WikiChatManager(WikiChatManagerFactory factory,
WikiEngine engine)
Create an WikiChatManager for the provided WikiEngine. |
| Method Summary | |
|---|---|
void |
active()
Called to indicate activity and keep this WikiChatManager alive. |
String |
getColorForUser(Principal user)
Returns a color specification for the given user. |
static List |
getColors()
Returns a List of color specifications. |
WikiChatRecord |
getRecordForPage(String pagename)
Returns the List of chat events associated with the wiki page identified by pagename. |
String |
getTimeString(long timestamp)
Returns a formatted String representing the timestamp. |
boolean |
hasWikiChatListener(WikiEventListener listener)
Returns true if the WikiEventManager is already listening with this WikiChatManager's WikiEventListener. |
void |
interrupt()
Overrides the superclass to disable this being called externally. |
boolean |
isListenerEnabled()
Returns the enabled state of this WikiChatManager's WikiEventListener. |
protected void |
kill()
A synonym method that just calls Thread.interrupt(). |
void |
run()
Once started, will kill itself after time delay if no activity. |
protected void |
setLifespan(int seconds)
Sets the lifespan to the number of seconds. |
| 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, 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 static org.apache.log4j.Logger log
public static final int default_lifespan
| Constructor Detail |
|---|
protected WikiChatManager(WikiChatManagerFactory factory,
WikiEngine engine)
engine - the WikiEngine backing the event handling.| Method Detail |
|---|
public void run()
run in interface Runnablerun in class Threadpublic void interrupt()
kill() instead.
interrupt in class Threadprotected void kill()
Thread.interrupt().
public WikiChatRecord getRecordForPage(String pagename)
public boolean hasWikiChatListener(WikiEventListener listener)
public boolean isListenerEnabled()
protected void setLifespan(int seconds)
public void active()
This creates a timer that if permitted to complete will kill the manager. Calling this method resets the Timer.
public String getColorForUser(Principal user)
public String getTimeString(long timestamp)
public static List getColors()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||