IntelliJ Java IDE
The moose likes OO, Patterns, UML and Refactoring and the fly likes Observer pattern problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Reply Bookmark "Observer pattern problem" Watch "Observer pattern problem" New topic
Author

Observer pattern problem

Yaroslav Chinskiy
Ranch Hand

Joined: Jan 09, 2001
Posts: 147
Hi,
I am writing util to monitor OS performance. I have number of agents to collect statistics(io, cpu, memory etc.) I wanted to have one gateway to send this stats to my server(stats are collected on the remote host). In order to do it clean, I used Observer pattern. However, I ran in to problems. It looks like if the Observer does not get the value of changed Observable object befor it was reset to a new one, I loose the value.
Is there any queue mechanism that has to be enabled?
(Each agent runs in the seperate thread asynch. I used one observer for all agents. The logic in observer is very simple, I take the value an place it on a message queue(not JMS).)
 
 
subject: Observer pattern problem
 
Threads others viewed
about view and model
What's Your Favorite Pattern?
refresh modal dialog box
How to make clients receive updates
A question about implementing my own listener
jQuery in Action, 2nd edition