Shindig bootstrap service/composite code smells and is incomprehensible
-----------------------------------------------------------------------
Key: AMDATU-336
URL: http://jira.amdatu.org/jira/browse/AMDATU-336
Project: Amdatu
Issue Type: Improvement
Components: Amdatu OpenSocial
Reporter: Bram de Kruijff
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.
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