|
Hey everyone, I'm going to add some new API's into the Commons Util project. Right now these are JDK 1.5 and JSF 1.2 (like we discussed) but they can probably be ported back if we decide we need them in the future. I'm planning on checking in the API's in a couple of days but I wanted to see if anyone had any concerns with them. If I don't hear any -1's then I'll assume everything is cool. Just a side note, each of the utility method listed below are all things used by the Configurator System. Since these utilities are very handy outside of the configurator system as well, I'm proposing making them a part of the API. Configurators Configurators allow container agnostic (meaning both servlet and portlet) way of doing initialization logic and Request/Response wrapping. A configurator must implement the "Configurator" interface or extend the "AbstractConfigurator" class and must be listed in the configurator 'services' file in your jar (META-INF/services/org.apache.myfaces.common.config.Configurator). By simply adding your jar to the classpath, your configurator will be run. By default the configurator services will be disabled. Any application or Renderkit wishing to take advantage of the configurator mechanism, simply needs to register the provided FacesContextFactory and a ServletContextListener. Once enabled, configurator execution is automatic. This system also has the added advantage of eliminating excess configuration in the web.xml or the application developer's faces-config.xml file.ExternalContextUtils A utility class that has some functionality which is missing from the ExternalContext as well as the ability to distinguish the type of request and response used in the ExternalContext. This class will handles servlet request as well as both JSR-168 and JSR-286 portlet requests and will work whether the portlet objects are present or not. Thus eliminating the need to include the portlet-api.jar in application which have no dependency on a portal.ClassLoaderUtils A utility class that has some functionality for loading classes in a correct and consistant fashion in environemtns that have many different classloaders (like J2EE and Portlet environments). The cornerstone of the class, however, is the "getServices" method which can load services from your META-INF/services directory and return a list of instantiated classes for that service. This method also supports implementation of an optional interface which allows a service to influence the order in which it is listed in the map.ExternalContextWrapper A wrapper for the external context object which will make implementation of complex configurators much easier.Thanks, Scott |
