Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-2998

FacesConfig ordering must not be an SPI task

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.0.2
    • None
    • SPI
    • None

    Description

      Currently the FacesConfigurationProvider provides the following methods to get the FacesConfig data from different sources:

      • getStandardFacesConfig()
      • getMetaInfServicesFacesConfig()
      • getAnnotationsFacesConfig()
      • getClassloaderFacesConfig()
      • getContextSpecifiedFacesConfig()
      • getWebAppFacesConfig()

      Unfortunately it also provides a method that should combine all these data: getFacesConfigData(). This method is here due to refactorings, but IMHO this is the last place where it should be put, because it gets "its own implementation" via its Factory and then calls all of the above methods on it. I know this was introduced to support wrapping the default impl, but it really is very, very ugly.

      Because of the fact that the faces-config merging (and ordering) is a very complex task and there is only one "right" way to do it (per JSF 2.0 spec), this must not be done by a custom SPI implementation. This code should be provided by MyFaces only.

      Thus IMO the right way to solve this problem is to move all merging and ordering code into its own, MyFaces-specific class. This class (and not the SPI) should provide the getFacesConfigData() method. This means that in FacesConfigurator.configure() we should first get the FacesConfigurationProvider SPI impl and then pass it to FacesConfigMerger.getFacesConfigData().

      NOTE that with this approach custom FacesConfigurationProvider impls (like in Geronimo) do not have to deal with this complex merging and ordering stuff and their life is a lot easier!

      Attachments

        1. MYFACES-2998.patch
          88 kB
          Jakob Korherr

        Issue Links

          Activity

            People

              jakobkorherr Jakob Korherr
              jakobkorherr Jakob Korherr
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: