-
1. Re: Whats the point of notifications?
dimitris Nov 19, 2004 5:42 PM (in response to infectedrhythms)If you want to log messages and use an appender this is fine.
Notifications lets you decouple the producer from potential consumers and do things that don't necessary involve logging/writing/sending a more or less unstructured string message.
For example, when a module gets deployed (e.g. an .ear) a deployer will generate a notification and the jsr77 subsystem listens for that and creates a set of MBeans to "model" the deployed package.
In addition, there are standard "monitor" mbeans that can be configured to poll attributes on other mbean and produce notifications, should certain thresholds get crossed. So this is really a way to add management function on an existing system, assuming you have the data already (e.g. an MBean with a ThreadCount attribute) -
2. Re: Whats the point of notifications?
infectedrhythms Nov 21, 2004 12:43 PM (in response to infectedrhythms)So I figure if I wanted to if my batch filed creation through an exception it would be simpler just to sebnd an e-mail with log4j?
As for "threadcount" that wouldn't be an actuall attribute because it wouldn't have any set and get. On the other hand "maxthreadcount" would and only once "threadcount" reached the "maxthreadcount" then I would get the notification.
Now how can I implement this?
Would it be somewhere in my service's logic like...?
start loop
spawn thread
increase threadcount
if threadcount is > maxthreadcount
send notification