<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"><<a href="mailto:jcosta@redhat.com" target="_blank">jcosta@redhat.com</a>></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'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't allows me to properly shut down WSRP, it at least let me have<br>
the same behaviour as today.<br>
<br>
But it's still a bit confusing to me as to why the RepositoryContainer<br>
is added to the bottom of the "start" list.<br>
<br>
For clarity, I'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 "stop" list being the reverse of the "start", but note that<br>
there's an extra RepositoryContainer there on the "stop" list, right at<br>
the top, meaning that it's the first one of the list to be stopped.<br>
<br>
Adding RepositoryService to the constructor didn'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 "stop" list (as it'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>
> Hi,<br>
><br>
> RepositoryContainer and Workspace containers are created, initialized and<br>
> started by the RepositoryService. Try to add explicitly the<br>
> RepositoryService in your constructor, this way your component should be<br>
> started after the RepositoryService (and the RepositoryContainer) and will<br>
> be stopped before the RepositoryService. Another solution would be to check<br>
> the state of the repository first using<br>
> RepositoryService.getCurrentRepository().getState() (warning it is not a<br>
> static call, the goal is only to show you the methods to call), you need to<br>
> make that the value is ManageableRepository.ONLINE<br>
><br>
> BR,<br>
> Nicolas<br>
><br>
><br>
> On Fri, Nov 8, 2013 at 12:22 PM, Juraci Paixão Kröhling<br>
> <<a href="mailto:jcosta@redhat.com">jcosta@redhat.com</a>>wrote:<br>
><br>
>> All,<br>
>><br>
>> I'm currently working on GTNPORTAL-3281 [1], and I have a question.<br>
>><br>
>> The WARN message on the logs occurs during the shutdown of the server,<br>
>> when the method WSRPServiceIntegration.stop() is called. During this<br>
>> stop() method, both producer and consumers are then requested to be<br>
>> stopped, but the configuration for the producer and the list of<br>
>> consumers requires access to the workspace, which is already shut down,<br>
>> as RepositoryContainer is stopped before WSRPServiceIntegration.<br>
>><br>
>> While stopping the producer is possible without requesting the workspace<br>
>> to be active, shutting down the consumers currently require a fresh list<br>
>> of consumers, which in turn requires access to the workspace.<br>
>><br>
>> When looking into why WSRPServiceIntegration is stopped after<br>
>> RepositoryContainer, I noticed that the list of services to start during<br>
>> the boot contains 36 items, while the shutdown contains 37. The<br>
>> difference is exactly the RepositoryContainer.<br>
>><br>
>> So, does anyone knows if it is appropriate for RepositoryContainer to be<br>
>> stopped before everything else, including WSRPServiceIntegration? If<br>
>> not, I would then look for the place where RepositoryContainer is added<br>
>> and add it to the head of the list, instead of appending it (this means<br>
>> that RepositoryContainer will be the last thing to be stopped, instead<br>
>> of the first, as it currently is).<br>
>><br>
>> If RepositoryContainer should indeed be the first thing to be shut down,<br>
>> then the solution that I can see is to get the cached list of consumers,<br>
>> instead of getting a fresh one. This should remove the requirement of<br>
>> the workspace to exist during the shutdown of WSRPServiceIntegration.<br>
>><br>
>> 1 - <a href="https://issues.jboss.org/browse/GTNPORTAL-3281" target="_blank">https://issues.jboss.org/browse/GTNPORTAL-3281</a><br>
>><br>
>> Thanks!<br>
>> Juca.<br>
>> _______________________________________________<br>
>> gatein-dev mailing list<br>
>> <a href="mailto:gatein-dev@lists.jboss.org">gatein-dev@lists.jboss.org</a><br>
>> <a href="https://lists.jboss.org/mailman/listinfo/gatein-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/gatein-dev</a><br>
>><br>
><br>
<br>
</div></div></blockquote></div><br></div>