You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Hermann Angstl <ha...@talend.com> on 2013/09/09 13:33:55 UTC

Shutdown hook functionality using a SynchronousBundleListener

Hi there,



I want to implement some kind of shutdown hook functionality (-> do something in case the container shuts down).



Would it work to use a SynchronousBundleListener and listen for STOPPING events for bundle 0 (the framework)?



In case I trigger a container shutdown, does the framework first send STOPPING events to all bundles before it actually stops them? Or are all (most) bundles already gone once bundle 0 received the STOPPING event?



cheers,

Hermann

Re: Shutdown hook functionality using a SynchronousBundleListener

Posted by Neil Bartlett <nj...@gmail.com>.
When somebody posts the same question on both Stackoverflow and this
mailing list, I always wonder whether to answer in both places...

Oh well I might as well! You need to provide some motivation for your
question... all bundles are notified through their
BundleActivator.stop() method when the framework is going down, and
this gives them the opportunity to clean up anything that they might
have created.

Regards,
Neil

On Mon, Sep 9, 2013 at 12:33 PM, Hermann Angstl <ha...@talend.com> wrote:
> Hi there,
>
>
>
> I want to implement some kind of shutdown hook functionality (-> do something in case the container shuts down).
>
>
>
> Would it work to use a SynchronousBundleListener and listen for STOPPING events for bundle 0 (the framework)?
>
>
>
> In case I trigger a container shutdown, does the framework first send STOPPING events to all bundles before it actually stops them? Or are all (most) bundles already gone once bundle 0 received the STOPPING event?
>
>
>
> cheers,
>
> Hermann

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org