<div dir="ltr">If you want to execute some code before stopping anything in the container, you can implement a ContainerLifecyclePlugin and add your code in the 










<p class="">method stopContainer that is called before stopping anything. You can extend the class BaseContainerLifecyclePlugin from the kernel.</p><p class="">Then you need to declare it at the beginning of a configuration file like in this example <a href="https://github.com/exodev/kernel/blob/master/exo.kernel.container/src/test/resources/org/exoplatform/container/test-exo-container.xml">https://github.com/exodev/kernel/blob/master/exo.kernel.container/src/test/resources/org/exoplatform/container/test-exo-container.xml</a> </p>

<div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 14, 2013 at 5:39 PM, Juraci Paixão Kröhling <span dir="ltr">&lt;<a href="mailto:jcosta@redhat.com" target="_blank">jcosta@redhat.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">On 11/14/2013 04:01 PM, Nicolas Filotto wrote:<br>


&gt; No there is no bug, it is expected to ensure consistency on shutdown<br>
<br>
</div>In that case, I&#39;d have to ask if there would be another event or hook<br>
that I could subscribe to get notified before the repository gets offline.<br>
<br>
That&#39;s because WSRP needs a fresh list of the consumers running on the<br>
portal that is being shutdown, so that they are unregistered[1].<br>
<br>
This list of consumers comes from the persistent storage[2], meaning<br>
that it needs to open a Chromattic session, which in turn needs the<br>
repository to be online[3].<br>
<br>
While I can certainly workaround it using a cached list of consumers to<br>
unregister from the federating portlet invoker, I would rather prefer to<br>
be notified about a last chance to talk to the persistent storage.<br>
<br>
>From what I&#39;m understanding from this thread, when the stop() method is<br>
called for WSRP, it&#39;s already too late to properly stop WSRP, but<br>
perhaps there&#39;s another notification that I should be listening to? How<br>
do other components deals with this scenario (getting something from<br>
persistent storage during shutdown)?<br>
<br>
1 - <a href="http://git.io/ujAGbQ" target="_blank">http://git.io/ujAGbQ</a><br>
2 - <a href="http://git.io/2B3kLA" target="_blank">http://git.io/2B3kLA</a><br>
3 - <a href="http://git.io/yiYuCw" target="_blank">http://git.io/yiYuCw</a><br>
<br>
Thanks!<br>
Juca.<br>
</blockquote></div><br></div></div>