Uploaded image for project: 'PUBLIC - Liferay Faces'
  1. PUBLIC - Liferay Faces
  2. FACES-2536

Add javax.portlet.faces.BridgeFactoryFinder to the Bridge API

    Details

      Description

      This task includes adding a new javax.portlet.faces.BridgeFactoryFinder class modeled after the javax.faces.FactoryFinder feature in the JSF API. However, unlike the JSF FactoryFinder, the BridgeFactoryFinder should take advantage of Java SE 5 Generics and should be able to find any factory defined with the bridge: namespace in the <factory-extension> section of a faces-config.xml descriptor. For example:

      <faces-config version="2.2" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      	xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
      	xmlns:bridge="http://xmlns.jcp.org/xml/ns/bridge-5.0-extension">
      
      	<factory>
      		<factory-extension>
      			<bridge:bridge-context-factory>com.liferay.faces.bridge.context.internal.BridgeContextFactoryImpl</bridge:bridge-context-factory>
      		</factory-extension>
      	</factory>
      </faces-config>
      

      Here is the proposed API:

      public abstract class BridgeFactoryFinder {
      
      	public static Object getFactory(PortletContext portletContext, Class<?> clazz) {
      		return getInstance().getFactoryInstance(portletContext, clazz);
      	}
      }
      

      Example Usage:

      BridgeContextFactory bridgeContextFactory = (BridgeContextFactory) BridgeFactoryFinder.getFactory(portletContext, BridgeContext.class);
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Packages

                Version Package
                facesbridge-api-5.0.0
                facesbridge-spec-5.0.0