I have some initialization code (registering timers using addNotificationListener ) that I want executed right after my EJB application, which consists of several entity and stateless-session beans, is DEPLOYED.
I don't want to tie the execution of this code to the creation of a particular entity or session bean. I would like it to be executed independent of that.
Is there a standard J2EE or Jboss-specific way of doing this?
Should I be initializing my timers (using MBeanServer.addNotificationListener) in some other way/place? Basically, I want a method, that does a bunch of housekeeping across several of the entity beans, to be called periodically.
Thanks.
vjha
The normal j2ee hack is to write a servlet which
is loaded at startup. You then do the work in init()
The jboss mechanism is to add an MBean which
depends upon the ejb-jar deployment.
This has been mentioned quite a few times in the past,
use search.
Regards,
Adrian