org.nukesoft.bot2.core
Class DialogManager

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--org.nukesoft.bot2.core.DialogManager
All Implemented Interfaces:
CommPortCallback, Runnable

public class DialogManager
extends Thread
implements CommPortCallback

The DialogManager handles distribution of incomming instant messages, creating a new Dialog object if necesary. It is also responsible for automatic destruction of Dialog objects after a set durration of inactivity.

Author:
Ryan Michela

Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
DialogManager(DMConfig conf)
          Builds the DialogManager.
 
Method Summary
 void handleIM(IM message, CommPort cp)
          Handles an inbound IM from the CommLib.
 void handleWarn(String screenName, CommPort cp)
          Handles an inbound warning from the CommPort.
 void run()
          Dialog maintnance thread.
 void shutdown()
          Shuts down all Dialog, LineProc, and CommPort objects.
 
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, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DialogManager

public DialogManager(DMConfig conf)
Builds the DialogManager. For now, this is a hack.

Method Detail

handleIM

public void handleIM(IM message,
                     CommPort cp)
Handles an inbound IM from the CommLib.

Specified by:
handleIM in interface CommPortCallback
Parameters:
message - The message.
See Also:
CommPortCallback.handleIM(org.nukesoft.bot2.core.IM, org.nukesoft.bot2.commlib.CommPort)

handleWarn

public void handleWarn(String screenName,
                       CommPort cp)
Handles an inbound warning from the CommPort.

Specified by:
handleWarn in interface CommPortCallback
Parameters:
screenName - The screen name that did the warning.
See Also:
CommPortCallback.handleWarn(java.lang.String, org.nukesoft.bot2.commlib.CommPort)

shutdown

public void shutdown()
Shuts down all Dialog, LineProc, and CommPort objects.


run

public void run()
Dialog maintnance thread. Handles automatic destructuin of Dialog objects after a period of inactivity.

Specified by:
run in interface Runnable
Overrides:
run in class Thread
See Also:
Thread.start()