[jboss-cvs] JBossAS SVN: r104537 - in projects/jboss-jsf-int/trunk: cargo and 26 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu May 6 15:42:36 EDT 2010


Author: stan.silvert at jboss.com
Date: 2010-05-06 15:42:35 -0400 (Thu, 06 May 2010)
New Revision: 104537

Added:
   projects/jboss-jsf-int/trunk/jboss-faces/
   projects/jboss-jsf-int/trunk/jboss-faces/pom.xml
   projects/jboss-jsf-int/trunk/jboss-faces/src/
   projects/jboss-jsf-int/trunk/jboss-faces/src/main/
   projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/
   projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/
   projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/
   projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/
   projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/jsf/
   projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/jsf/integration/
   projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/jsf/integration/config/
   projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/jsf/integration/config/JBossJSFConfigureListener.java
   projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/jsf/integration/injection/
   projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/jsf/integration/injection/JBossDelegatingInjectionProvider.java
   projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/jsf/integration/injection/JBossInjectionProvider.java
   projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/jsf/integration/injection/JBossScanningInjectionProvider.java
   projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/jsf/integration/serialization/
   projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/jsf/integration/serialization/JBossFacesObjectInputStream.java
   projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/jsf/integration/serialization/JBossSerializationProvider.java
   projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/validation/
   projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/validation/ValidatorFactoryVDFConnector.java
   projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/deployer/
   projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/deployer/JSFImplManagementDeployer.java
   projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/deployer/JSFImplMetaData.java
   projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/deployer/JSFSharedWebMetaDataDeployer.java
   projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/deployer/JSFTldMetaDataDeployer.java
   projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/deployer/JSFUrlIntegrationDeployer.java
   projects/jboss-jsf-int/trunk/jsf-deployer/src/main/resources/
   projects/jboss-jsf-int/trunk/jsf-deployer/src/main/resources/META-INF/
   projects/jboss-jsf-int/trunk/jsf-deployer/src/main/resources/META-INF/jsf-integration-deployer-jboss-beans.xml
   projects/jboss-jsf-int/trunk/jsf-deployer/src/main/resources/Mojarra-1.2/
   projects/jboss-jsf-int/trunk/jsf-deployer/src/main/resources/Mojarra-1.2/META-INF/
   projects/jboss-jsf-int/trunk/jsf-deployer/src/main/resources/Mojarra-1.2/META-INF/web.xml
   projects/jboss-jsf-int/trunk/jsf-deployer/src/main/resources/Mojarra-2.0/
   projects/jboss-jsf-int/trunk/jsf-deployer/src/main/resources/Mojarra-2.0/META-INF/
   projects/jboss-jsf-int/trunk/jsf-deployer/src/main/resources/Mojarra-2.0/META-INF/web.xml
Removed:
   projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/JSFDeployer.java
   projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/config/
   projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/injection/
   projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/serialization/
Modified:
   projects/jboss-jsf-int/trunk/cargo/ASModifications/deploy/jbossweb.sar/META-INF/jboss-structure.xml
   projects/jboss-jsf-int/trunk/cargo/ASModifications/deployers/jsf.deployer/META-INF/jsf-integration-deployer-jboss-beans.xml
   projects/jboss-jsf-int/trunk/cargo/pom.xml
   projects/jboss-jsf-int/trunk/jsf-deployer/pom.xml
   projects/jboss-jsf-int/trunk/pom.xml
Log:
JBAS-6638 Move JSF integration into a deployer


Modified: projects/jboss-jsf-int/trunk/cargo/ASModifications/deploy/jbossweb.sar/META-INF/jboss-structure.xml
===================================================================
--- projects/jboss-jsf-int/trunk/cargo/ASModifications/deploy/jbossweb.sar/META-INF/jboss-structure.xml	2010-05-06 19:16:37 UTC (rev 104536)
+++ projects/jboss-jsf-int/trunk/cargo/ASModifications/deploy/jbossweb.sar/META-INF/jboss-structure.xml	2010-05-06 19:42:35 UTC (rev 104537)
@@ -8,7 +8,6 @@
         <classpath>
             <path name=""/>
             <path name="" suffixes=".jar" />
-       <!--     <path name="jsf-libs" suffixes=".jar" />  -->
         </classpath>
     </context>
 </structure>

Modified: projects/jboss-jsf-int/trunk/cargo/ASModifications/deployers/jsf.deployer/META-INF/jsf-integration-deployer-jboss-beans.xml
===================================================================
--- projects/jboss-jsf-int/trunk/cargo/ASModifications/deployers/jsf.deployer/META-INF/jsf-integration-deployer-jboss-beans.xml	2010-05-06 19:16:37 UTC (rev 104536)
+++ projects/jboss-jsf-int/trunk/cargo/ASModifications/deployers/jsf.deployer/META-INF/jsf-integration-deployer-jboss-beans.xml	2010-05-06 19:42:35 UTC (rev 104537)
@@ -21,7 +21,7 @@
       * Specify the name of the default JSF profile.
     -->
     <property name="defaultJSFImplementation">
-       <value>Mojarra-1.2</value>
+       <value>Mojarra-2.0</value>
     </property>
     
     <!-- 

Modified: projects/jboss-jsf-int/trunk/cargo/pom.xml
===================================================================
--- projects/jboss-jsf-int/trunk/cargo/pom.xml	2010-05-06 19:16:37 UTC (rev 104536)
+++ projects/jboss-jsf-int/trunk/cargo/pom.xml	2010-05-06 19:42:35 UTC (rev 104537)
@@ -171,7 +171,7 @@
                 </deployables>
               </configuration>
               <container>
-                <containerId>jboss5x</containerId>
+                <containerId>jboss51x</containerId>
                 <timeout>150000</timeout>  <!-- 2.5 minutes -->
                 <home>${JBOSS_HOME}</home>
                 <log>${basedir}/target/jboss5.x/cargo.log</log>

Added: projects/jboss-jsf-int/trunk/jboss-faces/pom.xml
===================================================================
--- projects/jboss-jsf-int/trunk/jboss-faces/pom.xml	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/jboss-faces/pom.xml	2010-05-06 19:42:35 UTC (rev 104537)
@@ -0,0 +1,74 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+   <modelVersion>4.0.0</modelVersion>
+   <parent>
+      <groupId>org.jboss.jsf.integration</groupId>
+      <artifactId>jboss-jsf-int</artifactId>
+      <version>1.0.0-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>jboss-faces</artifactId>
+   <packaging>jar</packaging>
+   <name>JSF Integration for JBoss AS</name>
+   <description>JSF Integration for JBoss AS</description>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.jboss.deployers</groupId>
+         <artifactId>jboss-deployers-vfs</artifactId>
+         <scope>provided</scope>
+      </dependency>
+
+      <dependency>
+         <groupId>org.jboss</groupId>
+         <artifactId>jboss-vfs</artifactId>
+         <scope>provided</scope>
+      </dependency>
+
+      <dependency>
+         <groupId>org.jboss.metadata</groupId>
+         <artifactId>jboss-metadata</artifactId>
+         <scope>provided</scope>
+      </dependency>
+
+      <dependency>
+         <groupId>javax.validation</groupId>
+         <artifactId>validation-api</artifactId>
+         <scope>provided</scope>
+      </dependency>
+
+      <dependency>
+         <groupId>javax.faces</groupId>
+         <artifactId>jsf-api</artifactId>
+         <scope>provided</scope>
+      </dependency>
+
+      <dependency>
+         <groupId>javax.faces</groupId>
+         <artifactId>jsf-impl</artifactId>
+         <scope>provided</scope>
+      </dependency>
+
+      <dependency>
+         <groupId>javax.servlet</groupId>
+         <artifactId>servlet-api</artifactId>
+         <scope>provided</scope>
+      </dependency>
+
+      <dependency>
+         <groupId>apache-log4j</groupId>
+         <artifactId>log4j</artifactId>
+         <scope>provided</scope>
+      </dependency>
+
+      <dependency>
+         <groupId>org.jboss.jbossas</groupId>
+         <artifactId>jboss-as-tomcat</artifactId>
+         <scope>provided</scope>
+      </dependency>      
+   </dependencies>
+
+   <build>
+      <finalName>${artifactId}</finalName>
+   </build>
+
+</project>

Added: projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/jsf/integration/config/JBossJSFConfigureListener.java
===================================================================
--- projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/jsf/integration/config/JBossJSFConfigureListener.java	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/jsf/integration/config/JBossJSFConfigureListener.java	2010-05-06 19:42:35 UTC (rev 104537)
@@ -0,0 +1,143 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.web.jsf.integration.config;
+
+import com.sun.faces.config.ConfigurationException;
+import com.sun.faces.config.ConfigureListener;
+import javax.faces.validator.BeanValidator;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletContextEvent;
+import javax.validation.Validation;
+import javax.validation.ValidatorFactory;
+import org.jboss.logging.Logger;
+import org.jboss.mc.servlet.vdf.spi.VDFConnector;
+import org.jboss.web.validation.ValidatorFactoryVDFConnector;
+
+
+/**
+ * This ServletContextListener sets up a JBoss-specific environment for JSF
+ * and then delegates the rest of the setup to the JSF RI.
+ *
+ * @author Stan Silvert
+ * @author Ales Justin
+ */
+public class JBossJSFConfigureListener extends ConfigureListener 
+{
+    private static final String WAR_BUNDLES_JSF_IMPL = "org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL";
+   
+    private static Logger LOG = Logger.getLogger(JBossJSFConfigureListener.class);
+    
+    private ServletContext servletContext;
+    
+    private boolean initialized = false;
+    
+    public static boolean warBundlesJSFImpl(ServletContext servletContext)
+    {
+       String bundledJSFImpl = servletContext.getInitParameter(WAR_BUNDLES_JSF_IMPL);
+       return (bundledJSFImpl != null) && bundledJSFImpl.equalsIgnoreCase("true");
+    }
+
+    @Override
+    public void contextInitialized(ServletContextEvent event) 
+    {
+        this.servletContext = event.getServletContext();
+        if (warBundlesJSFImpl(this.servletContext)) return;
+  
+        checkForMyFaces();
+        initializeJspRuntime();
+        initialized = true;
+        addBeanValidatorFactory();
+        
+        try
+        {
+           super.contextInitialized(event);
+        }
+        catch (ConfigurationException e)
+        {
+           // HACK! HACK! HACK! This will be cleaned up with JSFDeployer.
+           if ("no web.xml present".equals(e.getMessage())) return;
+           throw e;
+        }
+    }
+    
+    @Override
+    public void contextDestroyed(ServletContextEvent event) 
+    {
+        if (initialized)
+        {
+           initialized = false;
+           super.contextDestroyed(event);
+        }
+    }
+    
+    // This method accounts for a peculiar problem with Jasper that pops up from time
+    // to time.  In some cases, if the JspRuntimeContext is not loaded then the JspFactory
+    // will not be initialized for JSF.  This method assures that it will always be
+    // be loaded before JSF is initialized.
+    private static void initializeJspRuntime() 
+    {
+
+        try 
+        {
+            Class.forName("org.apache.jasper.compiler.JspRuntimeContext");
+        }  
+        catch (ClassNotFoundException cnfe) 
+        {
+            // do nothing 
+        }
+    }
+
+    private void checkForMyFaces()
+    {
+        try
+        {
+            Thread.currentThread()
+                  .getContextClassLoader()
+                  .loadClass("org.apache.myfaces.webapp.StartupServletContextListener");
+            LOG.warn("MyFaces JSF implementation found!  This version of JBoss AS ships with the java.net implementation of JSF.  There are known issues when mixing JSF implementations.  This warning does not apply to MyFaces component libraries such as Tomahawk.  However, myfaces-impl.jar and myfaces-api.jar should not be used without disabling the built-in JSF implementation.  See the JBoss wiki for more details.");
+        }
+        catch (ClassNotFoundException e)
+        {
+            // ignore - this is a good thing
+        }
+    }
+    
+    protected void addBeanValidatorFactory()
+    {
+       VDFConnector<ValidatorFactory> vfc = new ValidatorFactoryVDFConnector(servletContext);
+
+       ValidatorFactory factory;
+       if (vfc.isValid())
+       {
+          factory = vfc.getUtility();
+       }
+       else
+       {
+          LOG.warn("No such ValidatorFactory in VDF layer, creating new instance.");
+          factory = Validation.buildDefaultValidatorFactory();
+       }
+
+       this.servletContext.setAttribute(BeanValidator.VALIDATOR_FACTORY_KEY, factory);
+    }
+
+
+}

Added: projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/jsf/integration/injection/JBossDelegatingInjectionProvider.java
===================================================================
--- projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/jsf/integration/injection/JBossDelegatingInjectionProvider.java	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/jsf/integration/injection/JBossDelegatingInjectionProvider.java	2010-05-06 19:42:35 UTC (rev 104537)
@@ -0,0 +1,116 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.web.jsf.integration.injection;
+
+import javax.faces.context.FacesContext;
+import javax.servlet.ServletContext;
+
+import org.apache.tomcat.InstanceManager;
+import org.jboss.logging.Logger;
+import org.jboss.web.tomcat.service.TomcatInjectionContainer;
+
+import com.sun.faces.spi.InjectionProvider;
+import com.sun.faces.spi.InjectionProviderException;
+
+/**
+ * A JSF injection provider. This class delegates the injection to the <code>TomcatInjectionContainer</code>.
+ * The processing of this injectionProvider is based on the <code>JBossWebMetaData</code>
+ * 
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision: 93046 $
+ */
+public class JBossDelegatingInjectionProvider implements InjectionProvider
+{
+   /** The injection container. */
+   protected TomcatInjectionContainer injectionContainer = null;
+   
+   /** The logger. */
+   private static final Logger log = Logger.getLogger(InjectionProvider.class);
+   
+   public JBossDelegatingInjectionProvider()
+   {
+      Object context = FacesContext.getCurrentInstance().getExternalContext().getContext();
+      // In case of a servletContext - could maybe also be a PortletContext !?
+      if(context instanceof ServletContext && context != null)
+      {
+         ServletContext servletContext = (ServletContext) (context);
+         this.injectionContainer = (TomcatInjectionContainer) servletContext
+                     .getAttribute(InstanceManager.class.getName());
+         
+      }
+      if(injectionContainer == null)
+         log.debug("JSF injection not available for this web deployment.");
+   }
+   
+   protected JBossDelegatingInjectionProvider(TomcatInjectionContainer injectionContainer)
+   {
+      this.injectionContainer = injectionContainer;
+      
+      if(injectionContainer == null)
+         log.debug("JSF injection not available for this web deployment.");      
+   }
+   
+   public void inject(Object object) throws InjectionProviderException
+   {
+      if(! checkInjectionContainer()) return;
+      try
+      {
+         injectionContainer.processInjectors(object);
+      }
+      catch(Throwable t)
+      {
+         throw new InjectionProviderException("unable to process injections.", t);
+      }
+   }
+
+   public void invokePostConstruct(Object object) throws InjectionProviderException
+   {
+      if(! checkInjectionContainer()) return;
+      try
+      {
+         injectionContainer.postConstruct(object);
+      }
+      catch(Throwable t)
+      {
+         throw new InjectionProviderException("unable to process invokePostConstruct.", t);
+      }
+   }
+
+   public void invokePreDestroy(Object object) throws InjectionProviderException
+   {
+      if(! checkInjectionContainer()) return;
+      try
+      {
+         injectionContainer.preDestroy(object);
+      }
+      catch(Throwable t)
+      {
+         throw new InjectionProviderException("unable to process invokePreDestroy.", t);
+      }
+   }
+
+   private boolean checkInjectionContainer()
+   {
+      return injectionContainer != null;
+   }
+}
+

Added: projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/jsf/integration/injection/JBossInjectionProvider.java
===================================================================
--- projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/jsf/integration/injection/JBossInjectionProvider.java	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/jsf/integration/injection/JBossInjectionProvider.java	2010-05-06 19:42:35 UTC (rev 104537)
@@ -0,0 +1,280 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.web.jsf.integration.injection;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.annotation.Resource;
+import javax.ejb.EJB;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceUnit;
+import javax.xml.ws.WebServiceRef;
+
+import org.jboss.logging.Logger;
+
+import com.sun.faces.spi.InjectionProvider;
+import com.sun.faces.spi.InjectionProviderException;
+
+/**
+ * Provides interface between JSF RI and Tomcat Catalina for injection of managed beans as
+ * per JSF 1.2 Spec section 5.4.
+ *
+ * @author Stan Silvert
+ * @author Fabien Carrion
+ * @author Remy Maucherat
+ */
+public class JBossInjectionProvider implements InjectionProvider {
+    private static final Logger LOG = Logger.getLogger(JBossInjectionProvider.class);
+    private static final String NAMING_DISABLED = "Injection of naming resources into JSF managed beans disabled.";
+
+    private Context namingContext;
+    
+    /**
+     * Uses the default naming context for injection of resources into managed beans.
+     */
+    public JBossInjectionProvider() {
+        try {
+            this.namingContext = new InitialContext();
+        } catch (Exception e) {
+            LOG.warn(NAMING_DISABLED, e);
+        }
+    }
+    
+    /**
+     * This constructor allows a subclass to override the default naming 
+     * context.
+     *
+     * @param namingContext The naming context to use for injection of managed beans.
+     *                      If this param is null then injection of resources will be
+     *                      disabled and JBoss will only call @PostConstruct and
+     *                      @PreDestroy methods.
+     */
+    protected JBossInjectionProvider(Context namingContext) {
+        if (namingContext == null) {
+            LOG.warn(NAMING_DISABLED);
+        }
+        
+        this.namingContext = namingContext;
+    }
+    
+    /**
+     * Call methods on a managed bean that are annotated with @PreDestroy.
+     */
+    public void invokePreDestroy(Object managedBean) throws InjectionProviderException {
+        try {
+            Method[] methods = managedBean.getClass().getDeclaredMethods();
+            Method preDestroy = null;
+            for (int i = 0; i < methods.length; i++) {
+                if (methods[i].isAnnotationPresent(PreDestroy.class)) {
+                    if ((preDestroy != null) 
+                            || (methods[i].getParameterTypes().length != 0)
+                            || (Modifier.isStatic(methods[i].getModifiers())) 
+                            || (methods[i].getExceptionTypes().length > 0)
+                            || (!methods[i].getReturnType().getName().equals("void"))) {
+                        throw new IllegalArgumentException("Invalid PreDestroy annotation");
+                    }
+                    preDestroy = methods[i];
+                }
+            }
+
+            // At the end the postconstruct annotated 
+            // method is invoked
+            if (preDestroy != null) {
+                boolean accessibility = preDestroy.isAccessible();
+                preDestroy.setAccessible(true);
+                preDestroy.invoke(managedBean);
+                preDestroy.setAccessible(accessibility);
+            }
+        } catch (Exception e) {
+            LOG.error("PreDestroy failed on managed bean.", e);
+        }
+    }
+
+    /**
+     * Call methods on a managed bean that are annotated with @PostConstruct.
+     */
+    public void invokePostConstruct(Object managedBean) throws InjectionProviderException {
+        try {
+            Method[] methods = managedBean.getClass().getDeclaredMethods();
+            Method postConstruct = null;
+            for (int i = 0; i < methods.length; i++) {
+                if (methods[i].isAnnotationPresent(PostConstruct.class)) {
+                    if ((postConstruct != null) 
+                            || (methods[i].getParameterTypes().length != 0)
+                            || (Modifier.isStatic(methods[i].getModifiers())) 
+                            || (methods[i].getExceptionTypes().length > 0)
+                            || (!methods[i].getReturnType().getName().equals("void"))) {
+                        throw new IllegalArgumentException("Invalid PostConstruct annotation");
+                    }
+                    postConstruct = methods[i];
+                }
+            }
+
+            // At the end the postconstruct annotated 
+            // method is invoked
+            if (postConstruct != null) {
+                boolean accessibility = postConstruct.isAccessible();
+                postConstruct.setAccessible(true);
+                postConstruct.invoke(managedBean);
+                postConstruct.setAccessible(accessibility);
+            }
+        } catch (Exception e) {
+            LOG.error("PostConstruct failed on managed bean.", e);
+        }
+    }
+
+    /**
+     * Inject naming resources into a managed bean and then call methods
+     * annotated with @PostConstruct.
+     */
+    public void inject(Object managedBean) throws InjectionProviderException {
+        if (this.namingContext != null) {
+            try {
+                
+                // Initialize fields annotations
+                Field[] fields = managedBean.getClass().getDeclaredFields();
+                for (int i = 0; i < fields.length; i++) {
+                    if (fields[i].isAnnotationPresent(Resource.class)) {
+                        Resource annotation = (Resource) fields[i].getAnnotation(Resource.class);
+                        lookupFieldResource(namingContext, managedBean, fields[i], annotation.name());
+                    }
+                    if (fields[i].isAnnotationPresent(EJB.class)) {
+                        EJB annotation = (EJB) fields[i].getAnnotation(EJB.class);
+                        lookupFieldResource(namingContext, managedBean, fields[i], annotation.name());
+                    }
+                    if (fields[i].isAnnotationPresent(WebServiceRef.class)) {
+                        WebServiceRef annotation = 
+                            (WebServiceRef) fields[i].getAnnotation(WebServiceRef.class);
+                        lookupFieldResource(namingContext, managedBean, fields[i], annotation.name());
+                    }
+                    if (fields[i].isAnnotationPresent(PersistenceContext.class)) {
+                        PersistenceContext annotation = 
+                            (PersistenceContext) fields[i].getAnnotation(PersistenceContext.class);
+                        lookupFieldResource(namingContext, managedBean, fields[i], annotation.name());
+                    }
+                    if (fields[i].isAnnotationPresent(PersistenceUnit.class)) {
+                        PersistenceUnit annotation = 
+                            (PersistenceUnit) fields[i].getAnnotation(PersistenceUnit.class);
+                        lookupFieldResource(namingContext, managedBean, fields[i], annotation.name());
+                    }
+                }
+                
+                // Initialize methods annotations
+                Method[] methods = managedBean.getClass().getDeclaredMethods();
+                for (int i = 0; i < methods.length; i++) {
+                    if (methods[i].isAnnotationPresent(Resource.class)) {
+                        Resource annotation = (Resource) methods[i].getAnnotation(Resource.class);
+                        lookupMethodResource(namingContext, managedBean, methods[i], annotation.name());
+                    }
+                    if (methods[i].isAnnotationPresent(EJB.class)) {
+                        EJB annotation = (EJB) methods[i].getAnnotation(EJB.class);
+                        lookupMethodResource(namingContext, managedBean, methods[i], annotation.name());
+                    }
+                    if (methods[i].isAnnotationPresent(WebServiceRef.class)) {
+                        WebServiceRef annotation = 
+                            (WebServiceRef) methods[i].getAnnotation(WebServiceRef.class);
+                        lookupMethodResource(namingContext, managedBean, methods[i], annotation.name());
+                    }
+                    if (methods[i].isAnnotationPresent(PersistenceContext.class)) {
+                        PersistenceContext annotation = 
+                            (PersistenceContext) methods[i].getAnnotation(PersistenceContext.class);
+                        lookupMethodResource(namingContext, managedBean, methods[i], annotation.name());
+                    }
+                    if (methods[i].isAnnotationPresent(PersistenceUnit.class)) {
+                        PersistenceUnit annotation = 
+                            (PersistenceUnit) methods[i].getAnnotation(PersistenceUnit.class);
+                        lookupMethodResource(namingContext, managedBean, methods[i], annotation.name());
+                    }
+                }
+                
+            } catch (Exception e) {
+                LOG.error("Injection failed on managed bean.", e);
+            }
+        }
+        
+    }
+
+    /**
+     * Inject resources in specified field.
+     */
+    protected static void lookupFieldResource(javax.naming.Context context, 
+            Object instance, Field field, String name)
+        throws NamingException, IllegalAccessException {
+    
+        Object lookedupResource = null;
+        boolean accessibility = false;
+        
+        if ((name != null) &&
+                (name.length() > 0)) {
+            lookedupResource = context.lookup(name);
+        } else {
+            lookedupResource = context.lookup(instance.getClass().getName() + "/" + field.getName());
+        }
+        
+        accessibility = field.isAccessible();
+        field.setAccessible(true);
+        field.set(instance, lookedupResource);
+        field.setAccessible(accessibility);
+    }
+
+
+    /**
+     * Inject resources in specified method.
+     */
+    protected static void lookupMethodResource(javax.naming.Context context, 
+            Object instance, Method method, String name)
+        throws NamingException, IllegalAccessException, InvocationTargetException {
+        
+        if (!method.getName().startsWith("set") 
+                || method.getParameterTypes().length != 1
+                || !method.getReturnType().getName().equals("void")) {
+            throw new IllegalArgumentException("Invalid method resource injection annotation");
+        }
+        
+        Object lookedupResource = null;
+        boolean accessibility = false;
+        
+        if ((name != null) &&
+                (name.length() > 0)) {
+            lookedupResource = context.lookup(name);
+        } else {
+            lookedupResource = 
+                context.lookup(instance.getClass().getName() + "/" + method.getName().substring(3));
+        }
+        
+        accessibility = method.isAccessible();
+        method.setAccessible(true);
+        method.invoke(instance, lookedupResource);
+        method.setAccessible(accessibility);
+    }
+    
+}

Added: projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/jsf/integration/injection/JBossScanningInjectionProvider.java
===================================================================
--- projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/jsf/integration/injection/JBossScanningInjectionProvider.java	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/jsf/integration/injection/JBossScanningInjectionProvider.java	2010-05-06 19:42:35 UTC (rev 104537)
@@ -0,0 +1,183 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.web.jsf.integration.injection;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.faces.context.FacesContext;
+import javax.servlet.ServletContext;
+
+import org.apache.tomcat.InstanceManager;
+import org.jboss.logging.Logger;
+import org.jboss.web.tomcat.service.TomcatInjectionContainer;
+
+import com.sun.faces.spi.InjectionProvider;
+import com.sun.faces.spi.InjectionProviderException;
+
+/**
+ * A JSF injection provider.
+ * The dynamic processing of annotations and injections is handled by the
+ * <code>TomcatInjectionContainer</code>.
+ * 
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision: 93046 $
+ */
+public class JBossScanningInjectionProvider implements InjectionProvider
+{
+
+   /** The injection container. */
+   protected TomcatInjectionContainer injectionContainer = null;
+
+   /** The logger. */
+   private static final Logger log = Logger.getLogger(InjectionProvider.class);
+
+   public JBossScanningInjectionProvider()
+   {
+      Object context = FacesContext.getCurrentInstance().getExternalContext().getContext();
+      // In case of a servletContext - could maybe also be a PortletContext !?
+      if (context != null && context instanceof ServletContext)
+      {
+         ServletContext servletContext = (ServletContext) (context);
+         this.injectionContainer = (TomcatInjectionContainer) servletContext
+                     .getAttribute(InstanceManager.class.getName());
+      }
+      if (injectionContainer == null)
+         log.debug("JSF injection not available for this web deployment.");
+   }
+   
+   protected JBossScanningInjectionProvider(TomcatInjectionContainer injectionContainer)
+   {
+      this.injectionContainer = injectionContainer;
+      
+      if(injectionContainer == null)
+         log.debug("JSF injection not available for this web deployment.");      
+   }
+
+   /**
+    * Invoke a postConstruct method annotated with @PostConstruct
+    * 
+    * @param managedBean the managed bean
+    * @throws InjectionProviderException
+    */
+   public void invokePostConstruct(Object managedBean) throws InjectionProviderException
+   {
+      try
+      {
+         Method postConstruct = getLifeCycleMethod(managedBean, PostConstruct.class);
+
+         if (postConstruct != null)
+         {
+            boolean accessibility = postConstruct.isAccessible();
+            postConstruct.setAccessible(true);
+            postConstruct.invoke(managedBean);
+            postConstruct.setAccessible(accessibility);
+         }
+      }
+      catch (Exception e)
+      {
+         throw new InjectionProviderException("PostConstruct failed on managed bean.", e);
+      }
+   }
+   
+   /**
+    * Invoke a preDestroy method annotated with @PreDestroy
+    * 
+    * @param managedBean the managed bean
+    * @throws InjectionProviderException
+    */
+   public void invokePreDestroy(Object managedBean) throws InjectionProviderException
+   {
+      try
+      {
+         Method preDestroy = getLifeCycleMethod(managedBean, PreDestroy.class);
+
+         if (preDestroy != null)
+         {
+            boolean accessibility = preDestroy.isAccessible();
+            preDestroy.setAccessible(true);
+            preDestroy.invoke(managedBean);
+            preDestroy.setAccessible(accessibility);
+         }
+      }
+      catch (Exception e)
+      {
+         throw new InjectionProviderException("PreDestroy failed on managed bean.", e);
+      }
+   }
+   
+   /**
+    * Process annotations and injection for a managedBean.
+    * This delegates the processing of annotations and injection
+    * to the <code>TomcatInjectionContainer</code>.
+    * 
+    * @param managedBean the managed bean
+    * @throws InjectionProviderException
+    */
+   public void inject(Object managedBean) throws InjectionProviderException
+   {
+      if(! checkInjectionContainer()) return;
+      try
+      {
+         // Process annotations
+         injectionContainer.processAnnotations(managedBean);
+         
+         // Process injectors
+         injectionContainer.processInjectors(managedBean);
+         
+      }
+      catch(Exception e)
+      {
+         throw new InjectionProviderException("Injection failed on managed bean.", e);
+      }
+   }
+
+   private Method getLifeCycleMethod(Object managedBean, Class<? extends Annotation> annotation)
+   {
+      Method[] methods = managedBean.getClass().getDeclaredMethods();
+      Method lifeCycleMethod = null;
+      for (int i = 0; i < methods.length; i++)
+      {
+         if (methods[i].isAnnotationPresent(annotation))
+         {
+            if ((lifeCycleMethod != null) || (methods[i].getParameterTypes().length != 0)
+                  || (Modifier.isStatic(methods[i].getModifiers())) || (methods[i].getExceptionTypes().length > 0)
+                  || (!methods[i].getReturnType().getName().equals("void")))
+            {
+               throw new IllegalArgumentException("Invalid PostConstruct method.");
+            }
+            lifeCycleMethod = methods[i];
+         }
+      }
+
+      return lifeCycleMethod;
+   }
+   
+   private boolean checkInjectionContainer()
+   {
+      return injectionContainer != null;
+   }
+
+}

Added: projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/jsf/integration/serialization/JBossFacesObjectInputStream.java
===================================================================
--- projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/jsf/integration/serialization/JBossFacesObjectInputStream.java	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/jsf/integration/serialization/JBossFacesObjectInputStream.java	2010-05-06 19:42:35 UTC (rev 104537)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.web.jsf.integration.serialization;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectStreamClass;
+import org.jboss.serial.io.JBossObjectInputStream;
+
+/**
+ * Provides override of resolveClass() as required by the JSF spi.  See javadoc
+ * of com.sun.faces.spi.SerializationProvider.createObjectInputStream for details.
+ *
+ * @author Stan Silvert
+ */
+public class JBossFacesObjectInputStream extends JBossObjectInputStream 
+{
+    /**
+     * Create new JBossFacesObjectInputStream.
+     */
+    public JBossFacesObjectInputStream(InputStream source) throws IOException
+    {
+        super(source);
+    }
+    
+    /**
+     * Make sure this resolves to a class from the proper class loader.
+     */
+    protected Class resolveClass(ObjectStreamClass streamClass) throws ClassNotFoundException, IOException 
+    {
+        return Class.forName(streamClass.getName(), true, Thread.currentThread().getContextClassLoader());
+    }
+
+}

Added: projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/jsf/integration/serialization/JBossSerializationProvider.java
===================================================================
--- projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/jsf/integration/serialization/JBossSerializationProvider.java	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/jsf/integration/serialization/JBossSerializationProvider.java	2010-05-06 19:42:35 UTC (rev 104537)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.web.jsf.integration.serialization;
+
+import com.sun.faces.spi.SerializationProvider;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.OutputStream;
+import org.jboss.logging.Logger;
+import org.jboss.serial.io.JBossObjectOutputStream;
+
+/**
+ * Provides interface between JSF RI and JBoss Serialization for better
+ * performance of client-side state saving.
+ *
+ * @author Stan Silvert
+ */
+public class JBossSerializationProvider implements SerializationProvider 
+{
+    private static final Logger LOG = Logger.getLogger(JBossSerializationProvider.class);
+
+    /**
+     * No-arg constructor required.
+     */
+    public JBossSerializationProvider() 
+    {
+        LOG.info("Using JBoss Serialization for JavaServer Faces.");
+    }
+    
+    /**
+     * Create a fast ObjectInputStream using JBoss Serialization.
+     */
+    public ObjectInputStream createObjectInputStream(InputStream source) throws IOException {
+        return new JBossFacesObjectInputStream(source);
+    }
+
+    /**
+     * Create a fast ObjectOutputStream using JBoss Serialization.
+     */
+    public ObjectOutputStream createObjectOutputStream(OutputStream destination) throws IOException 
+    {
+        return new JBossObjectOutputStream(destination);
+    }
+    
+}

Added: projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/validation/ValidatorFactoryVDFConnector.java
===================================================================
--- projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/validation/ValidatorFactoryVDFConnector.java	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/jboss-faces/src/main/java/org/jboss/web/validation/ValidatorFactoryVDFConnector.java	2010-05-06 19:42:35 UTC (rev 104537)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.web.validation;
+
+import javax.servlet.ServletContext;
+import javax.validation.ValidatorFactory;
+
+import org.jboss.mc.servlet.vdf.api.BaseAttachmentVDFConnector;
+
+/**
+ * Get ValidatorFactory from MC (VDF layer).
+ *
+ * @author Ales Justin
+ */
+public class ValidatorFactoryVDFConnector extends BaseAttachmentVDFConnector<ValidatorFactory>
+{
+   public static final String ALLOW_HIERARCHY_LOOKUP = "org.jboss.mc.servlet.vdf.allow_hierarchy_lookup";
+
+   public ValidatorFactoryVDFConnector(ServletContext servletContext)
+   {
+      super(servletContext);
+      String allowHierarchyLookupString = servletContext.getInitParameter(ALLOW_HIERARCHY_LOOKUP);
+      // by default we allow hierarchy lookup; this might change once we have VF per module
+      setAllowHierarchyLookup("false".equals(allowHierarchyLookupString) == false);
+   }
+
+   protected Class<ValidatorFactory> getAttachmentType()
+   {
+      return ValidatorFactory.class;
+   }
+}
\ No newline at end of file

Modified: projects/jboss-jsf-int/trunk/jsf-deployer/pom.xml
===================================================================
--- projects/jboss-jsf-int/trunk/jsf-deployer/pom.xml	2010-05-06 19:16:37 UTC (rev 104536)
+++ projects/jboss-jsf-int/trunk/jsf-deployer/pom.xml	2010-05-06 19:42:35 UTC (rev 104537)
@@ -5,58 +5,160 @@
     <artifactId>jboss-jsf-int</artifactId>
     <version>1.0.0-SNAPSHOT</version>
   </parent>
-  
+
   <artifactId>jboss-jsf-deployer</artifactId>
   <packaging>jar</packaging>
   <name>JBoss JSF Deployer</name>
   <description>JBoss JSF Deployer</description>
-  
+
   <dependencies>
     <dependency>
       <groupId>org.jboss.deployers</groupId>
       <artifactId>jboss-deployers-vfs</artifactId>
       <scope>provided</scope>
     </dependency>
-    
+
     <dependency>
+      <groupId>org.jboss</groupId>
+      <artifactId>jboss-vfs</artifactId>
+      <scope>provided</scope>
+    </dependency>
+
+    <dependency>
       <groupId>org.jboss.metadata</groupId>
       <artifactId>jboss-metadata</artifactId>
       <scope>provided</scope>
     </dependency>
-    
+
     <dependency>
-       <groupId>javax.faces</groupId>
-       <artifactId>jsf-api</artifactId>
-       <scope>provided</scope>
+      <groupId>javax.validation</groupId>
+      <artifactId>validation-api</artifactId>
+      <scope>provided</scope>
     </dependency>
-       
+
     <dependency>
-       <groupId>javax.faces</groupId>
-       <artifactId>jsf-impl</artifactId>
-       <scope>provided</scope>
+      <groupId>javax.faces</groupId>
+      <artifactId>jsf-api</artifactId>
+      <scope>provided</scope>
     </dependency>
-   
+
     <dependency>
-       <groupId>javax.servlet</groupId>
-       <artifactId>servlet-api</artifactId>
-       <scope>provided</scope>
+      <groupId>javax.faces</groupId>
+      <artifactId>jsf-impl</artifactId>
+      <scope>provided</scope>
     </dependency>
-    
+
     <dependency>
-       <groupId>apache-log4j</groupId>
-       <artifactId>log4j</artifactId>
-       <scope>provided</scope>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+      <scope>provided</scope>
     </dependency>
-    
+
     <dependency>
+      <groupId>apache-log4j</groupId>
+      <artifactId>log4j</artifactId>
+      <scope>provided</scope>
+    </dependency>
+
+    <dependency>
       <groupId>org.jboss.jbossas</groupId>
       <artifactId>jboss-as-tomcat</artifactId>
       <scope>provided</scope>
     </dependency>
+
+    <dependency>
+      <groupId>org.jboss.jbossas</groupId>
+      <artifactId>jboss-as-server</artifactId>
+      <scope>provided</scope>
+    </dependency>
   </dependencies>
 
   <build>
     <finalName>${artifactId}</finalName>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>copy</id>
+            <phase>generate-resources</phase>
+            <goals>
+              <goal>copy</goal>
+            </goals>
+            <configuration>
+              <artifactItems>
+                <artifactItem>
+                  <groupId>org.jboss.jsf.integration</groupId>
+                  <artifactId>jboss-faces</artifactId>
+                  <version>${project.version}</version>
+                  <type>jar</type>
+                  <overWrite>true</overWrite>
+                  <outputDirectory>src/main/resources/Mojarra-1.2/jsf-libs</outputDirectory>
+                </artifactItem>
+                <artifactItem>
+                  <groupId>javax.faces</groupId>
+                  <artifactId>jsf-api</artifactId>
+                  <version>${jsf12-version}</version>
+                  <type>jar</type>
+                  <overWrite>true</overWrite>
+                  <outputDirectory>src/main/resources/Mojarra-1.2/jsf-libs</outputDirectory>
+                </artifactItem>
+                <artifactItem>
+                  <groupId>javax.faces</groupId>
+                  <artifactId>jsf-impl</artifactId>
+                  <version>${jsf12-version}</version>
+                  <type>jar</type>
+                  <overWrite>true</overWrite>
+                  <outputDirectory>src/main/resources/Mojarra-1.2/jsf-libs</outputDirectory>
+                </artifactItem>
+
+
+                <artifactItem>
+                  <groupId>org.jboss.jsf.integration</groupId>
+                  <artifactId>jboss-faces</artifactId>
+                  <version>${project.version}</version>
+                  <type>jar</type>
+                  <overWrite>true</overWrite>
+                  <outputDirectory>src/main/resources/Mojarra-2.0/jsf-libs</outputDirectory>
+                </artifactItem>
+                <artifactItem>
+                  <groupId>javax.faces</groupId>
+                  <artifactId>jsf-api</artifactId>
+                  <version>${jsf20-version}</version>
+                  <type>jar</type>
+                  <overWrite>true</overWrite>
+                  <outputDirectory>src/main/resources/Mojarra-2.0/jsf-libs</outputDirectory>
+                </artifactItem>
+                <artifactItem>
+                  <groupId>javax.faces</groupId>
+                  <artifactId>jsf-impl</artifactId>
+                  <version>${jsf20-version}</version>
+                  <type>jar</type>
+                  <overWrite>true</overWrite>
+                  <outputDirectory>src/main/resources/Mojarra-2.0/jsf-libs</outputDirectory>
+                </artifactItem>
+              </artifactItems>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <artifactId>maven-clean-plugin</artifactId>
+        <configuration>
+          <filesets>
+            <fileset>
+              <directory>src/main/resources</directory>
+              <includes>
+                <includes>Mojarra-1.2/jsf-libs</includes>
+                <includes>Mojarra-2.0/jsf-libs</includes>
+              </includes>
+            </fileset>
+          </filesets>
+        </configuration>
+      </plugin>
+
+    </plugins>
   </build>
-  
+
 </project>

Added: projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/deployer/JSFImplManagementDeployer.java
===================================================================
--- projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/deployer/JSFImplManagementDeployer.java	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/deployer/JSFImplManagementDeployer.java	2010-05-06 19:42:35 UTC (rev 104537)
@@ -0,0 +1,198 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jsf.deployer;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.vfs.spi.deployer.AbstractSimpleVFSRealDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.metadata.javaee.spec.ParamValueMetaData;
+import org.jboss.metadata.web.spec.ServletMetaData;
+import org.jboss.metadata.web.spec.WebMetaData;
+import org.jboss.util.StringPropertyReplacer;
+
+/**
+ * The Deployer is responsible for building metadata for the available JSF
+ * implementations.
+ *
+ * Also, for each WAR deployment, decide which (if any) JSF impl will be used.
+ *
+ * @author Stan Silvert
+ * @since 1.0
+ */
+public class JSFImplManagementDeployer extends AbstractSimpleVFSRealDeployer<WebMetaData>
+{
+    
+    private static final String JSF_PROFILE_PARAM = "org.jboss.jbossfaces.JSF_PROFILE_NAME";
+    private static final String WAR_BUNDLES_JSF_PARAM = "org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL";
+
+    private Collection<String> facesServlets;
+
+    private String defaultJSFImplementation;
+    private Map<String,URL> jsfImplementations;
+
+    private Map<String, JSFImplMetaData> jsfImplMetatData = new HashMap<String, JSFImplMetaData>();
+
+    /**
+     * Create a new deployer.
+     */
+    public JSFImplManagementDeployer() throws MalformedURLException
+    {
+        super(WebMetaData.class);
+        setStage(DeploymentStages.POST_PARSE);
+        setOutput(JSFImplMetaData.class);
+    }
+
+    public void start() throws DeploymentException
+    {
+        createJSFImplMetaData();
+    }
+    
+    protected void createJSFImplMetaData() throws DeploymentException
+    {
+        log.info("Initializing JSF Implementations...");
+
+        if (jsfImplementations == null)
+        {
+            log.warn("No JSF implementations specified in jsf-integration-deployer.xml. Integrated JSF is disabled.");
+            return;
+        }
+
+        for (Iterator<String> impls = jsfImplementations.keySet().iterator(); impls.hasNext();)
+        {
+            String implName = impls.next();
+            try
+            {
+                jsfImplMetatData.put(implName, new JSFImplMetaData(implName, jsfImplementations.get(implName)));
+            }
+            catch (Exception e)
+            {
+                throw DeploymentException.rethrowAsDeploymentException("Malformed URL", e);
+            }
+        }
+
+        log.info("Initialized " + jsfImplMetatData.size() + " JSF implementations.");
+    }
+
+    /**
+     * Set the collection of servlets that signal this deployer to add JSF to a
+     * WAR.
+     *
+     * @param jsfServlets The servlet classes that signal this deployer to add
+     *                    JSF to a WAR.
+     */
+    public void setFacesServlets(Collection<String> facesServlets)
+    {
+        this.facesServlets = facesServlets;
+    }
+
+    public void setDefaultJSFImplementation(String defaultJSFImplementation)
+    {
+        this.defaultJSFImplementation = defaultJSFImplementation;
+    }
+
+    public void setJsfImplementations(Map<String, String> jsfImpls) throws MalformedURLException
+    {
+        this.jsfImplementations = new HashMap<String, URL>(jsfImpls.size());
+
+        for (Iterator<String> impls = jsfImpls.keySet().iterator(); impls.hasNext();)
+        {
+            String implName = impls.next();
+            String strURL = StringPropertyReplacer.replaceProperties(jsfImpls.get(implName));
+            jsfImplementations.put(implName, new URL(strURL));
+        }
+    }
+
+    public JSFImplMetaData getJSFImpl(String implName)
+    {
+       return jsfImplMetatData.get(implName);
+    }
+
+    private boolean isJSFDeployment(WebMetaData metaData)
+    {
+        // need to check in web fragments as well?
+        if (metaData.getServlets() == null) return false;
+
+        for (Iterator<ServletMetaData> servlets = metaData.getServlets().iterator(); servlets.hasNext();)
+        {
+            String servletClass = servlets.next().getServletClass();
+            if (this.facesServlets.contains(servletClass))
+            {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    private String getContextParam(String paramName, WebMetaData metaData)
+    {
+        List<ParamValueMetaData> contextParams = metaData.getContextParams();
+        if (contextParams == null) return null;
+        
+        for (Iterator<ParamValueMetaData> params = contextParams.iterator(); params.hasNext();)
+        {
+            ParamValueMetaData param = params.next();
+            if (param.getParamName().equals(paramName))
+            {
+                return param.getParamValue();
+            }
+        }
+
+        return null;
+    }
+
+    private boolean isWarBundlesJSF(WebMetaData metaData)
+    {
+        String warBundlesJSF = getContextParam(WAR_BUNDLES_JSF_PARAM, metaData );
+        return (warBundlesJSF != null) && warBundlesJSF.equalsIgnoreCase("true");
+    }
+
+    @Override
+    public void deploy(VFSDeploymentUnit unit, WebMetaData metaData) throws DeploymentException
+    {
+        if (!isJSFDeployment(metaData) || isWarBundlesJSF(metaData)) return;
+
+        JSFImplMetaData jsfImpl = findWhichJSFImplToUse(metaData);
+        unit.addAttachment(JSFImplMetaData.class, jsfImpl);
+    }
+
+    private JSFImplMetaData findWhichJSFImplToUse(WebMetaData metaData)
+    {
+        String implToUse = getContextParam(JSF_PROFILE_PARAM, metaData);
+        if (implToUse != null)
+        {
+            return this.jsfImplMetatData.get(implToUse);
+        }
+
+        return this.jsfImplMetatData.get(this.defaultJSFImplementation);
+    }
+
+}

Added: projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/deployer/JSFImplMetaData.java
===================================================================
--- projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/deployer/JSFImplMetaData.java	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/deployer/JSFImplMetaData.java	2010-05-06 19:42:35 UTC (rev 104537)
@@ -0,0 +1,189 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jsf.deployer;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.metadata.web.spec.TldMetaData;
+import org.jboss.metadata.web.spec.Web30MetaData;
+import org.jboss.vfs.VFS;
+import org.jboss.vfs.VirtualFile;
+import org.jboss.vfs.VirtualFileFilter;
+import org.jboss.vfs.VisitorAttributes;
+import org.jboss.vfs.util.SuffixMatchFilter;
+import org.jboss.vfs.util.automount.Automounter;
+import org.jboss.xb.binding.JBossXBException;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
+import org.jboss.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFactory;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ *
+ * @author ssilvert
+ */
+public class JSFImplMetaData
+{
+    private static final VirtualFileFilter JAR_FILTER = new SuffixMatchFilter(".jar");
+    private static final VirtualFileFilter TLD_FILTER = new SuffixMatchFilter(".tld", VisitorAttributes.DEFAULT);
+
+    /**
+    * Unmarshall factory used for parsing shared web.xml.
+    */
+   private static final UnmarshallerFactory factory = UnmarshallerFactory.newInstance();
+
+    private String implName;
+    private URL implURL;
+    private Set<URL> jsfJars;
+    private List<TldMetaData> sharedTldMetaData;
+    private Web30MetaData sharedWebXml;
+
+    public JSFImplMetaData(String implName, URL implURL) throws Exception
+    {
+        this.implName = implName;
+        this.implURL = implURL;
+        System.out.println("JSFImplMetaData implURL=" + implURL.toString());
+        findJSFJars();
+        parseJSFImplWebMetaData();
+    }
+
+    private void findJSFJars() throws Exception
+    {
+        VirtualFile vFile = VFS.getChild(implURL);
+        VirtualFile jsfLibsDir = vFile.getChild("jsf-libs");
+
+        if (!jsfLibsDir.isDirectory())
+        {
+            throw new Exception(this.implName + ": jsf-libs must be a directory");
+        }
+
+        Set<URL> jars = new HashSet<URL>();
+        for (VirtualFile jarFile : jsfLibsDir.getChildren(JAR_FILTER))
+        {
+            jars.add(jarFile.asFileURL());
+            Automounter.mount(jarFile);
+        }
+
+        this.jsfJars = Collections.unmodifiableSet(jars);
+    }
+
+    // This method will fail unless called late in the deployment lifecycle.
+    // That's why it is called from getTldMetaData()
+    private void findTLDMetaData() throws  URISyntaxException, IOException, JBossXBException
+    {
+        List<TldMetaData> sharedTlds = new ArrayList<TldMetaData>();
+
+        if (this.jsfJars.isEmpty()) return;
+
+        Unmarshaller unmarshaller = factory.newUnmarshaller();
+        SchemaBindingResolver resolver = SingletonSchemaResolverFactory.getInstance().getSchemaBindingResolver();
+
+        for (URL tldJar : jsfJars)
+        {
+            VirtualFile virtualFile = VFS.getChild(tldJar);
+            VirtualFile metaInf = virtualFile.getChild("META-INF");
+            if (metaInf == null) continue;
+            List<VirtualFile> tlds = metaInf.getChildren(TLD_FILTER);
+            for (VirtualFile tld : tlds)
+            {
+               // temporary fix because this tld can't be parsed
+                if (tld.getName().endsWith("mojarra_ext.tld")) continue;
+
+                TldMetaData tldMetaData = (TldMetaData) unmarshaller.unmarshal(tld.toURL().toString(), resolver);
+                sharedTlds.add(tldMetaData);
+            }
+        }
+
+        this.sharedTldMetaData = Collections.unmodifiableList(sharedTlds);
+    }
+
+
+   protected void parseJSFImplWebMetaData() throws DeploymentException
+   {
+      Unmarshaller unmarshaller = factory.newUnmarshaller();
+
+      String webXml = implURL.toString() + "/META-INF/web.xml";
+
+      SchemaBinding schema = JBossXBBuilder.build(Web30MetaData.class);
+
+      try
+      {
+         this.sharedWebXml = (Web30MetaData) unmarshaller.unmarshal(webXml, schema);
+      }
+      catch (JBossXBException e)
+      {
+         throw new DeploymentException("Unable to parse web.xml at " + webXml, e);
+      }
+   }
+
+    public String getImplName()
+    {
+        return this.implName;
+    }
+
+    public URL getImplURL()
+    {
+        return this.implURL;
+    }
+
+    public Web30MetaData getSharedWebXml()
+    {
+       return this.sharedWebXml;
+    }
+
+    public Set<URL> getJars()
+    {
+       return this.jsfJars;
+    }
+
+    public List<TldMetaData> getTldMetaData() throws DeploymentException
+    {
+        try
+        {
+            synchronized (this)
+            {
+                if (sharedTldMetaData == null) findTLDMetaData();
+            }
+        }
+        catch (Exception e)
+        {
+            DeploymentException.rethrowAsDeploymentException("Unable to read TLD metadata for JSF implementation " + this.implName, e);
+        }
+
+        return this.sharedTldMetaData;
+    }
+
+    @Override
+    public String toString()
+    {
+        return "JSF Impl " + this.implName + ": " + this.implURL.toString();
+    }
+}
\ No newline at end of file

Added: projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/deployer/JSFSharedWebMetaDataDeployer.java
===================================================================
--- projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/deployer/JSFSharedWebMetaDataDeployer.java	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/deployer/JSFSharedWebMetaDataDeployer.java	2010-05-06 19:42:35 UTC (rev 104537)
@@ -0,0 +1,156 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jsf.deployer;
+
+import java.net.MalformedURLException;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.vfs.spi.deployer.AbstractSimpleVFSRealDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.metadata.javaee.spec.ParamValueMetaData;
+import org.jboss.metadata.web.jboss.JBossServletMetaData;
+import org.jboss.metadata.web.jboss.JBossServletsMetaData;
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.metadata.web.spec.FilterMappingMetaData;
+import org.jboss.metadata.web.spec.FiltersMetaData;
+import org.jboss.metadata.web.spec.ListenerMetaData;
+import org.jboss.metadata.web.spec.ServletMappingMetaData;
+import org.jboss.metadata.web.spec.ServletMetaData;
+import org.jboss.metadata.web.spec.ServletsMetaData;
+import org.jboss.metadata.web.spec.Web30MetaData;
+
+/**
+ * 
+ *
+ * @author Stan Silvert
+ * @since 1.0
+ */
+public class JSFSharedWebMetaDataDeployer extends AbstractSimpleVFSRealDeployer<JSFImplMetaData>
+{
+    
+    /**
+     * Create a new deployer.
+     */
+    public JSFSharedWebMetaDataDeployer() throws MalformedURLException
+    {
+        super(JSFImplMetaData.class);
+        setStage(DeploymentStages.POST_CLASSLOADER);
+    }
+
+    
+    @Override
+    public void deploy(VFSDeploymentUnit unit, JSFImplMetaData jsfImpl) throws DeploymentException
+    {
+       if (jsfImpl == null) return;
+       
+       JBossWebMetaData webMetaData = unit.getAttachment(JBossWebMetaData.class);
+       mergeWebMetaData(webMetaData, jsfImpl.getSharedWebXml());
+    }
+    
+    // merge the JBoss shared web.xml with the JSF impl web.xml
+    private void mergeWebMetaData(JBossWebMetaData webMetaData, Web30MetaData jsfImplWebMetaData)
+    {
+        if (jsfImplWebMetaData.getFilters() != null)
+        {
+            FiltersMetaData filters = webMetaData.getFilters();
+            if (filters == null)
+            {
+                filters = new FiltersMetaData();
+            }
+            filters.addAll(jsfImplWebMetaData.getFilters());
+            webMetaData.setFilters(filters);
+        }
+
+        if (jsfImplWebMetaData.getFilterMappings() != null)
+        {
+            List<FilterMappingMetaData> filterMappings = webMetaData.getFilterMappings();
+            if (filterMappings == null)
+            {
+                filterMappings = new ArrayList<FilterMappingMetaData>();
+            }
+            filterMappings.addAll(jsfImplWebMetaData.getFilterMappings());
+            webMetaData.setFilterMappings(filterMappings);
+        }
+
+        if (jsfImplWebMetaData.getServlets() != null)
+        {
+            JBossServletsMetaData servlets = webMetaData.getServlets();
+            if (servlets == null)
+            {
+                servlets = new JBossServletsMetaData();
+            }
+            ServletsMetaData servletsMD = jsfImplWebMetaData.getServlets();
+            servlets.addAll(makeJBossServletsMetaData(servletsMD));
+            webMetaData.setServlets(servlets);
+        }
+
+        if (jsfImplWebMetaData.getServletMappings() != null)
+        {
+            List<ServletMappingMetaData> servletMappings = webMetaData.getServletMappings();
+            if (servletMappings == null)
+            {
+                servletMappings = new ArrayList<ServletMappingMetaData>();
+            }
+            servletMappings.addAll(jsfImplWebMetaData.getServletMappings());
+            webMetaData.setServletMappings(servletMappings);
+        }
+
+        if (jsfImplWebMetaData.getContextParams() != null)
+        {
+            List<ParamValueMetaData> contextParams = webMetaData.getContextParams();
+            if (contextParams == null)
+            {
+                contextParams = new ArrayList<ParamValueMetaData>();
+            }
+            contextParams.addAll(jsfImplWebMetaData.getContextParams());
+            webMetaData.setContextParams(contextParams);
+        }
+
+        if (jsfImplWebMetaData.getListeners() != null)
+        {
+            List<ListenerMetaData> listeners = webMetaData.getListeners();
+            if (listeners == null)
+            {
+                listeners = new ArrayList<ListenerMetaData>();
+            }
+            listeners.addAll(jsfImplWebMetaData.getListeners());
+            webMetaData.setListeners(listeners);
+        }
+    }
+
+    private Collection<JBossServletMetaData> makeJBossServletsMetaData(ServletsMetaData servletsMD)
+    {
+        Collection<JBossServletMetaData> servletSet = new HashSet<JBossServletMetaData>();
+        for (ServletMetaData servletMD : servletsMD)
+        {
+            JBossServletMetaData jbossMD = new JBossServletMetaData();
+            servletSet.add(jbossMD.merge(servletMD));
+        }
+
+        return servletSet;
+    }
+}
\ No newline at end of file

Added: projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/deployer/JSFTldMetaDataDeployer.java
===================================================================
--- projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/deployer/JSFTldMetaDataDeployer.java	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/deployer/JSFTldMetaDataDeployer.java	2010-05-06 19:42:35 UTC (rev 104537)
@@ -0,0 +1,63 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2010, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.jsf.deployer;
+
+import java.util.List;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.spi.deployer.helpers.AbstractDeployer;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.metadata.web.spec.TldMetaData;
+
+
+/**
+ * 
+ *
+ * @author Stan Silvert
+ * @since 1.0
+ */
+public class JSFTldMetaDataDeployer extends AbstractDeployer
+{
+   private static final String SHARED_TLDS_ATTACHMENT_NAME = TldMetaData.class.getName();
+
+   public JSFTldMetaDataDeployer()
+   {
+      setStage(DeploymentStages.POST_CLASSLOADER);
+      setInput(JSFImplMetaData.class);
+      addOutput(SHARED_TLDS_ATTACHMENT_NAME);
+   }
+   
+   public void deploy(DeploymentUnit unit) throws DeploymentException
+   {
+      JSFImplMetaData jsfImpl = unit.getAttachment(JSFImplMetaData.class);
+      List<TldMetaData> sharedTldMetaData = jsfImpl.getTldMetaData();
+
+      String attachmentName = SHARED_TLDS_ATTACHMENT_NAME + ":" + jsfImpl.getImplName() + ":";
+      int counter = 0;
+      for (TldMetaData tldMetaData : sharedTldMetaData)
+      {
+         unit.addAttachment(attachmentName + counter++, tldMetaData);
+      }
+   }
+
+}
\ No newline at end of file

Copied: projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/deployer/JSFUrlIntegrationDeployer.java (from rev 103205, projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/JSFDeployer.java)
===================================================================
--- projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/deployer/JSFUrlIntegrationDeployer.java	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/deployer/JSFUrlIntegrationDeployer.java	2010-05-06 19:42:35 UTC (rev 104537)
@@ -0,0 +1,93 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2010, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.jsf.deployer;
+
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.vfs.plugins.classloader.UrlIntegrationDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+
+/**
+ * The JSFUrlIntegrationDeployer adds the jars from the given JSF implementation
+ * to the DeploymentUnit's classpath.
+ *
+ * @author Stan Silvert
+ * @since 1.0
+ */
+public class JSFUrlIntegrationDeployer extends UrlIntegrationDeployer<JSFImplMetaData>
+{
+   private String jsfImplName;
+   private JSFImplManagementDeployer implManager;
+
+   /**
+    * Create a new deployer.
+    */
+   public JSFUrlIntegrationDeployer()
+   {
+      super(JSFImplMetaData.class);
+   }
+
+   public void setJSFImplName(String jsfImplName)
+   {
+      this.jsfImplName = jsfImplName;
+   }
+
+   public String getJSFImplName()
+   {
+      return this.jsfImplName;
+   }
+
+   public void setJSFImplManagementDeployer(JSFImplManagementDeployer implManager)
+   {
+      this.implManager = implManager;
+   }
+
+   @Override
+   public void start()
+   {
+      JSFImplMetaData jsfImpl = implManager.getJSFImpl(jsfImplName);
+      if (jsfImpl == null) throw new IllegalStateException("JSF implementation " + jsfImplName + " not defined in JSFImplManagementDeployer.");
+      setIntegrationURLs(jsfImpl.getJars());
+   } 
+
+   @Override
+   public void deploy(VFSDeploymentUnit unit, JSFImplMetaData jsfImpl) throws DeploymentException
+   {
+      if (jsfImpl == null) return;  // need this because it's a subclass of an OptionalDeployer
+      if (!jsfImpl.getImplName().equals(this.jsfImplName)) return;
+
+      super.deploy(unit, jsfImpl);
+    }
+
+   // If we got this far, we know that we need to return true 
+   @Override
+   protected boolean isIntegrationDeployment(VFSDeploymentUnit unit, JSFImplMetaData metaData)
+   {
+       return true;
+   }
+
+   @Override
+   protected boolean isIntegrationDeployment(VFSDeploymentUnit unit)
+   {
+       return true;
+   }
+}
\ No newline at end of file

Deleted: projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/JSFDeployer.java
===================================================================
--- projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/JSFDeployer.java	2010-05-06 19:16:37 UTC (rev 104536)
+++ projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/JSFDeployer.java	2010-05-06 19:42:35 UTC (rev 104537)
@@ -1,352 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2009, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.jsf.integration;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentStages;
-import org.jboss.deployers.vfs.spi.deployer.AbstractSimpleVFSRealDeployer;
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-import org.jboss.metadata.javaee.spec.ParamValueMetaData;
-import org.jboss.metadata.web.jboss.JBossServletMetaData;
-import org.jboss.metadata.web.jboss.JBossServletsMetaData;
-import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.metadata.web.spec.FilterMappingMetaData;
-import org.jboss.metadata.web.spec.FiltersMetaData;
-import org.jboss.metadata.web.spec.ListenerMetaData;
-import org.jboss.metadata.web.spec.ServletMappingMetaData;
-import org.jboss.metadata.web.spec.ServletMetaData;
-import org.jboss.metadata.web.spec.ServletsMetaData;
-import org.jboss.metadata.web.spec.Web25MetaData;
-import org.jboss.util.StringPropertyReplacer;
-import org.jboss.virtual.VFS;
-import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.VirtualFileFilter;
-import org.jboss.virtual.plugins.vfs.helpers.SuffixMatchFilter;
-import org.jboss.xb.binding.JBossXBException;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
-import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
-import org.jboss.xb.builder.JBossXBBuilder;
-
-/**
- * The JSFDeployer automatically adds the needed servlets and
- * servlet filters to a WAR.  It will also add all the JSFUnit classes and 
- * dependencies.
- * 
- * Optionally, it can also add user-defined directories and jars to the 
- * classpath of the WAR.
- *
- * @author Stan Silvert
- * @since 1.0
- */
-public class JSFDeployer extends AbstractSimpleVFSRealDeployer<JBossWebMetaData>
-{
-   private static final VirtualFileFilter JAR_FILTER = new SuffixMatchFilter(".jar");
-   private static final String JSF_PROFILE_PARAM = "org.jboss.jbossfaces.JSF_PROFILE_NAME";
-   private static final String WAR_BUNDLES_JSF_PARAM = "org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL";
-   
-   private Collection<String> facesServlets;
-   
-   private URL deployerBaseURL;
-   private String defaultJSFImplementation;
-   private Map<String,URL> jsfImplementations;
-   private Map<String,Web25MetaData> jsfImplWebXmls = new HashMap<String,Web25MetaData>();
-
-   /**
-    * Unmarshall factory used for parsing shared web.xml.
-    */
-   private static final UnmarshallerFactory factory = UnmarshallerFactory.newInstance();
-   
-   /**
-    * Create a new deployer.
-    */
-   public JSFDeployer()
-   {
-      super(JBossWebMetaData.class);
-      
-      // We have to run before the classloading is setup
-      setStage(DeploymentStages.POST_PARSE);
-   }
-   
-   public void start() throws MalformedURLException
-   {
-      log.info("Initializing JSF Integration Deployer...");
-      
-      // only need to do this once for each JSF profile
-      parseJSFImplWebMetaData();
-      this.deployerBaseURL = new URL(findDeployerBaseURL());
-      
-      log.info("JBoss JSF Integration Deployer is initialized");
-   }
-
-   
-   private String findDeployerBaseURL()
-   {
-      URL descriptorURL = getClass().getClassLoader().getResource("/META-INF/jsf-integration-deployer-jboss-beans.xml");
-      String urlString = descriptorURL.toString();
-      return urlString.substring(0, urlString.lastIndexOf("/META-INF/jsf-integration-deployer-jboss-beans.xml"));
-   }
-
-   private void parseJSFImplWebMetaData()
-   {
-      Unmarshaller unmarshaller = factory.newUnmarshaller();
-      
-      for (Iterator<String> impls = jsfImplementations.keySet().iterator(); impls.hasNext();)
-      {
-         String jsfImpl = impls.next();
-         String implLocation = jsfImplementations.get(jsfImpl).toString();
-         
-         //URL webXml = this.getClass().getClassLoader().getResource(implLocation + "/web.xml");
-        // if (webXml == null)
-        //    log.error("Unable to find jsf web.xml for JSF implementation at " + implLocation);
-
-         SchemaBinding schema = JBossXBBuilder.build(Web25MetaData.class);
-
-         try
-         {
-            //jsfImplWebXmls.put(jsfImpl, (Web25MetaData) unmarshaller.unmarshal(webXml.toString(), schema));
-            jsfImplWebXmls.put(jsfImpl, (Web25MetaData) unmarshaller.unmarshal(implLocation + "/web.xml", schema));
-            log.info("Parsed web.xml for JSF profile at " + implLocation);
-         }
-         catch (JBossXBException e)
-         {
-            log.error("Unable to parse web.xml at " + implLocation, e);
-         }
-      }
-   }
-   
-   /**
-    * Set the collection of suffixes that this deployer will use to choose
-    * which wars to "JSFUnify".  For example, if the suffixes were "_jsfunit"
-    * and "mywar", then mywar.war and foo_jsfunit.war would match.
-    * 
-    * @param jsfServlets The servlet classes that signal this deployer to add
-    *                    JSF to a WAR.
-    */
-   public void setFacesServlets(Collection<String> facesServlets)
-   {
-      this.facesServlets = facesServlets;
-   }
-   
-   public void setDefaultJSFImplementation(String defaultJSFImplementation)
-   {
-      this.defaultJSFImplementation = defaultJSFImplementation;
-   }
-   
-   public void setJsfImplementations(Map<String,String> jsfImpls) throws MalformedURLException
-   {
-      this.jsfImplementations = new HashMap<String,URL>(jsfImpls.size());
-      
-      for (Iterator<String> impls = jsfImpls.keySet().iterator(); impls.hasNext();)
-      {
-         String implName = impls.next();
-         String strURL = StringPropertyReplacer.replaceProperties(jsfImpls.get(implName));
-         log.debug("%%%%%%%%%%%%%");
-         log.debug("Putting " + implName + " : " + strURL);
-         log.debug("%%%%%%%%%%%%%");
-         jsfImplementations.put(implName, new URL(strURL));
-      }
-   }
-   
-   private boolean isJSFDeployment(JBossWebMetaData metaData) 
-   {
-      for (Iterator<JBossServletMetaData> servlets = metaData.getServlets().iterator(); servlets.hasNext();)
-      {
-         if (this.facesServlets.contains(servlets.next().getServletClass())) return true;
-      }
-      
-      return false;
-   }
-   
-   private String getContextParam(String paramName, JBossWebMetaData metaData)
-   {
-      List<ParamValueMetaData> contextParams = metaData.getContextParams();
-      for (Iterator<ParamValueMetaData> params = contextParams.iterator(); params.hasNext();)
-      {
-         ParamValueMetaData param = params.next();
-         if (param.getParamName().equals(paramName)) return param.getParamValue();
-      }
-      
-      return null;
-   }
-   
-   @Override
-   public void deploy(VFSDeploymentUnit unit, JBossWebMetaData metaData) throws DeploymentException
-   {
-      if (!isJSFDeployment(metaData)) return;
-      
-      String warBundlesJSF = getContextParam(WAR_BUNDLES_JSF_PARAM, metaData);
-      if ((warBundlesJSF != null) && (warBundlesJSF.equalsIgnoreCase("true"))) return;
-      
-      String jsfImplToUse = findWhichJSFImplToUse(metaData);
-      if (!this.jsfImplementations.containsKey(jsfImplToUse)) 
-         throw new DeploymentException("JSF profile name " + jsfImplToUse + 
-                                       " is not defined in jsf.deployer/META-INF/jsf-integration-deployer-jboss-beans.xml");
-      
-      log.debug("Using JSF profile name=" + jsfImplToUse);
-      
-      mergeWebXml(metaData, this.jsfImplWebXmls.get(jsfImplToUse));
-
-      try
-      {
-         addClasspath(unit, this.deployerBaseURL);
-         addClasspath(unit, this.jsfImplementations.get(jsfImplToUse));
-      }
-      catch (MalformedURLException e)
-      {
-         throw DeploymentException.rethrowAsDeploymentException("Malformed URL", e);
-      }
-      
-      log.info("Added JSF profile " + jsfImplToUse + " to " + unit.getName());
-   }
-   
-   private String findWhichJSFImplToUse(JBossWebMetaData metaData)
-   {
-      String implToUse = getContextParam(JSF_PROFILE_PARAM, metaData);
-      if (implToUse != null) return implToUse;
-      
-      return this.defaultJSFImplementation;
-   }
- 
-   //TODO: Figure out why this version of addClasspath works, but the commented
-   //      one below does not.  This one adds too much to the classpath.
-   private void addClasspath(VFSDeploymentUnit unit, URL url) throws MalformedURLException
-   {
-      
-      
-      try
-      {
-         VirtualFile vFile = VFS.getRoot(url);
-         unit.addClassPath(vFile);
-         
-         // add jar files if url is a directory
-         if (!vFile.isLeaf())
-         { 
-            for (VirtualFile jarFile : vFile.getChildrenRecursively(JAR_FILTER))
-            {
-               log.debug("Adding " + jarFile + " to classpath for " + unit.getName());
-               unit.addClassPath(jarFile);
-            }
-         }
-      }
-      catch (IOException e)
-      {
-         log.warn("Unable to add URL to classpath: " + url.toString());
-      }
-   }
-   
-  /* private void addClasspath(VFSDeploymentUnit unit, URL url) throws MalformedURLException
-   {
-      try
-      {
-         VFS vfs = VFS.getVFS(url);
-
-         // add jar files to the classpath
-         for (VirtualFile jarFile : vfs.getChildren(JAR_FILTER))
-         {
-            log.debug("Adding " + jarFile + " to classpath for " + unit.getName());
-            unit.addClassPath(jarFile);
-         }
-      }
-      catch (IOException e)
-      {
-         log.warn("Unable to add URL to classpath: " + url.toString());
-      }
-   } */ 
-   
-   // merge the JSF impl's web.xml with the WAR's web.xml
-   private void mergeWebXml(JBossWebMetaData webAppMetaData, Web25MetaData jsfImplWebMetaData)
-   {
-      if (jsfImplWebMetaData.getFilters() != null)
-      {
-         FiltersMetaData filters = webAppMetaData.getFilters();
-         if (filters == null) filters = new FiltersMetaData();
-         filters.addAll(jsfImplWebMetaData.getFilters());
-         webAppMetaData.setFilters(filters);
-      }
-      
-      if (jsfImplWebMetaData.getFilterMappings() != null)
-      {
-         List<FilterMappingMetaData> filterMappings = webAppMetaData.getFilterMappings();
-         if (filterMappings == null) filterMappings = new ArrayList<FilterMappingMetaData>();
-         filterMappings.addAll(jsfImplWebMetaData.getFilterMappings());
-         webAppMetaData.setFilterMappings(filterMappings);
-      }
-      
-      if (jsfImplWebMetaData.getServlets() != null)
-      {
-         JBossServletsMetaData servlets = webAppMetaData.getServlets();
-         if (servlets == null) servlets = new JBossServletsMetaData();
-         ServletsMetaData servletsMD = jsfImplWebMetaData.getServlets();
-         servlets.addAll(makeJBossServletsMetaData(servletsMD));
-         webAppMetaData.setServlets(servlets);
-      }
-      
-      if (jsfImplWebMetaData.getServletMappings() != null)
-      {
-         List<ServletMappingMetaData> servletMappings = webAppMetaData.getServletMappings();
-         if (servletMappings == null) servletMappings = new ArrayList<ServletMappingMetaData>();
-         servletMappings.addAll(jsfImplWebMetaData.getServletMappings());
-         webAppMetaData.setServletMappings(servletMappings);
-      }
-      
-      if (jsfImplWebMetaData.getContextParams() != null)
-      {
-         List<ParamValueMetaData> contextParams = webAppMetaData.getContextParams();
-         if (contextParams == null) contextParams = new ArrayList<ParamValueMetaData>();
-         contextParams.addAll(jsfImplWebMetaData.getContextParams());
-         webAppMetaData.setContextParams(contextParams);
-      }
-      
-      if (jsfImplWebMetaData.getListeners() != null)
-      {
-         List<ListenerMetaData> listeners = webAppMetaData.getListeners();
-         if (listeners == null) listeners = new ArrayList<ListenerMetaData>();
-         listeners.addAll(jsfImplWebMetaData.getListeners());
-         webAppMetaData.setListeners(listeners);
-      }
-   }
-   
-   private Collection<JBossServletMetaData> makeJBossServletsMetaData(ServletsMetaData servletsMD)
-   {
-      Collection<JBossServletMetaData> servletSet = new HashSet<JBossServletMetaData>();
-      for (ServletMetaData servletMD : servletsMD)
-      {
-         JBossServletMetaData jbossMD = new JBossServletMetaData();
-         servletSet.add(jbossMD.merge(servletMD));
-      }
-      
-      return servletSet;
-   }
-   
-}
\ No newline at end of file

Added: projects/jboss-jsf-int/trunk/jsf-deployer/src/main/resources/META-INF/jsf-integration-deployer-jboss-beans.xml
===================================================================
--- projects/jboss-jsf-int/trunk/jsf-deployer/src/main/resources/META-INF/jsf-integration-deployer-jboss-beans.xml	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/jsf-deployer/src/main/resources/META-INF/jsf-integration-deployer-jboss-beans.xml	2010-05-06 19:42:35 UTC (rev 104537)
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+    JBoss JSF + JBossAS integration
+-->
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+  <bean name="JSFImplManagementDeployer" class="org.jboss.jsf.deployer.JSFImplManagementDeployer">
+    
+    <!--
+      * Specify the servlet classes that signal this deployer to add JSF to a WAR. 
+    -->
+    <property name="facesServlets">
+       <collection elementClass="java.lang.String">
+          <value>javax.faces.webapp.FacesServlet</value>
+       </collection>
+    </property>
+    
+    <!--
+      * Specify the name of the default JSF profile.
+    -->
+    <property name="defaultJSFImplementation">
+       <value>Mojarra-2.0</value>
+    </property>
+    
+    <!-- 
+      *  Define where to find JSF implementations.  The key is the name
+      *  of the JSF profile.  The value is a URL to the directory where
+      *  the implementation resides.  The implementation should include any 
+      *  jars that the implementation requires.  It should also include a 
+      *  web.xml file in the root.  Elements in the web.xml will be applied 
+      *  to all web applications applications that use the profile.
+      
+      Example URLs:
+            ${jboss.server.home.url}/deployers/jsf.deployer/Mojarra1.2
+                 scans Mojarra 1.2 for jars and web.xml
+            file:/myproject/jsflib
+                 scans /myproject/jsflib
+            http://www.test.com/jsfimpl/myfaces/
+                 scans the specified WebDAV location
+    -->
+    <property name="jsfImplementations">
+      <map keyClass="java.lang.String" valueClass="java.lang.String">
+        <entry>
+          <key>Mojarra-1.2</key>
+          <value>${jboss.server.home.url}deployers/jsf.deployer/Mojarra-1.2</value>
+        </entry>
+        <entry>
+          <key>Mojarra-2.0</key>
+          <value>${jboss.server.home.url}deployers/jsf.deployer/Mojarra-2.0</value>
+        </entry>
+      </map>   
+    </property>
+  </bean>
+
+  <bean name="JSFTldDeployer" class="org.jboss.jsf.deployer.JSFTldMetaDataDeployer"/>
+      
+
+  <!-- Adds JSF Jars to the deployment -->
+  <bean name="JSFUrlIntegrationDeployer-12" class="org.jboss.jsf.deployer.JSFUrlIntegrationDeployer">
+    <property name="JSFImplName">
+      <value>Mojarra-1.2</value>
+    </property>
+    <property name="JSFImplManagementDeployer">
+      <inject bean="JSFImplManagementDeployer"/>
+    </property>
+  </bean> 
+
+  <bean name="JSFUrlIntegrationDeployer-20" class="org.jboss.jsf.deployer.JSFUrlIntegrationDeployer">
+    <property name="JSFImplName">
+      <value>Mojarra-2.0</value>
+    </property>
+    <property name="JSFImplManagementDeployer">
+      <inject bean="JSFImplManagementDeployer"/>
+    </property>
+  </bean>
+
+    
+  <bean name="JSFSharedWebMetaDataDeployer" class="org.jboss.jsf.deployer.JSFSharedWebMetaDataDeployer"/>
+
+
+</deployment>

Added: projects/jboss-jsf-int/trunk/jsf-deployer/src/main/resources/Mojarra-1.2/META-INF/web.xml
===================================================================
--- projects/jboss-jsf-int/trunk/jsf-deployer/src/main/resources/Mojarra-1.2/META-INF/web.xml	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/jsf-deployer/src/main/resources/Mojarra-1.2/META-INF/web.xml	2010-05-06 19:42:35 UTC (rev 104537)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+   version="2.5">
+   <!-- ======================== Introduction ============================== -->
+   <!-- This document defines default values for *all* web applications      -->
+   <!-- loaded into this instance of Tomcat.  As each application is         -->
+   <!-- deployed, this file is processed, followed by the                    -->
+   <!-- "/WEB-INF/web.xml" deployment descriptor from your own               -->
+   <!-- applications.                                                        -->
+   <!--                                                                      -->
+   <!-- WARNING:  Do not configure application-specific resources here!      -->
+   <!-- They should go in the "/WEB-INF/web.xml" file in your application.   -->
+
+   <!-- =========== Common Context Params ================================== -->
+
+   <!-- Regular expression to determine if two different URLs actually point -->
+   <!-- to the same jar file.  This keeps faces-config files from being      -->
+   <!-- read twice.                                                          -->
+   <context-param>
+     <param-name>com.sun.faces.duplicateJARPattern</param-name>
+     <param-value>^tmp\d+(\S*\.jar)</param-value>
+   </context-param>
+    
+   <!-- JBossInjectionProvider provides resource injection for managed beans. -->
+   <!-- See JSF 1.2 spec section 5.4 for details.                             -->
+   <context-param>
+     <param-name>com.sun.faces.injectionProvider</param-name>
+     <param-value>org.jboss.web.jsf.integration.injection.JBossDelegatingInjectionProvider</param-value>
+   </context-param>
+   
+   <!-- ================== Common filter Configuration ==================== -->
+   
+	
+   <!-- ================== Common Listener Configuration ==================== -->
+   <!-- Configures JSF for a web application if the javax.faces.webapp.FacesServlet is declared -->
+   <!-- in web.xml.                                                                             -->
+   <listener>
+     <listener-class>org.jboss.web.jsf.integration.config.JBossJSFConfigureListener</listener-class>
+   </listener>
+
+   <!-- Listens to all web app lifecycle events so that @PreDestroy can be called on -->
+   <!-- JSF managed beans that go out of scope.  You can comment this out if you     -->
+   <!-- don't use JSF or you don't use annotations on your managed beans.            
+   <listener>
+     <listener-class>com.sun.faces.application.WebappLifecycleListener</listener-class>
+   </listener> -->
+
+</web-app>

Added: projects/jboss-jsf-int/trunk/jsf-deployer/src/main/resources/Mojarra-2.0/META-INF/web.xml
===================================================================
--- projects/jboss-jsf-int/trunk/jsf-deployer/src/main/resources/Mojarra-2.0/META-INF/web.xml	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/jsf-deployer/src/main/resources/Mojarra-2.0/META-INF/web.xml	2010-05-06 19:42:35 UTC (rev 104537)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+   version="2.5">
+   <!-- ======================== Introduction ============================== -->
+   <!-- This document defines default values for *all* web applications      -->
+   <!-- loaded into this instance of Tomcat.  As each application is         -->
+   <!-- deployed, this file is processed, followed by the                    -->
+   <!-- "/WEB-INF/web.xml" deployment descriptor from your own               -->
+   <!-- applications.                                                        -->
+   <!--                                                                      -->
+   <!-- WARNING:  Do not configure application-specific resources here!      -->
+   <!-- They should go in the "/WEB-INF/web.xml" file in your application.   -->
+
+   <!-- =========== Common Context Params ================================== -->
+
+   <!-- Regular expression to determine if two different URLs actually point -->
+   <!-- to the same jar file.  This keeps faces-config files from being      -->
+   <!-- read twice.                                                          -->
+   <context-param>
+     <param-name>com.sun.faces.duplicateJARPattern</param-name>
+     <param-value>^tmp\d+(\S*\.jar)</param-value>
+   </context-param>
+    
+   <!-- JBossInjectionProvider provides resource injection for managed beans. -->
+   <!-- See JSF 1.2 spec section 5.4 for details.                             -->
+   <context-param>
+     <param-name>com.sun.faces.injectionProvider</param-name>
+     <param-value>org.jboss.web.jsf.integration.injection.JBossDelegatingInjectionProvider</param-value>
+   </context-param>
+   
+   <!-- ================== Common filter Configuration ==================== -->
+   
+	
+   <!-- ================== Common Listener Configuration ==================== -->
+   <!-- Configures JSF for a web application if the javax.faces.webapp.FacesServlet is declared -->
+   <!-- in web.xml.                                                                             -->
+   <listener>
+     <listener-class>org.jboss.web.jsf.integration.config.JBossJSFConfigureListener</listener-class>
+   </listener>
+
+   <!-- Listens to all web app lifecycle events so that @PreDestroy can be called on -->
+   <!-- JSF managed beans that go out of scope.  You can comment this out if you     -->
+   <!-- don't use JSF or you don't use annotations on your managed beans.            -->
+   <listener>
+     <listener-class>com.sun.faces.application.WebappLifecycleListener</listener-class>
+   </listener>
+
+</web-app>

Modified: projects/jboss-jsf-int/trunk/pom.xml
===================================================================
--- projects/jboss-jsf-int/trunk/pom.xml	2010-05-06 19:16:37 UTC (rev 104536)
+++ projects/jboss-jsf-int/trunk/pom.xml	2010-05-06 19:42:35 UTC (rev 104537)
@@ -1,179 +1,197 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <parent>
-    <groupId>org.jboss</groupId>
-    <artifactId>jboss-parent</artifactId>
-    <version>4</version>
-  </parent>
-  
-  <groupId>org.jboss.jsf.integration</groupId>
-  <artifactId>jboss-jsf-int</artifactId>
-  <version>1.0.0-SNAPSHOT</version>
-  <packaging>pom</packaging>
-  <name>JBoss JavaServer Faces Integration</name>
-  <url>http://jsf.jboss.org/</url>
-  <description>
-    JBoss JavaServer Faces Integration
-  </description>
-  <scm>
-    <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/jboss-jsf-int/trunk/</connection>
-    <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/jboss-jsf-int/trunk/</developerConnection>
-    <url>http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/projects/jboss-jsf-int/trunk/</url>
-  </scm>
-  
-  <properties>
-    <jsf12-version>1.2_12</jsf12-version>
-    <jsf20-version>2.0.0-PR2</jsf20-version>
-  </properties>
-  
-  <modules>
-     <module>jsf-deployer</module>
-     <module>testwar</module>
-     <module>jsf12test</module>
-     <module>jsf20test</module>
-     <module>jsfbundledtest</module>
-     <module>cargo</module>
-  </modules>
-  
-  <dependencyManagement>
-     <dependencies>
-       <dependency>
-         <groupId>org.jboss.deployers</groupId>
-         <artifactId>jboss-deployers-vfs</artifactId>
-         <version>2.0.0.CR1</version>
-       </dependency>
-
-       <dependency>
-         <groupId>org.jboss.metadata</groupId>
-         <artifactId>jboss-metadata</artifactId>
-         <version>1.0.0.CR1</version>
-       </dependency>
-       
-       <dependency>
-          <groupId>org.jboss.jsfunit</groupId>
-          <artifactId>jboss-jsfunit-core</artifactId>
-          <version>1.0.0.GA</version>
-       </dependency>
-       
-       <dependency>
-          <groupId>org.apache.myfaces.core</groupId>
-          <artifactId>myfaces-api</artifactId>
-          <version>1.1.6</version>
-       </dependency>
-       
-       <dependency>
-          <groupId>org.apache.myfaces.core</groupId>
-          <artifactId>myfaces-impl</artifactId>
-          <version>1.1.6</version>
-       </dependency>
-       
-       <dependency>
-          <groupId>javax.faces</groupId>
-          <artifactId>jsf-api</artifactId>
-          <version>${jsf12-version}</version>
-       </dependency>
-       
-       <dependency>
-          <groupId>javax.faces</groupId>
-          <artifactId>jsf-impl</artifactId>
-          <version>${jsf12-version}</version>
-       </dependency>
-       
-       <dependency>
-          <groupId>javax.servlet</groupId>
-          <artifactId>servlet-api</artifactId>
-          <version>2.5</version>
-       </dependency>
-    
-       <dependency>
-          <groupId>apache-log4j</groupId>
-          <artifactId>log4j</artifactId>
-          <version>1.2.14</version>
-       </dependency>
-       
-       <dependency>
-         <groupId>org.jboss.jbossas</groupId>
-         <artifactId>jboss-as-tomcat</artifactId>
-         <version>5.0.1.GA</version>
-       </dependency>
-       
-    </dependencies>
-  </dependencyManagement>
-
-  <build>
-    <finalName>${artifactId}</finalName>
-    <defaultGoal>install</defaultGoal>
-    
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <version>2.0.2</version>
-        <configuration>
-          <source>1.5</source>
-          <target>1.5</target>
-          <showDeprecation>true</showDeprecation>
-          <showWarnings>true</showWarnings>
-          <optimize>true</optimize>
-        </configuration>
-      </plugin>
-      
-      <plugin>
-        <groupId>org.codehaus.cargo</groupId>
-        <artifactId>cargo-maven2-plugin</artifactId>
-        <version>1.0</version>
-      </plugin>
-    </plugins>
-    
-  </build>
-  
-  <repositories>
-    <repository>
-      <id>repository.jboss.org</id>
-      <name>JBoss Repository</name>
-      <layout>default</layout>
-      <url>http://repository.jboss.org/maven2/</url>
-      <snapshots>
-        <enabled>false</enabled>
-      </snapshots>
-    </repository>
-    <repository>
-      <id>snapshots.jboss.org</id>
-      <name>JBoss Snapshots Repository</name>
-      <layout>default</layout>
-      <url>http://snapshots.jboss.org/maven2/</url>
-      <snapshots>
-        <enabled>true</enabled>
-      </snapshots>
-      <releases>
-        <enabled>false</enabled>
-      </releases>
-    </repository>
-    
-  </repositories>
-  
-  <reporting>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-project-info-reports-plugin</artifactId>
-        <reportSets>
-          <reportSet>
-            <reports>
-              <report>dependencies</report>
-              <report>issue-tracking</report>
-              <report>license</report>
-              <report>scm</report>
-            </reports>
-          </reportSet>
-        </reportSets>
-      </plugin>
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>findbugs-maven-plugin</artifactId>
-        <version>1.0.0</version>
-      </plugin>
-    </plugins>
-  </reporting>
-  
-</project>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+   <modelVersion>4.0.0</modelVersion>
+   <parent>
+      <groupId>org.jboss</groupId>
+      <artifactId>jboss-parent</artifactId>
+      <version>5-beta-4</version>
+   </parent>
+
+   <groupId>org.jboss.jsf.integration</groupId>
+   <artifactId>jboss-jsf-int</artifactId>
+   <version>1.0.0-SNAPSHOT</version>
+   <packaging>pom</packaging>
+   <name>JBoss JavaServer Faces Integration</name>
+   <url>http://jsf.jboss.org/</url>
+   <description>
+      JBoss JavaServer Faces Integration
+   </description>
+   <scm>
+      <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/jboss-jsf-int/trunk/</connection>
+      <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/jboss-jsf-int/trunk/</developerConnection>
+      <url>http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/projects/jboss-jsf-int/trunk/</url>
+   </scm>
+
+   <properties>
+      <jsf12-version>1.2_14</jsf12-version>
+      <jsf20-version>2.0.2-FCS</jsf20-version>
+   </properties>
+
+   <modules>
+      <module>jboss-faces</module> <!-- This must be done before jsf-deployer -->
+      <module>jsf-deployer</module>
+      <module>testwar</module>
+      <module>jsf12test</module>
+      <module>jsf20test</module>
+      <module>jsfbundledtest</module>
+     <!-- <module>cargo</module> -->
+   </modules>
+
+   <dependencyManagement>
+      <dependencies>
+         <dependency>
+            <groupId>org.jboss.deployers</groupId>
+            <artifactId>jboss-deployers-vfs</artifactId>
+            <version>2.2.0.Alpha4</version>
+         </dependency>
+
+         <dependency>
+            <groupId>org.jboss</groupId>
+            <artifactId>jboss-vfs</artifactId>
+            <version>3.0.0.CR5</version>
+         </dependency>
+
+         <dependency>
+            <groupId>org.jboss.metadata</groupId>
+            <artifactId>jboss-metadata</artifactId>
+            <version>1.0.4</version>
+         </dependency>
+
+         <dependency>
+            <groupId>org.jboss.jbossas</groupId>
+            <artifactId>jboss-as-tomcat</artifactId>
+            <version>6.0.0.20100216-M2</version>
+         </dependency>
+
+         <dependency>
+            <groupId>javax.validation</groupId>
+            <artifactId>validation-api</artifactId>
+            <version>1.0.0.GA</version>
+         </dependency>
+
+         <dependency>
+            <groupId>org.jboss.jsfunit</groupId>
+            <artifactId>jboss-jsfunit-core</artifactId>
+            <version>1.2.0.Final</version>
+         </dependency>
+
+         <dependency>
+            <groupId>org.apache.myfaces.core</groupId>
+            <artifactId>myfaces-api</artifactId>
+            <version>1.1.6</version>
+         </dependency>
+
+         <dependency>
+            <groupId>org.apache.myfaces.core</groupId>
+            <artifactId>myfaces-impl</artifactId>
+            <version>1.1.6</version>
+         </dependency>
+
+         <dependency>
+            <groupId>javax.faces</groupId>
+            <artifactId>jsf-api</artifactId>
+            <version>${jsf20-version}</version>
+         </dependency>
+
+         <dependency>
+            <groupId>javax.faces</groupId>
+            <artifactId>jsf-impl</artifactId>
+            <version>${jsf20-version}</version>
+         </dependency>
+
+         <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+            <version>2.5</version>
+         </dependency>
+
+         <dependency>
+            <groupId>apache-log4j</groupId>
+            <artifactId>log4j</artifactId>
+            <version>1.2.14</version>
+         </dependency>
+
+         <dependency>
+            <groupId>org.jboss.jbossas</groupId>
+            <artifactId>jboss-as-server</artifactId>
+            <version>6.0.0-SNAPSHOT</version>
+         </dependency>
+      </dependencies>
+   </dependencyManagement>
+
+   <build>
+      <finalName>${artifactId}</finalName>
+      <defaultGoal>install</defaultGoal>
+
+      <plugins>
+         <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-compiler-plugin</artifactId>
+            <version>2.0.2</version>
+            <configuration>
+               <source>1.5</source>
+               <target>1.5</target>
+               <showDeprecation>true</showDeprecation>
+               <showWarnings>true</showWarnings>
+               <optimize>true</optimize>
+            </configuration>
+         </plugin>
+
+         <plugin>
+            <groupId>org.codehaus.cargo</groupId>
+            <artifactId>cargo-maven2-plugin</artifactId>
+            <version>1.0.1-alpha-2</version>
+         </plugin>
+      </plugins>
+
+   </build>
+
+   <repositories>
+      <repository>
+         <id>repository.jboss.org</id>
+         <name>JBoss Repository</name>
+         <layout>default</layout>
+         <url>http://repository.jboss.org/maven2/</url>
+         <snapshots>
+            <enabled>false</enabled>
+         </snapshots>
+      </repository>
+      <repository>
+         <id>snapshots.jboss.org</id>
+         <name>JBoss Snapshots Repository</name>
+         <layout>default</layout>
+         <url>http://snapshots.jboss.org/maven2/</url>
+         <snapshots>
+            <enabled>true</enabled>
+         </snapshots>
+         <releases>
+            <enabled>false</enabled>
+         </releases>
+      </repository>
+
+   </repositories>
+
+   <reporting>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-project-info-reports-plugin</artifactId>
+            <reportSets>
+               <reportSet>
+                  <reports>
+                     <report>dependencies</report>
+                     <report>issue-tracking</report>
+                     <report>license</report>
+                     <report>scm</report>
+                  </reports>
+               </reportSet>
+            </reportSets>
+         </plugin>
+         <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>findbugs-maven-plugin</artifactId>
+            <version>1.0.0</version>
+         </plugin>
+      </plugins>
+   </reporting>
+
+</project>




More information about the jboss-cvs-commits mailing list