> Scenario:
>
> 1. A client connects to a "session bean".
> 2. The reference of this client is given to a
> Notifier ( just another
> object).
> 3. Can this Notifier, in an independent thread call
> methods on these
> clients..essentially Pushing Data ?
>
> Is this possible? Has anybody done it before? Need
> to know it very urgently.
>
>
> The actual doubt from my side is
>  -- Can a real time notification system be built
> side by side with the
> EJBs,which do the subscription of the clients for
> such a notification in
> addition to many other things.

Yes, it can be implemented but not as an EJB. The
actual "activation" of the push needs to be done in a
separate application (in J2EE it is called an
"application-client") which needs to be run as a
server next to the ejb-server.
The reason for this is actually pretty simple: An ejb
can not be activated by itself and it can not start
threads.
These two restrictions (actually it suffices with any
one of them) makes a "publish-and-subscribe" type of
application impossible to implement with just ejb's.

I don't think that the MessageDrivenBean (MDB?) in EJB
2.0 solves this either.
An all ejb-application is simply reactive, never
active.

One more thing to consider is the means of
communication between the subscribers (those receiving
the push) and the "notifier" (publisher). One way
(which seems to be what you are thinking about) is to
use RMI, this will surely increase performance and put
less overhead on the implementation. It _will_ altough
decrease robustness and scaleability for higher number
of subscribers. If your requirements are on high
robustness and scaleability for a high number of
subscribers I would seriously consider using JMS
instead of RMI which is designed for this types of
applications.

Also, since the server that actually activates the
ejb's doing the work is an independent server
maintained externally from the ejb-server it's
"quality-of-service" will not be guaranteed by the
ejb-server (fail-over, restarts etc.). Thus I would
implement as little as possible in that server
optimally just a simple configurable timer propagating
everything to an ejb (transaction management,
security, distribution etc. etc.) making it less prone
for errors.

Hope this will put you somewhere in the track of a solution.

__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to