users@glassfish.java.net

Re: EJB lifecycle, how to catch EJB unload event

From: <glassfish_at_javadesktop.org>
Date: Tue, 27 Nov 2007 01:47:46 PST

well the question here is not really how to implement a scheduler actually, but how to catch the EJB unload event (if there's any). Example: even when I use TimerTask to realize the scheduler (what is nothing else than a thread, but anyway), I still have the problem that even after I undeploy the application that startet the timer, the scheduler still is running. Here some example outputs...

######### SCHEDULER INVOKED .... need to do anything now
######### SCHEDULER INVOKED .... need to do anything now
CORE5022: All ejb(s) of [testapp] were unloaded successfully!
######### SCHEDULER INVOKED .... need to do anything now

When I now deploy the application again, I'm having two timers running. Thats what I want to avoid.

What I'm looking for is some overwritten methode in the stateful session bean that I use, that indicates that the EJB is unloaded/stopped from the appserver. Thats why I was asking whether ejbRemove might do the job?
[Message sent by forum member 'swordofdarius' (swordofdarius)]

http://forums.java.net/jive/thread.jspa?messageID=247310