Description
Some major code clean up on the initialization of MyFaces:
- The solution for startup and shutdown FacesContext implementations (
MYFACES-2730) introduced some duplicate code on StartupFacesContextImpl and FacesContextImpl. This can be solved by providing a base implementation class (like the one in for StartupExternalContext). This will make maintaining the two FacesContext implementation very easy, because there are no duplicate methods (except for getViewRoot() on StartupFacesContextImpl). - JUnit tests are needed to verify the behavior of StartupServletContextListener and MyFacesServlet and to check if the FacesContext is available on startup and shutdown
- AbstractFacesInitializer should provide a static method to get the right FacesInitializer impl instead of having several duplicate methods in StartupServletContextListener and MyFacesServlet that do nothing but getting the right impl and invoking some method on it.
- AbstractFacesInitializer.dispatchInitDestroyEvent should use the application object from the StartupFacesContextImpl and not directly from the factory
- AbstractFacesInitializer.getLifecycleId() is unused because of
MYFACES-2730 - initStartupFacesContext() and initShutdownFacesContext() should set the field startup correctly (true or false) and should not create the UIViewRoot directly (it should be created in StartupFacesContextImpl at first access)
- minor javadoc copy and paste error on FacesInitializer