Running Messenger inside Cocoon

Has anyone here tried running Messenger inside Apache Cocoon?

I’'d like to develop a web based interface for users of my chat server. Most of what I want to do can be done through the databse tables, but for some things I think I need to interact with the Messenger classes so I can show things like if the user is logged in via XMPP, view their roster with presence, offline messages, etc.

I understand I can build Messenger as a WAR, but I’'m not sure how I would grab a reference to the server from a different context. I think with Cocoon the best way would be to wrap Messenger as an Apache Excalibur component and have it launched when Cocoon starts.

I just started with Jabber and Jive Messenger, and I’‘m pretty excited about it. I don’‘t know if there are any other Cocoon developers here, but it seems like it’'ll make a nice combination.

Thanks,

Justin

I’'m not sure about bundling with cocoon… however, you could certainly unzip the WAR file and copy the JAR and other resources either into an existing WAR file or into the classpath of your application server. That would allow you to call the Jive Messenger API directly.

Regards,

Matt

After looking at the source, am I right in thinking all I need to do to start the server is instantiate XMPPServer?

Thanks

Hey Justin,

Take a look at the ServerStarter class. This class uses a special classloader to load the XMPPServer class.

Regards,

– Gato

That’'s what I did. It seems it just adds the Messenger lib dir to the classpath and instantiates XMPPServer.

XMPPServer does everything in start() and initialize() right? Then each module starts it’'s own thread(s) in initialize() and the server is up and running?

Seems pretty simple.

Thanks again

So I’‘m getting things setup and I’'m wondering what JAR files I need to put in my lib directory.

messenger.jar seems to contain everything I need, but as I was looking through the source I noticed that XMPPServer.java has ServerStarter hard-coded as STARTER_CLASSNAME. I wasn’'t going to include starter.jar. Will this be a problem?