L.S., You're right - those annotations only work for a bean endpoint in the servicemix-bean component.
For the file marshaler, you can leverage the fact that the xbean.xml file is really just a Spring XML file. So, when you create you file marshaler instance, you can configure the init-method and destroy-method attributes to start and stop your monitor thread. Something like... <bean id="myFileMarshaler" class="your.package.myFileMashaler" init-method="startMonitor" destroy-method="stopMonitor"/> Regards, Gert Vanthienen ------------------------ FuseSource Web: http://fusesource.com Blog: http://gertvanthienen.blogspot.com/ On Fri, Jul 15, 2011 at 8:12 AM, dingliu <[email protected]> wrote: > Hi, > > Sorry, but actually I start the thread inside from a file marshaler, > which is used by a file sender. I use your mentioned method, something like > below: > > public class myFileMarshaller extends DefaultFileMarshaler { > > ............ > > @PostConstruct > public void startMonitor() > { > Monitor.getInstance().startMonitorThread(); > } > > @PreDestroy > public void stopMonitor() > { > Monitor.getInstance().stopMonitorThread(); > } > > } > > > Seems it doesn't work for file marshaller :( > > > -- > View this message in context: > http://servicemix.396122.n5.nabble.com/how-to-stop-user-thread-after-bean-su-is-undeployed-tp4589168p4589537.html > Sent from the ServiceMix - User mailing list archive at Nabble.com. >
