Smack Bot


I have some questions about writing and launching a bot with Smack API :

1 - I’'ve found an example code on the forums which architecture was simply :

import org.jivesoftware.smack.*;

public class Bot {

public Bot() {}

public static void main(String[] args) {

// specific filtering and listening code to be added

// waits

synchronized (Thread.currentThread()) {

try {



catch (InterruptedException e) {





Is this the right way to do it, not extending any Smack API class, and using thread.wait() ?

My context is launching dozens of bots moderating MUC (that emulates simple games).

2 - Do I have to install a Tomcat server tu run my (dozens of) bots ?

3 - How do I launch my bots from :

  • a web browser (URL call) ;

  • a Flash client ;

  • a (Wildfire) server ?

Many thanks,



as far as I know you need to keep your program running, so a wait() should be fine to prevent termination. I don’'t use Smack very often but I assume that you can open multiple connections using Smack and one process - so all bots should be able to run in one process.

If you want to control your bots using a browser you could write a jsp page to do this, then using Tomcat would make sense.