[ 
http://jira.amdatu.org/jira/browse/AMDATUOPENSOCIAL-55?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bram de Kruijff reopened AMDATUOPENSOCIAL-55:
---------------------------------------------


Reopening based on Marcel's comment. 

Although the GuiceInjectorServlet's lifecycle seems bound the the  
ShindigRegistrationService lifecycle, which has required dependencies on all 
those services it injects into the GuiceInjectorServlet, you may end up with 
stale references. If I understand correctly DM may swap them on the fly without 
you restarting (@Marcel correct?).

As a small side node I noticed the following inline comment in the Activator 
which does no longer make sense.

{noformat}

        // TODO Revisit this class. As it is both ResourceProvider and JAX-RS
        // service it can not depend on it's own HttpContext. Therefore it now
        // depends on the HttpContextManagerService
{noformat}
                
> Shindig bootstrap service/composite code smells and is incomprehensible
> -----------------------------------------------------------------------
>
>                 Key: AMDATUOPENSOCIAL-55
>                 URL: http://jira.amdatu.org/jira/browse/AMDATUOPENSOCIAL-55
>             Project: Amdatu OpenSocial
>          Issue Type: Improvement
>            Reporter: Bram de Kruijff
>            Assignee: Ivo Ladage - van Doorn
>             Fix For: 0.2.0
>
>
> This is about how the OpenSocial shindig bundle bootstraps its services. Just 
> logging this because I ran into it while refactoring HttpContext and got into 
> a deadlock caused by a lock in a a callback. Took me an hour to get some 
> understanding of what is happening. My initial suggestion would be to change 
> the GuiceInjectorServiceImpl part from service to simple delegate to 
> ShindigRegistrationServiceImpl removing the need for complex orchestration 
> through service dependencies. 
> 01. Activator adds Component GuiceInjectorService|GuiceInjectorServiceImpl to 
> DepManager
> 02. DepManager starts GuiceInjectorService!GuiceInjectorServiceImpl#instance 
> (1st time on instance)
> 03. Activator adds Component 
> ResourceProvider,ShindigService|ShindigRegistrationServiceImpl to DepManager
> 04. DepManager injects GuiceInjectorService|GuiceInjectorServiceImpl#instance 
> into ShindigRegistrationServiceImpl
> 05. DepManager inits ShindigRegistrationServiceImpl (seems previsous step 
> always in time...?)
> 06. ShindigRegistrationServiceImpl.init() add Component 
> Servlet|GuiceInjectorServiceImpl#instance to DepManager
> 07. DepManager does starts Servlet|GuiceInjectorServiceImpl#instance (2nd 
> time on instance)
> 08. DepManager does callback to DispatcherService.servletAdded with 
> Servlet|GuiceInjectorServiceImpl#instance  
> 09. DispatcherService does init(ServletConfig) on 
> Servlet|GuiceInjectorServiceImpl#instance  
> 10. Servlet|GuiceInjectorServiceImpl#instance.init(ServletConfig) adds 
> Component GuiceInjectorServlet!GuiceInjectorServiceImpl#instance
> 11. DepManager starts GuiceInjectorServlet!GuiceInjectorServiceImpl#instance 
> (3rd time on instance)
> 12. DepManager injects GuiceInjectorServlet!GuiceInjectorServiceImpl#instance 
> into ResourceProvider,ShindigService|ShindigRegistrationServiceImpl
> 13. DepManager starts 
> ResourceProvider,ShindigService|ShindigRegistrationServiceImpl
> 14. ResourceProvider,ShindigService|ShindigRegistrationServiceImpl ads 
> several Components for servlets
> 15 DepManager does callback to DispatcherService.servletAdded for previsous 
> step

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
http://jira.amdatu.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        
_______________________________________________
Amdatu-developers mailing list
[email protected]
http://lists.amdatu.org/mailman/listinfo/amdatu-developers

Reply via email to