Where's the best place to put code that shutdowns Ehcache CacheManager ? [message #508813] |
Wed, 20 January 2010 12:50 |
|
Hi all,
Our RAP application uses Ehcache caching library which needs to be
shutdown when application exits. The recommended way to shutdown for web
app is by registering ShutdownListener in web.xml.
I was considering the SessionStoreListener, but since Ehcache scope is
supposed to be application wide, I don't think it's the appropriate
place to shutdown when a session is about to be destroyed.
I've tried the Activator#stop(), when I stop the bundle individually
from OSGI console (stop <bundleid> command) it's got called, but if I
shutdown OSGI itself (exit command) it's not.
Any advice would be greatly appreciated.
Regards,
Setya
|
|
|
|
Re: Where's the best place to put code that shutdowns Ehcache CacheManager ? [message #509001 is a reply to message #508845] |
Thu, 21 January 2010 05:05 |
|
Hi,
Thanks for answering.
> The exit console command simply does System.exit(0). It is not a safe
> way to shutdown the framework. Try the close command on the console.
> Programatically this can be done by calling stop() on the system bundle
> (the bundle with bundle id 0). This should do proper shutdown of the
> framework.
I've tried to use close command to shutdown OSGI, but Activator#stop()
didn't get called either.
Regards,
Setya
|
|
|
|
Powered by
FUDForum. Page generated in 0.04762 seconds