<div dir="ltr">To be able to understand that you need to understand how the kernel works, did you check it?</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Nov 11, 2013 at 2:54 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Nicolas,<br>
<br>
Thanks for your answer! Based on your suggestion, I&#39;m now able to check<br>
the state of the repository via RepositoryService before letting an<br>
exception be thrown down the road. It helps me to prevent the WARN<br>
message, which is the target of the JIRA I mentioned. And even though it<br>
doesn&#39;t allows me to properly shut down WSRP, it at least let me have<br>
the same behaviour as today.<br>
<br>
But it&#39;s still a bit confusing to me as to why the RepositoryContainer<br>
is added to the bottom of the &quot;start&quot; list.<br>
<br>
For clarity, I&#39;ve added two lists on pastebin:<br>
<br>
<a href="http://pastebin.com/Ba4GBdhF" target="_blank">http://pastebin.com/Ba4GBdhF</a><br>
<a href="http://pastebin.com/VuDUGiWg" target="_blank">http://pastebin.com/VuDUGiWg</a><br>
<br>
The first is the list of services to be started as seen on<br>
LifecycleVisitor, at around the same step as the WSRP service is<br>
started. The second is the same thing, but for the stop operation.<br>
<br>
By looking at the code, I would expect the lists to be exactly the same,<br>
just the &quot;stop&quot; list being the reverse of the &quot;start&quot;, but note that<br>
there&#39;s an extra RepositoryContainer there on the &quot;stop&quot; list, right at<br>
the top, meaning that it&#39;s the first one of the list to be stopped.<br>
<br>
Adding RepositoryService to the constructor didn&#39;t help shift the<br>
RepositoryContainer down the list, as RepositoryService is indeed being<br>
started before everything and stopped after everything. Also, it seems<br>
that RepositoryContainer is not a candidate for being injected.<br>
<br>
>From your explanation, I would expect RepositoryContainer to not show up<br>
on the &quot;stop&quot; list (as it&#39;s started on a different nesting level from<br>
those services), or at least be near to the RepositoryServiceImpl, which<br>
is not the case.<br>
<br>
Regards,<br>
Juca.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On 11/11/2013 09:33 AM, Nicolas Filotto wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; RepositoryContainer and Workspace containers are created, initialized and<br>
&gt; started by the RepositoryService. Try to add explicitly the<br>
&gt; RepositoryService in your constructor, this way your component should be<br>
&gt; started after the RepositoryService (and the RepositoryContainer) and will<br>
&gt; be stopped before the RepositoryService. Another solution would be to check<br>
&gt; the state of the repository first using<br>
&gt; RepositoryService.getCurrentRepository().getState() (warning it is not a<br>
&gt; static call, the goal is only to show you the methods to call), you need to<br>
&gt; make that the value is ManageableRepository.ONLINE<br>
&gt;<br>
&gt; BR,<br>
&gt; Nicolas<br>
&gt;<br>
&gt;<br>
&gt; On Fri, Nov 8, 2013 at 12:22 PM, Juraci Paixão Kröhling<br>
&gt; &lt;<a href="mailto:jcosta@redhat.com">jcosta@redhat.com</a>&gt;wrote:<br>
&gt;<br>
&gt;&gt; All,<br>
&gt;&gt;<br>
&gt;&gt; I&#39;m currently working on GTNPORTAL-3281 [1], and I have a question.<br>
&gt;&gt;<br>
&gt;&gt; The WARN message on the logs occurs during the shutdown of the server,<br>
&gt;&gt; when the method WSRPServiceIntegration.stop() is called. During this<br>
&gt;&gt; stop() method, both producer and consumers are then requested to be<br>
&gt;&gt; stopped, but the configuration for the producer and the list of<br>
&gt;&gt; consumers requires access to the workspace, which is already shut down,<br>
&gt;&gt; as RepositoryContainer is stopped before WSRPServiceIntegration.<br>
&gt;&gt;<br>
&gt;&gt; While stopping the producer is possible without requesting the workspace<br>
&gt;&gt; to be active, shutting down the consumers currently require a fresh list<br>
&gt;&gt; of consumers, which in turn requires access to the workspace.<br>
&gt;&gt;<br>
&gt;&gt; When looking into why WSRPServiceIntegration is stopped after<br>
&gt;&gt; RepositoryContainer, I noticed that the list of services to start during<br>
&gt;&gt; the boot contains 36 items, while the shutdown contains 37. The<br>
&gt;&gt; difference is exactly the RepositoryContainer.<br>
&gt;&gt;<br>
&gt;&gt; So, does anyone knows if it is appropriate for RepositoryContainer to be<br>
&gt;&gt; stopped before everything else, including WSRPServiceIntegration? If<br>
&gt;&gt; not, I would then look for the place where RepositoryContainer is added<br>
&gt;&gt; and add it to the head of the list, instead of appending it (this means<br>
&gt;&gt; that RepositoryContainer will be the last thing to be stopped, instead<br>
&gt;&gt; of the first, as it currently is).<br>
&gt;&gt;<br>
&gt;&gt; If RepositoryContainer should indeed be the first thing to be shut down,<br>
&gt;&gt; then the solution that I can see is to get the cached list of consumers,<br>
&gt;&gt; instead of getting a fresh one. This should remove the requirement of<br>
&gt;&gt; the workspace to exist during the shutdown of WSRPServiceIntegration.<br>
&gt;&gt;<br>
&gt;&gt; 1 - <a href="https://issues.jboss.org/browse/GTNPORTAL-3281" target="_blank">https://issues.jboss.org/browse/GTNPORTAL-3281</a><br>
&gt;&gt;<br>
&gt;&gt; Thanks!<br>
&gt;&gt; Juca.<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; gatein-dev mailing list<br>
&gt;&gt; <a href="mailto:gatein-dev@lists.jboss.org">gatein-dev@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/gatein-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/gatein-dev</a><br>
&gt;&gt;<br>
&gt;<br>
<br>
</div></div></blockquote></div><br></div>