Is it possible to build a chat system somewhat similar to IRC with J2EE (meaning not needing other non-J2EE processes running)? Some issues I see are:

1) Notifying a thick client that someone else has written a message, and possibly pushing that message to the client without the client polling.

2) Having a timeout mechanism whereby if a client has been inactive for sometime, disconnect it.


How do I go about doing these things using a J2EE app?