• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Disposable bean's destroy method is not being called ???

 
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have implemented the Disposable interface and overridden it's destroy method, but it's not being invoked!

Can anybody tell me why ?

Thanks ...
 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Even when i specify a destroy-method it does not get called !!!

Please help !!!

Thanks ...
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have implemented the Disposable interface


Do you mean the DisposableBean interface ?

Even when i specify a destroy-method it does not get called !!!


How did you define your bean, and how are you getting it ? Please show us the relevant parts of your code.
 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Yes i mean the DisposableBean interface.

Here's an example of the bean i use :



I get it using a FileSystemXmlApplicationContext passing it the name of the xml file where my beans reside, like the following :



Any clue ??

Thanks ...
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to explicitly close the ApplicationContext, otherwise Spring won't now that everything is shutting down. Try to call the close() method of the AbstractApplicationContext.

You could also use registerShutdownHook() instead, so that Spring closes the context when everything shuts down.


[ March 16, 2008: Message edited by: Christophe Verre ]
 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks it's working

Regards,
reply
    Bookmark Topic Watch Topic
  • New Topic