You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by "Cleveland, Seth" <se...@amd.com> on 2008/04/18 19:32:23 UTC

bean predestroy annotation confusion

I have a bean class that implements the MessageExchangeListener
interface.  I need a method called when the service assembly contains
that bean is stopped or undeployed.  Based on the bean documentation I
assumed the annotation PreDestroy handled that.

 

Excerpt from: http://servicemix.apache.org/servicemix-bean.html

PreDestroy 
<http://java.sun.com/javase/6/docs/api/javax/annotation/PreDestroy.html>
Method The PreDestroy annotation is used on methods as a callback
notification to signal that the instance is in the process of being
removed by the container.

 

However, I find that the method I annotate with @PreDestroy is called
after the first exchange to my bean class is "DONE".  

 

Are my assumptions wrong?  Is there way to know when a bean inside a
service assembly is being undeployed, stopped, or shutdown in
servicemix?

 

Thanks,

Seth

 

 


RE: bean predestroy annotation confusion

Posted by "Cleveland, Seth" <se...@amd.com>.
Looks like it's fixed.
https://issues.apache.org/activemq/browse/SM-1136

 

In this ticket, I'll try this patch first.

 

Thanks,

Seth

 

From: Cleveland, Seth [mailto:seth.cleveland@amd.com] 
Sent: Friday, April 18, 2008 12:32 PM
To: users@servicemix.apache.org
Subject: bean predestroy annotation confusion

 

I have a bean class that implements the MessageExchangeListener
interface.  I need a method called when the service assembly contains
that bean is stopped or undeployed.  Based on the bean documentation I
assumed the annotation PreDestroy handled that.

 

Excerpt from: http://servicemix.apache.org/servicemix-bean.html

PreDestroyhttp://cwiki.apache.org/confluence/images/icons/linkext7.gif
<http://java.sun.com/javase/6/docs/api/javax/annotation/PreDestroy.html>
Method The PreDestroy annotation is used on methods as a callback
notification to signal that the instance is in the process of being
removed by the container.

 

However, I find that the method I annotate with @PreDestroy is called
after the first exchange to my bean class is "DONE".  

 

Are my assumptions wrong?  Is there way to know when a bean inside a
service assembly is being undeployed, stopped, or shutdown in
servicemix?

 

Thanks,

Seth