File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes OO, Patterns, UML and Refactoring and the fly likes component informs other component Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "component informs other component" Watch "component informs other component" New topic

component informs other component

ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
There is a requirement in my project that a component needs to inform another component when certain event occurs.

What options do I have in Java EE 5?

I guess I should use JMS queue, Message Driven Bean, and Java Mail API. Client will send message to JMS queue, Message Driven Bean will listen to it and will send a mail through Java Mail API when message arrives in queue.

One more way is, client will directly send mail through Java Mail API when that event occurs. It doesn�t need JMS queue and MDB.

What you suggest?

ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
It seems like suitable requirement for Observer pattern but in my case, observer is a human.
I agree. Here's the link:
subject: component informs other component
Similar Threads
can MDB used for Topic listening?
[JMS] communication between producer-consumer, different vendors
MDB in weblogic problem
JMS - Achieving gaurateed sending of messages in the Queue
newbie question: please help with scja exam question