Re: Mutual EJB possible?

From: Michael Borgwardt (brazil_at_brazils-animeland.de)
Date: 10/17/03


Date: Fri, 17 Oct 2003 16:54:26 +0200

Vjeran Marcinko wrote:
> Anyway, is it possible to create something like singleton EJB ? I don't need referencing it
> through static accessor SingletonClass.getInstance(), I would fetch it from JNDI
context, but
> I need just one instance of it to exist in EJB container ...

In that case, EJB isn't really what you need. At least not the way you seem to plan.

> More concretly - let's say I want to make some 'ChatRoom' EJB, which would hold references of all
> connected clients, so it could dispatch messages to all room chatters when some message
is placed
> into chat room ? Is EJB not meant to be used for this kind of applications ?

No, it would be serious overkill and a lot of unnecessary hassle.

EJBs only make sense when you can actually profit from their unique features,
namely the easy clustering and declarative transaction and security management.