|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.shimari.bot.Bot
A Bot is dynamically constructed from a bunch of components. This Bot class is the glue that brings them all together: the Bot object contains the main loop, and glues Connections to Handlers. The Connections send/receive messages to the Bot, and the Handlers process those messages. Some of the Handlers also implement the Cron.Task interface, and have periodically executed behavior. An actual implementation of a Bot in effect configures the Bot with all the right Handler and Connection objects.
Constructor Summary | |
Bot(Config configuration)
The default constructor for a Bot -- we must have this so that the Bot can be constructed and configured easily from a configuration file. |
|
Bot(java.lang.String configResource)
|
Method Summary | |
Channel |
getBroadcastChannel()
Return a channel which can be used to talk to everyone who is interested in listening to this bot |
void |
init(Registry componentMap)
|
boolean |
isRunning()
|
void |
run()
The main loop. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Bot(Config configuration) throws ConfigException
public Bot(java.lang.String configResource) throws ConfigException
Method Detail |
public void init(Registry componentMap)
init
in interface Component
public boolean isRunning()
public Channel getBroadcastChannel()
public void run()
run
in interface java.lang.Runnable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |