Ok. Here we go.
The SpringBeanFactoryHolder implementation:
public class DIFSpringBeanFactoryHolderImpl extends SpringBeanFactoryHolderImpl
{
private ServletContext context;
public void setContext(ServletContext context)
{
this.context = context;
} public ServletContext getContext()
{
return context;
}@Override
public BeanFactory getBeanFactory()
{
if (super.getBeanFactory() == null)
{
super.setBeanFactory(WebApplicationContextUtils.getRequiredWebApplicationContext(getContext()));
}
return super.getBeanFactory();
}
}
hivemodule.xml spring integration part:
<implementation service-id="hivemind.lib.DefaultSpringBeanFactoryHolder">
<invoke-factory>
<construct autowire-services="false" class="pt.digitalis.dif.view.util.DIFSpringBeanFactoryHolderImpl">
<set-object property="context" value="service:tapestry.globals.ServletContext"/>
</construct>
</invoke-factory>
</implementation>
In the spring application context file i have this bean:
<bean id="properties" class="pt.digitalis.dif.domain.PropertiesLocator" destroy-method="destroy"/>
The destroy method is never invoked. I had this working on 3.0.2, it stopped working when i migrated my code to 3.1(4.0)
Thanks for the help.
Hugo
Nanda Firdausi wrote:
-----Original Message----- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Hugo Palma Sent: 11 April 2005 15:36 To: [email protected] Subject: 3.1 Spring integration not releasing resources on shutdown
I have a tapestry 3.1-alpha1 webapp with spring 1.1.5.
I've implemented the suggested spring integration in the wiki page http://wiki.apache.org/jakarta-tapestry/Tapestry31Spring.
The problem is that when i shutdown my web app the configured spring beans aren't being released. This is more visible if you have destroy methods configured for some beans, as these methods aren't called.
My guess is that this is happening because the close() method of the ConfigurableApplicationContext interface isn't being called on shutdown, but i couldn't understand why. I tried casting with no success.
I guess that u use slightly different ApplicationContext here. Maybe Hivemind provide way to call destroy method(close() ) but I haven't chect it yet.
Can you give me the corresponding code, please?
Any ideas ?
(I posted this same message to the users list but got no reply, so i decided to post it here. If this is the wrong place for this please let me know).
Thanks.
Hugo
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
