I have implemented an EJB state machine for monitoring business processes.. and need to send events to listeners (over RMI).
I would like to use a stateless session bean as the event dispatcher but am not sure where to persist the list of listeners in the session bean?
Normally I would use a singleton event manager, how do I do this inside the container?
-
Stateless Session Persistence / observer pattern (3 messages)
- Posted by: Toby Weston
- Posted on: October 26 2001 04:12 EDT
Threaded Messages (3)
- Stateless Session Persistence / observer pattern by Kevin Citron on October 26 2001 11:48 EDT
- Stateless Session Persistence / observer pattern by raghu tss rao on October 26 2001 11:53 EDT
- Stateless Session Persistence / observer pattern by regunath b on October 31 2001 05:46 EST
-
Stateless Session Persistence / observer pattern[ Go to top ]
- Posted by: Kevin Citron
- Posted on: October 26 2001 11:48 EDT
- in response to Toby Weston
I have implemented something very similiar. I used
a DB to store my event listeners. It worked just fine.
-
Stateless Session Persistence / observer pattern[ Go to top ]
- Posted by: raghu tss rao
- Posted on: October 26 2001 11:53 EDT
- in response to Toby Weston
Have you evaluated JMS.
If you where to implement the dispatcher, one option you have is to presist the list of observers in the database. -
Stateless Session Persistence / observer pattern[ Go to top ]
- Posted by: regunath b
- Posted on: October 31 2001 05:46 EST
- in response to Toby Weston
We used a combination of a Mediator and an Observer to implement this. The Mediator is a singleton to which interested Observers register. The source of the events simply notifies the Mediator which in turn does a call-back on all registered Observers/Listeners.
In your case, just wrap the Mediator in a stateless session bean. The Mediator should be brought up when the application starts up - say you could have a startup servlet that creates an instance of the Mediator in the init() and maintains the reference releasing it only in the destroy().