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

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sun Mar 29 16:32:31 EDT 2009


Author: stan.silvert at jboss.com
Date: 2009-03-29 16:32:30 -0400 (Sun, 29 Mar 2009)
New Revision: 86446

Added:
   projects/jboss-jsf-int/trunk/cargo/
   projects/jboss-jsf-int/trunk/cargo/pom.xml
   projects/jboss-jsf-int/trunk/cargo/src/
   projects/jboss-jsf-int/trunk/cargo/src/test/
   projects/jboss-jsf-int/trunk/cargo/src/test/java/
   projects/jboss-jsf-int/trunk/cargo/src/test/java/org/
   projects/jboss-jsf-int/trunk/cargo/src/test/java/org/jboss/
   projects/jboss-jsf-int/trunk/cargo/src/test/java/org/jboss/jsf/
   projects/jboss-jsf-int/trunk/cargo/src/test/java/org/jboss/jsf/integration/
   projects/jboss-jsf-int/trunk/cargo/src/test/java/org/jboss/jsf/integration/test/
   projects/jboss-jsf-int/trunk/cargo/src/test/java/org/jboss/jsf/integration/test/DeployBundledJSFTest.java
   projects/jboss-jsf-int/trunk/cargo/src/test/java/org/jboss/jsf/integration/test/DeployJSF12Test.java
   projects/jboss-jsf-int/trunk/jsf-deployer/
   projects/jboss-jsf-int/trunk/jsf-deployer/pom.xml
   projects/jboss-jsf-int/trunk/jsf-deployer/src/
   projects/jboss-jsf-int/trunk/jsf-deployer/src/main/
   projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/
   projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/
   projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/
   projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/
   projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/
   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/config/FaceletsLoggers.java
   projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/config/JBossJSFConfigureListener.java
   projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/config/Log4JConversionFilter.java
   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/injection/JBossDelegatingInjectionProvider.java
   projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/injection/JBossInjectionProvider.java
   projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/injection/JBossScanningInjectionProvider.java
   projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/serialization/
   projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/serialization/JBossFacesObjectInputStream.java
   projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/serialization/JBossSerializationProvider.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/jsf12test/
   projects/jboss-jsf-int/trunk/jsf12test/pom.xml
   projects/jboss-jsf-int/trunk/jsf12test/src/
   projects/jboss-jsf-int/trunk/jsf12test/src/main/
   projects/jboss-jsf-int/trunk/jsf12test/src/main/webapp/
   projects/jboss-jsf-int/trunk/jsf12test/src/main/webapp/WEB-INF/
   projects/jboss-jsf-int/trunk/jsf12test/src/main/webapp/WEB-INF/web.xml
   projects/jboss-jsf-int/trunk/jsf20test/
   projects/jboss-jsf-int/trunk/jsf20test/pom.xml
   projects/jboss-jsf-int/trunk/jsf20test/src/
   projects/jboss-jsf-int/trunk/jsf20test/src/main/
   projects/jboss-jsf-int/trunk/jsf20test/src/main/java/
   projects/jboss-jsf-int/trunk/jsf20test/src/main/webapp/
   projects/jboss-jsf-int/trunk/jsf20test/src/main/webapp/WEB-INF/
   projects/jboss-jsf-int/trunk/jsf20test/src/main/webapp/WEB-INF/web.xml
   projects/jboss-jsf-int/trunk/jsfbundledtest/
   projects/jboss-jsf-int/trunk/jsfbundledtest/pom.xml
   projects/jboss-jsf-int/trunk/jsfbundledtest/src/
   projects/jboss-jsf-int/trunk/jsfbundledtest/src/main/
   projects/jboss-jsf-int/trunk/jsfbundledtest/src/main/webapp/
   projects/jboss-jsf-int/trunk/jsfbundledtest/src/main/webapp/WEB-INF/
   projects/jboss-jsf-int/trunk/jsfbundledtest/src/main/webapp/WEB-INF/web.xml
   projects/jboss-jsf-int/trunk/pom.xml
   projects/jboss-jsf-int/trunk/testwar/
   projects/jboss-jsf-int/trunk/testwar/pom.xml
   projects/jboss-jsf-int/trunk/testwar/src/
   projects/jboss-jsf-int/trunk/testwar/src/main/
   projects/jboss-jsf-int/trunk/testwar/src/main/java/
   projects/jboss-jsf-int/trunk/testwar/src/main/webapp/
   projects/jboss-jsf-int/trunk/testwar/src/main/webapp/WEB-INF/
   projects/jboss-jsf-int/trunk/testwar/src/main/webapp/WEB-INF/faces-config.xml
   projects/jboss-jsf-int/trunk/testwar/src/main/webapp/WEB-INF/web.xml
   projects/jboss-jsf-int/trunk/testwar/src/main/webapp/index.html
   projects/jboss-jsf-int/trunk/testwar/src/main/webapp/index.jsp
Log:
JBAS-6638 Move JSF integration into a deployer - initial project code


Added: projects/jboss-jsf-int/trunk/cargo/pom.xml
===================================================================
--- projects/jboss-jsf-int/trunk/cargo/pom.xml	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/cargo/pom.xml	2009-03-29 20:32:30 UTC (rev 86446)
@@ -0,0 +1,202 @@
+<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-jsf-deployer-cargo</artifactId>
+  <packaging>jar</packaging>
+  <name>JBoss JSF Deployer Test Environment</name>
+  <description>Use Cargo to deploy and test WARs for different JSF versions</description>
+  
+  <dependencies>
+    <dependency>
+       <groupId>org.jboss.jsfunit</groupId>
+       <artifactId>jboss-jsfunit-core</artifactId>
+       <scope>provided</scope>
+    </dependency>
+    
+    <dependency>
+       <groupId>org.jboss.jsf.integration</groupId>
+       <artifactId>jboss-jsf-12test</artifactId>
+       <version>${project.version}</version>
+       <scope>test</scope>
+       <type>war</type>
+    </dependency>
+    
+    <dependency>
+       <groupId>org.jboss.jsf.integration</groupId>
+       <artifactId>jboss-jsf-jsfbundledtest</artifactId>
+       <version>${project.version}</version>
+       <scope>test</scope>
+       <type>war</type>
+    </dependency>
+    
+  </dependencies>
+
+  <build>
+    <finalName>${artifactId}</finalName>
+    <sourceDirectory>src/test/java</sourceDirectory>
+    <testSourceDirectory>src/test/java</testSourceDirectory>
+    
+    <plugins>
+       <plugin>
+         <groupId>org.apache.maven.plugins</groupId>
+         <artifactId>maven-surefire-plugin</artifactId>
+         <configuration>
+          <skip>true</skip>
+         </configuration>
+
+         <executions>
+           <execution>
+             <id>surefire-it</id>
+             <phase>integration-test</phase>
+             <goals>
+               <goal>test</goal>
+             </goals>
+             <configuration>
+               <skip>false</skip>
+             </configuration>
+           </execution>
+         </executions>
+       </plugin>
+       
+       <plugin>
+            <groupId>org.codehaus.cargo</groupId>
+            <artifactId>cargo-maven2-plugin</artifactId>
+            <configuration>
+              <wait>false</wait>  
+              <configuration>    
+                <home>${project.build.directory}/cargoconfig</home>
+                
+                <files>
+                  <copy>
+                    <file>${project.build.directory}/cargoconfig/conf/bootstrap-norepo.xml</file>
+                    <tofile>conf/bootstrap.xml</tofile>
+                    <configfile>false</configfile>
+                    <overwrite>true</overwrite>
+                  </copy>
+                  <copy>
+                    <file>${project.build.directory}/dependency/jboss-jsfunit-microdeployer.jar</file>
+                    <todir>deployers</todir>
+                    <configfile>false</configfile>
+                    <overwrite>true</overwrite>
+                  </copy>
+                  <copy>
+                     <file>${project.build.directory}/classes</file>
+                     <todir>jsfunitTests</todir>
+                     <configfile>false</configfile>
+                     <overwrite>true</overwrite>
+                  </copy>
+                  <copy>
+                     <file>${project.build.directory}/jsf.deployer</file>
+                     <todir>deployers/jsf.deployer</todir>
+                     <configfile>false</configfile>
+                     <overwrite>true</overwrite>
+                  </copy>
+                </files>
+                
+                <deployables>
+                  <deployable>
+                    <location>${project.build.directory}/dependency/jboss-jsf-12test-jsfunit.war</location>
+                    <type>war</type>
+                  </deployable>
+                  <deployable>
+                    <location>${project.build.directory}/dependency/jboss-jsf-jsfbundledtest-jsfunit.war</location>
+                    <type>war</type>
+                  </deployable>
+                </deployables>
+              </configuration>
+              <container>
+                <containerId>jboss5x</containerId>
+                <timeout>150000</timeout>  <!-- 2.5 minutes -->
+                <home>${JBOSS_HOME}</home>
+                <log>${basedir}/target/jboss5.x/cargo.log</log>
+                <output>${basedir}/target/jboss5.x/container.log</output>
+              </container>
+            </configuration>
+            <executions>
+              <execution>
+                <id>start-container</id>
+                <phase>pre-integration-test</phase>
+                <goals>
+                  <goal>start</goal>
+                </goals>
+              </execution>
+              <execution>
+                <id>stop-container</id>
+                <phase>post-integration-test</phase>
+                <goals>
+                  <goal>stop</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+          
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-dependency-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>copy-dependencies</id>
+                  <phase>package</phase>
+                  <goals>
+                     <goal>copy</goal>
+                  </goals>
+                  <configuration>
+                     <artifactItems>
+                        <artifactItem>
+                           <groupId>org.jboss.jsf.integration</groupId>
+                           <artifactId>jboss-jsf-12test</artifactId>
+                           <version>${project.version}</version>
+                           <type>war</type>
+                           <destFileName>jboss-jsf-12test-jsfunit.war</destFileName>
+                        </artifactItem>
+                        <artifactItem>
+                           <groupId>org.jboss.jsf.integration</groupId>
+                           <artifactId>jboss-jsf-jsfbundledtest</artifactId>
+                           <version>${project.version}</version>
+                           <type>war</type>
+                           <destFileName>jboss-jsf-jsfbundledtest-jsfunit.war</destFileName>
+                        </artifactItem>
+                        <artifactItem>
+                           <groupId>org.jboss.jsfunit</groupId>
+                           <artifactId>jboss-jsfunit-microdeployer</artifactId>
+                           <version>1.0.0.GA</version>
+                           <type>jar</type>
+                           <destFileName>jboss-jsfunit-microdeployer.jar</destFileName>
+                        </artifactItem>
+                     </artifactItems>
+                  </configuration>
+               </execution>
+               <execution>
+                <id>unpack</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>unpack</goal>
+                </goals>
+                <configuration>
+                  <artifactItems>
+                    <artifactItem>
+                      <groupId>org.jboss.jsf.integration</groupId>
+                      <artifactId>jboss-jsf-deployer</artifactId>
+                      <version>${project.version}</version>
+                      <type>jar</type>
+                      <overWrite>false</overWrite>
+                      <outputDirectory>${project.build.directory}/jsf.deployer</outputDirectory>
+                      <includes>**/*.class,**/*.xml</includes>
+                      <excludes>META-INF/maven/**</excludes>
+                    </artifactItem>
+                  </artifactItems>
+                  
+                </configuration>
+              </execution>
+
+            </executions>
+         </plugin>
+     </plugins>
+  </build>
+  
+</project>

Added: projects/jboss-jsf-int/trunk/cargo/src/test/java/org/jboss/jsf/integration/test/DeployBundledJSFTest.java
===================================================================
--- projects/jboss-jsf-int/trunk/cargo/src/test/java/org/jboss/jsf/integration/test/DeployBundledJSFTest.java	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/cargo/src/test/java/org/jboss/jsf/integration/test/DeployBundledJSFTest.java	2009-03-29 20:32:30 UTC (rev 86446)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.integration.test;
+
+import java.io.IOException;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.apache.cactus.ServletTestCase;
+import org.jboss.jsfunit.framework.Environment;
+import org.jboss.jsfunit.jsfsession.JSFSession;
+
+/**
+ * This tests bundling the JSF implementation with the WAR.  It uses 
+ * MyFaces 1.1.
+ * 
+ * @author Stan Silvert
+ */
+public class DeployBundledJSFTest extends ServletTestCase
+{
+   public DeployBundledJSFTest()
+   {
+      System.setProperty("cactus.contextURL", "http://localhost:8080/jboss-jsf-jsfbundledtest-jsfunit");
+   }
+   
+   public void setUp() throws IOException
+   {
+      JSFSession jsfSession = new JSFSession("/index.faces");
+   }
+   
+   /**
+    * @return the suite of tests being tested
+    */
+   public static Test suite()
+   {
+      return new TestSuite(DeployBundledJSFTest.class);
+   }
+   
+   public void testRunningInJSF11()
+   {
+      assertEquals(1, Environment.getJSFMajorVersion());
+      assertEquals(1, Environment.getJSFMinorVersion());
+      assertFalse(Environment.is12Compatible());
+   }
+   
+      
+}

Added: projects/jboss-jsf-int/trunk/cargo/src/test/java/org/jboss/jsf/integration/test/DeployJSF12Test.java
===================================================================
--- projects/jboss-jsf-int/trunk/cargo/src/test/java/org/jboss/jsf/integration/test/DeployJSF12Test.java	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/cargo/src/test/java/org/jboss/jsf/integration/test/DeployJSF12Test.java	2009-03-29 20:32:30 UTC (rev 86446)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.integration.test;
+
+import java.io.IOException;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.apache.cactus.ServletTestCase;
+import org.jboss.jsfunit.framework.Environment;
+import org.jboss.jsfunit.jsfsession.JSFSession;
+
+/**
+ * The JSFUnit Environment class allows you to programatically find which version
+ * of JSF you are running.  Because this is the test for the Environment class,
+ * the JSF version is known beforehand and loaded via a properties file.
+ * 
+ * @author Stan Silvert
+ */
+public class DeployJSF12Test extends ServletTestCase
+{
+   public DeployJSF12Test()
+   {
+      System.setProperty("cactus.contextURL", "http://localhost:8080/jboss-jsf-12test-jsfunit");
+   }
+   
+   public void setUp() throws IOException
+   {
+      JSFSession jsfSession = new JSFSession("/index.faces");
+   }
+   
+   /**
+    * @return the suite of tests being tested
+    */
+   public static Test suite()
+   {
+      return new TestSuite( DeployJSF12Test.class  );
+   }
+   
+   public void testRunningInJSF12()
+   {
+      assertEquals(1, Environment.getJSFMajorVersion());
+      assertEquals(2, Environment.getJSFMinorVersion());
+      assertTrue(Environment.is12Compatible());
+   }
+   
+      
+}

Added: projects/jboss-jsf-int/trunk/jsf-deployer/pom.xml
===================================================================
--- projects/jboss-jsf-int/trunk/jsf-deployer/pom.xml	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/jsf-deployer/pom.xml	2009-03-29 20:32:30 UTC (rev 86446)
@@ -0,0 +1,62 @@
+<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-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.metadata</groupId>
+      <artifactId>jboss-metadata</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/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	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/JSFDeployer.java	2009-03-29 20:32:30 UTC (rev 86446)
@@ -0,0 +1,264 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, 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.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 Collection<String> facesServlets;
+   
+   private Web25MetaData jsfunitWebMD;
+   private boolean disabled = false;
+   
+   private String defaultJSFImplementation;
+   private Map<String,String> jsfImplementations;
+
+   /**
+    * 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);
+      
+      // only need to do this once for each JSF profile
+      parseJSFImplWebMetaData();
+      
+      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()
+   {
+      // Parse JSFUnit web.xml
+      Unmarshaller unmarshaller = factory.newUnmarshaller();
+      URL webXml = this.getClass().getClassLoader().getResource("META-INF/web.xml");
+      if (webXml == null)
+         throw new IllegalStateException("Unable to find jsfunit web.xml");
+      
+      SchemaBinding schema = JBossXBBuilder.build(Web25MetaData.class);
+      
+      try
+      {
+         this.jsfunitWebMD = (Web25MetaData) unmarshaller.unmarshal(webXml.toString(), schema);
+      }
+      catch (JBossXBException e)
+      {
+         this.disabled = true;
+         log.error("Unable to parse jsfunit web.xml", 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> jsfImplementations)
+   {
+      this.jsfImplementations = jsfImplementations;
+   }
+   
+   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;
+   }
+   
+   @Override
+   public void deploy(VFSDeploymentUnit unit, JBossWebMetaData metaData) throws DeploymentException
+   {
+      if (!isJSFDeployment(metaData)) return;
+      if (disabled)
+      {
+         log.warn(unit.getSimpleName() + " could not be deployed.  JSF Deployer disabled from previous errors.");
+         return;
+      }
+      
+      //mergeWebXml(metaData);
+
+  /*    try
+      {
+         addClasspaths(unit);
+      }
+      catch (MalformedURLException e)
+      {
+         throw DeploymentException.rethrowAsDeploymentException("Malformed URL", e);
+      }  */
+      
+      log.info("Added JSF to " + unit.getName());
+   }
+ /*  
+   private void addClasspaths(VFSDeploymentUnit unit) throws MalformedURLException
+   {
+      if (classpathUrls == null) return;
+      
+      for (String testUrl : classpathUrls)
+      {
+         testUrl = StringPropertyReplacer.replaceProperties(testUrl);
+         URL url = new URL(testUrl);
+         
+         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))
+               {
+                  unit.addClassPath(jarFile);
+               }
+            }
+         }
+         catch (IOException e)
+         {
+            log.warn("Unable to add URL to classpath: " + url.toString());
+         }
+      }
+   } */
+   
+   // merge JSFUnit's web.xml with the WAR's web.xml
+   private void mergeWebXml(JBossWebMetaData metaData)
+   {
+      FiltersMetaData filters = metaData.getFilters();
+      if (filters == null) filters = new FiltersMetaData();
+      filters.addAll(jsfunitWebMD.getFilters());
+      metaData.setFilters(filters);
+      
+      List<FilterMappingMetaData> filterMappings = metaData.getFilterMappings();
+      if (filterMappings == null) filterMappings = new ArrayList<FilterMappingMetaData>();
+      filterMappings.addAll(jsfunitWebMD.getFilterMappings());
+      metaData.setFilterMappings(filterMappings);
+      
+      JBossServletsMetaData servlets = metaData.getServlets();
+      if (servlets == null) servlets = new JBossServletsMetaData();
+      ServletsMetaData servletsMD = jsfunitWebMD.getServlets();
+      servlets.addAll(makeJBossServletsMetaData(servletsMD));
+      metaData.setServlets(servlets);
+      
+      List<ServletMappingMetaData> servletMappings = metaData.getServletMappings();
+      if (servletMappings == null) servletMappings = new ArrayList<ServletMappingMetaData>();
+      servletMappings.addAll(jsfunitWebMD.getServletMappings());
+      metaData.setServletMappings(servletMappings);
+      
+      List<ParamValueMetaData> contextParams = metaData.getContextParams();
+      if (contextParams == null) contextParams = new ArrayList<ParamValueMetaData>();
+      contextParams.addAll(jsfunitWebMD.getContextParams());
+      metaData.setContextParams(contextParams);
+      
+      List<ListenerMetaData> listeners = metaData.getListeners();
+      if (listeners == null) listeners = new ArrayList<ListenerMetaData>();
+      listeners.addAll(jsfunitWebMD.getListeners());
+      metaData.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/integration/config/FaceletsLoggers.java
===================================================================
--- projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/config/FaceletsLoggers.java	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/config/FaceletsLoggers.java	2009-03-29 20:32:30 UTC (rev 86446)
@@ -0,0 +1,166 @@
+/*
+ * 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.jsf.integration.config;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Member;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.logging.Logger;
+
+/**
+ * This class provides access to the loggers used by Facelets version 1.1.15.
+ *
+ * @author Stan Silvert
+ * @author Pete Muir
+ */
+public class FaceletsLoggers 
+{
+    
+   // Don't allow an instance of this class
+   private FaceletsLoggers() {}
+    
+   /**
+    * Determine if Facelets is in the classpath.
+    *
+    * @return <code>true</code> if Facelets is available,
+    *         <code>false</code> otherwise.
+    */
+   public static boolean isFaceletsAvailable()
+   {
+      try
+      {
+         classForName("com.sun.facelets.Facelet");
+         return true;
+      } 
+      catch (ClassNotFoundException e)
+      {
+         return false;
+      }
+   }
+   
+   /**
+    * Return an Iterator of all the java.util.logging.Logger objects used
+    * in Facelets.
+    *
+    * @return The Loggers, or an empty Iterator if Facelets is not available.
+    */
+   public static Iterator<Logger> getLoggers() throws Exception
+   {
+      List<Logger> loggers = new ArrayList<Logger>();
+      
+      if (!isFaceletsAvailable()) return loggers.iterator();
+      
+      // Gah have to do this by reflection as the loggers are protected
+         
+      // And some aren't static, so this really is best effort
+      loggers.add(getPrivateStaticLogger("com.sun.facelets.compiler.TagLibraryConfig", "log"));
+      loggers.add(getPrivateStaticLogger("com.sun.facelets.compiler.Compiler", "log"));
+      loggers.add(getPrivateStaticLogger("com.sun.facelets.impl.DefaultFaceletFactory", "log"));
+      loggers.add(getPrivateStaticLogger("com.sun.facelets.tag.jsf.ComponentHandler", "log"));
+      loggers.add(getPrivateStaticLogger("com.sun.facelets.util.Resource", "log"));
+      loggers.add(getPrivateStaticLogger("com.sun.facelets.FaceletViewHandler", "log"));
+
+      // These ones are in a package-scoped class
+      loggers.add(getPrivateStaticLogger("com.sun.facelets.compiler.CompilationManager", "log"));
+      loggers.add(getPrivateStaticLogger("com.sun.facelets.tag.jsf.ComponentRule", "log"));
+      loggers.add(getPrivateStaticLogger("com.sun.facelets.tag.MetaRulesetImpl", "log"));
+         
+      return loggers.iterator();
+   }
+   
+   private static Logger getPrivateStaticLogger(Class clazz, String fieldName) throws Exception 
+   {
+      Field field = getField(clazz, fieldName);
+      field.setAccessible(true);
+      return (Logger) get(field, new Object());
+   }
+   
+   private static Logger getPrivateStaticLogger(String className, String fieldName) throws Exception
+   {
+      return getPrivateStaticLogger(classForName(className), fieldName);
+   }
+   
+   // Code copied from org.jboss.seam.util.Reflctions
+   private static Object get(Field field, Object target) throws Exception
+   {
+      try
+      {
+         return field.get(target);
+      }
+      catch (IllegalArgumentException iae)
+      {
+         String message = "Could not get field value by reflection: " + toString(field) + 
+            " on: " + target.getClass().getName();
+         throw new IllegalArgumentException(message, iae);
+      }
+   }
+   
+   // Code copied from org.jboss.seam.util.Reflctions
+   private static Field getField(Class clazz, String name)
+   {
+      for ( Class superClass = clazz; superClass!=Object.class; superClass=superClass.getSuperclass() )
+      {
+         try
+         {
+            return superClass.getDeclaredField(name);
+         }
+         catch (NoSuchFieldException nsfe) {}
+      }
+      throw new IllegalArgumentException("no such field: " + clazz.getName() + '.' + name);
+   }
+   
+   // Code copied from org.jboss.seam.util.Reflctions
+   private static Class classForName(String name) throws ClassNotFoundException
+   {
+      try 
+      {
+         return Thread.currentThread().getContextClassLoader().loadClass(name);
+      }
+      catch (Exception e)
+      {
+         return Class.forName(name);
+      }
+   }
+   
+   // Code copied from org.jboss.seam.util.Reflctions
+   private static String toString(Member member)
+   {
+      return unqualify( member.getDeclaringClass().getName() ) + 
+            '.' + 
+            member.getName();
+   }
+   
+   // Code copied from org.jboss.seam.util.Strings
+   private static String unqualify(String name)
+   {
+      return unqualify(name, '.');
+   }
+   
+   // Code copied from org.jboss.seam.util.Strings
+   private static String unqualify(String name, char sep)
+   {
+      return name.substring( name.lastIndexOf(sep)+1, name.length() );
+   }
+   
+}

Added: projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/config/JBossJSFConfigureListener.java
===================================================================
--- projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/config/JBossJSFConfigureListener.java	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/config/JBossJSFConfigureListener.java	2009-03-29 20:32:30 UTC (rev 86446)
@@ -0,0 +1,228 @@
+/*
+ * 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.jsf.integration.config;
+
+import com.sun.faces.config.ConfigureListener;
+import com.sun.faces.util.FacesLogger;
+import java.util.Iterator;
+import java.util.logging.Filter;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletContextEvent;
+import org.apache.log4j.Level;
+import org.jboss.logging.Logger;
+
+/**
+ * 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
+ */
+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);
+    
+    public static final String BASE_JSF_LOGGER = "javax.enterprise.resource.webcontainer.jsf";
+    
+    public static final String SHOULD_LOG_CONFIG_MESSAGES = "com.sun.faces.displayConfiguration";
+    
+    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;
+  
+// JBAS-6475, with the update to jboss-log-bridge this is not need
+//        // If the pluginClass is not set, assume Log4J
+//        if (System.getProperty("org.jboss.logging.Logger.pluginClass") == null) 
+//        {
+//            setLog4J();
+//            setLog4JForFacelets();
+//        }
+
+        checkForMyFaces();
+        initializeJspRuntime();
+        initialized = true;
+        super.contextInitialized(event);
+    }
+    
+    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
+        }
+    }
+
+    /**
+     * For a given JSF julLogger find the logging level set to the
+     * corresponding log4jLogger.  Then set the julLogger to the
+     * same level as the log4jLogger.
+     *
+     * At this point we know that Log4J is being used.  So we can
+     * reference a real Log4J logger instead of the JBoss one.
+     */
+    private void setLevel(java.util.logging.Logger julLogger)
+    {
+        org.apache.log4j.Logger log4jLogger = 
+            org.apache.log4j.Logger.getLogger(julLogger.getName());
+
+        julLogger.setLevel(java.util.logging.Level.OFF);
+
+        if (log4jLogger.isEnabledFor(Level.FATAL))
+            julLogger.setLevel(java.util.logging.Level.SEVERE);
+
+        if (log4jLogger.isEnabledFor(Level.ERROR))
+            julLogger.setLevel(java.util.logging.Level.SEVERE);
+
+        if (log4jLogger.isEnabledFor(Level.WARN))
+            julLogger.setLevel(java.util.logging.Level.WARNING);
+
+        if (log4jLogger.isEnabledFor(Level.INFO))
+            julLogger.setLevel(java.util.logging.Level.INFO);
+ 
+        if (log4jLogger.isEnabledFor(Level.DEBUG)) 
+            julLogger.setLevel(java.util.logging.Level.FINE);
+
+        if (log4jLogger.isEnabledFor(Level.TRACE))
+            julLogger.setLevel(java.util.logging.Level.FINEST);
+
+        if (log4jLogger.isEnabledFor(Level.ALL))
+            julLogger.setLevel(java.util.logging.Level.ALL);
+    }
+
+    private void setLog4JForFacelets()
+    {
+       Filter conversionFilter = new Log4JConversionFilter(logConfigMessages());
+
+       try
+       {  // if Facelets is not used, getLoggers() returns an empty Iterator
+          for (Iterator<java.util.logging.Logger> loggers = FaceletsLoggers.getLoggers(); loggers.hasNext();)
+          {
+             java.util.logging.Logger julLogger = loggers.next();
+             setLevel(julLogger);
+             julLogger.setFilter(conversionFilter);
+          }
+       }
+       catch (Exception e)
+       {
+          LOG.warn("Unable to convert Facelets logging to Log4J", e);
+       }
+    }
+    
+    /**
+     * If Log4J is being used, set a filter that converts JSF RI java.util.logger
+     * messages to Log4J messages.
+     */
+    private void setLog4J() 
+    {
+        Filter conversionFilter = new Log4JConversionFilter(logConfigMessages());
+
+        java.util.logging.Logger julLogger = java.util.logging.Logger.getLogger(BASE_JSF_LOGGER);
+        setLevel(julLogger);
+        julLogger.setFilter(conversionFilter);
+
+        julLogger = FacesLogger.APPLICATION.getLogger();
+        setLevel(julLogger);
+        julLogger.setFilter(conversionFilter);
+
+        julLogger = FacesLogger.CONFIG.getLogger();
+        setLevel(julLogger);
+        julLogger.setFilter(conversionFilter);
+
+        julLogger = FacesLogger.CONTEXT.getLogger();
+        setLevel(julLogger);
+        julLogger.setFilter(conversionFilter);
+
+        julLogger = FacesLogger.LIFECYCLE.getLogger();
+        setLevel(julLogger);
+        julLogger.setFilter(conversionFilter);
+        
+        julLogger = FacesLogger.MANAGEDBEAN.getLogger();
+        setLevel(julLogger);
+        julLogger.setFilter(conversionFilter);
+
+        julLogger = FacesLogger.RENDERKIT.getLogger();
+        setLevel(julLogger);
+        julLogger.setFilter(conversionFilter);
+
+        julLogger = FacesLogger.TAGLIB.getLogger();
+        setLevel(julLogger);
+        julLogger.setFilter(conversionFilter);
+        
+        julLogger = FacesLogger.TIMING.getLogger();
+        setLevel(julLogger);
+        julLogger.setFilter(conversionFilter);
+    }
+    
+    // should we log the configuration messages?
+    private boolean logConfigMessages() 
+    {
+        String shouldLogConfigParam = this.servletContext.getInitParameter(SHOULD_LOG_CONFIG_MESSAGES);
+        return (shouldLogConfigParam != null) && (shouldLogConfigParam.equalsIgnoreCase("true"));
+    }
+    
+}

Added: projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/config/Log4JConversionFilter.java
===================================================================
--- projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/config/Log4JConversionFilter.java	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/config/Log4JConversionFilter.java	2009-03-29 20:32:30 UTC (rev 86446)
@@ -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.jsf.integration.config;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.logging.Filter;
+import java.util.logging.Formatter;
+import java.util.logging.Level;
+import java.util.logging.LogRecord;
+import java.util.logging.SimpleFormatter;
+import org.jboss.logging.Logger;
+
+/**
+ * This filter is used to convert java.util.logging messages from the JSF RI
+ * to Log4J messages.
+ *
+ * @author Stan Silvert
+ */
+public class Log4JConversionFilter implements Filter 
+{
+    
+    // cache Logger instances.  Logger.getLogger() is known to be slow.
+    // See http://www.qos.ch/logging/thinkAgain.jsp
+    private Map<String, Logger> loggerCache = new HashMap<String, Logger>();
+    
+    private Formatter formatter = new SimpleFormatter();
+    
+    // should we log the INFO level config messages that tell about
+    // servlet context params?
+    private boolean logConfigMessages;
+    
+    public Log4JConversionFilter(boolean logConfigMessages) 
+    {
+        this.logConfigMessages = logConfigMessages;
+    }
+    
+    private boolean isConfigStartupMessage(LogRecord record) 
+    {
+        return record.getMessage().equals("jsf.config.listener.version") ||
+               record.getMessage().equals("jsf.config.listener.version.complete");
+    }
+    
+    /**
+     * If the JSF RI message should be logged, convert the JDK 1.4 
+     * LogRecord to a Log4J message.
+     *
+     * @return <code>false</code> because JDK 1.4 logging should not happen
+     *         for JSF if this filter is active.
+     */
+    public boolean isLoggable(LogRecord record) 
+    {
+        if (!logConfigMessages && isConfigStartupMessage(record)) return false;
+        
+        Logger logger = getLogger(record);
+        
+        if (record.getThrown() != null) 
+        {
+            logWithThrowable(logger, record);
+        } 
+        else 
+        {
+            logWithoutThrowable(logger, record);
+        }
+        
+        return false;
+    }
+    
+    private void logWithThrowable(Logger logger, LogRecord record) 
+    {
+        int loggedLevel = record.getLevel().intValue();
+        Object message = formatter.formatMessage(record);
+        Throwable throwable = record.getThrown();
+        
+        if (loggedLevel == Level.SEVERE.intValue())
+        {
+           logger.error(message, throwable);
+           return;
+        }
+
+        if (loggedLevel == Level.WARNING.intValue())
+        {
+           logger.warn(message, throwable);
+           return;
+        }
+
+        if ((loggedLevel == Level.INFO.intValue()) ||
+            (loggedLevel == Level.CONFIG.intValue()))
+        {
+           logger.info(message, throwable);
+           return;
+        }
+        
+        if (loggedLevel == Level.FINE.intValue())
+        {
+           logger.debug(message, throwable);
+           return;
+        }
+
+        if ((loggedLevel == Level.FINER.intValue()) ||
+            (loggedLevel == Level.FINEST.intValue()))
+        {
+           logger.trace(message, throwable);
+           return;
+        }
+    
+        logger.info(message, throwable);
+    }
+    
+    private void logWithoutThrowable(Logger logger, LogRecord record) 
+    {
+        int loggedLevel = record.getLevel().intValue();
+        Object message = formatter.formatMessage(record);
+        
+        if (loggedLevel == Level.SEVERE.intValue())
+        {
+           logger.error(message);
+           return;
+        }
+
+        if (loggedLevel == Level.WARNING.intValue())
+        {
+           logger.warn(message);
+           return;
+        }
+
+        if ((loggedLevel == Level.INFO.intValue()) ||
+            (loggedLevel == Level.CONFIG.intValue()))
+        {
+           logger.info(message);
+           return;
+        }
+        
+        if (loggedLevel == Level.FINE.intValue())
+        {
+           logger.debug(message);
+           return;
+        }
+
+        if ((loggedLevel == Level.FINER.intValue()) ||
+            (loggedLevel == Level.FINEST.intValue()))
+        {
+           logger.trace(message);
+           return;
+        }
+
+        logger.info(message);
+    }
+    
+    // get the Log4J logger corresponding to the java.util.logger.LogRecord
+    private Logger getLogger(LogRecord record) 
+    {
+        String loggerName = record.getLoggerName();
+        Logger logger = loggerCache.get(loggerName);
+        if (logger == null) 
+        {
+            logger = Logger.getLogger(loggerName);
+            loggerCache.put(loggerName, logger);
+        }
+        
+        return logger;
+    }
+    
+}

Added: projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/injection/JBossDelegatingInjectionProvider.java
===================================================================
--- projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/injection/JBossDelegatingInjectionProvider.java	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/injection/JBossDelegatingInjectionProvider.java	2009-03-29 20:32:30 UTC (rev 86446)
@@ -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.jsf.integration.injection;
+
+import javax.faces.context.FacesContext;
+import javax.servlet.ServletContext;
+
+import org.apache.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: 85945 $
+ */
+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/jsf-deployer/src/main/java/org/jboss/jsf/integration/injection/JBossInjectionProvider.java
===================================================================
--- projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/injection/JBossInjectionProvider.java	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/injection/JBossInjectionProvider.java	2009-03-29 20:32:30 UTC (rev 86446)
@@ -0,0 +1,278 @@
+/*
+ * 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.jsf.integration.injection;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+
+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/jsf-deployer/src/main/java/org/jboss/jsf/integration/injection/JBossScanningInjectionProvider.java
===================================================================
--- projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/injection/JBossScanningInjectionProvider.java	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/injection/JBossScanningInjectionProvider.java	2009-03-29 20:32:30 UTC (rev 86446)
@@ -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.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.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: 85945 $
+ */
+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/jsf-deployer/src/main/java/org/jboss/jsf/integration/serialization/JBossFacesObjectInputStream.java
===================================================================
--- projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/serialization/JBossFacesObjectInputStream.java	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/serialization/JBossFacesObjectInputStream.java	2009-03-29 20:32:30 UTC (rev 86446)
@@ -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.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/jsf-deployer/src/main/java/org/jboss/jsf/integration/serialization/JBossSerializationProvider.java
===================================================================
--- projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/serialization/JBossSerializationProvider.java	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/jsf-deployer/src/main/java/org/jboss/jsf/integration/serialization/JBossSerializationProvider.java	2009-03-29 20:32:30 UTC (rev 86446)
@@ -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.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/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	2009-03-29 20:32:30 UTC (rev 86446)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+    JBoss JSF + JBossAS integration
+-->
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+  <!-- JSF deployer -->
+  <bean name="JSFDeployer" class="org.jboss.jsf.integration.JSFDeployer">
+    
+    <!--
+      * 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 where to find the default JSF profile. This should be a directory. 
+    -->
+    <property name="defaultJSFImplementation">
+       <value>Mojarra1.2</value>
+    </property>
+    
+    <!-- 
+      *  Define where to find JSF implementations.  The key is the name
+      *  of the implementation.  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
+      
+      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>Mojarra1.2</key>
+          <value>${jboss.server.home.url}/deployers/jsf.deployer/Mojarra1.2</value>
+        </entry>
+      </map>   
+    </property>
+  </bean>
+
+</deployment>

Added: projects/jboss-jsf-int/trunk/jsf12test/pom.xml
===================================================================
--- projects/jboss-jsf-int/trunk/jsf12test/pom.xml	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/jsf12test/pom.xml	2009-03-29 20:32:30 UTC (rev 86446)
@@ -0,0 +1,29 @@
+<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-jsf-12test</artifactId>
+  <packaging>war</packaging>
+  <name>JBoss JSF Deployer Test for Mojarra 1.2</name>
+  <description>JBoss JSF Deployer Test for Mojarra 1.2</description>
+  
+  <dependencies>
+    <dependency>
+       <groupId>org.jboss.jsf.integration</groupId>
+       <artifactId>jboss-jsf-testwar</artifactId>
+       <version>${project.version}</version>
+       <scope>compile</scope>
+       <type>war</type>
+    </dependency>
+    
+  </dependencies>
+
+  <build>
+    <finalName>${artifactId}-jsfunit</finalName>
+  </build>
+  
+</project>

Added: projects/jboss-jsf-int/trunk/jsf12test/src/main/webapp/WEB-INF/web.xml
===================================================================
--- projects/jboss-jsf-int/trunk/jsf12test/src/main/webapp/WEB-INF/web.xml	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/jsf12test/src/main/webapp/WEB-INF/web.xml	2009-03-29 20:32:30 UTC (rev 86446)
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!DOCTYPE web-app PUBLIC
+   "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+   "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>    
+
+   <context-param>
+      <param-name>org.jboss.jsf.integration.jsfprofile</param-name>
+      <param-value>Mojarra1.2</param-value>
+   </context-param>
+   
+   <servlet>
+      <servlet-name>Faces Servlet</servlet-name>
+      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+      <load-on-startup>1</load-on-startup>
+   </servlet>      
+
+   <servlet-mapping>
+      <servlet-name>Faces Servlet</servlet-name>
+      <url-pattern>*.faces</url-pattern>
+   </servlet-mapping>  
+   
+   <welcome-file-list>
+      <welcome-file>index.html</welcome-file>
+   </welcome-file-list>
+</web-app>

Added: projects/jboss-jsf-int/trunk/jsf20test/pom.xml
===================================================================
--- projects/jboss-jsf-int/trunk/jsf20test/pom.xml	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/jsf20test/pom.xml	2009-03-29 20:32:30 UTC (rev 86446)
@@ -0,0 +1,28 @@
+<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-jsf-20test</artifactId>
+  <packaging>war</packaging>
+  <name>JBoss JSF Deployer Test for Mojarra 2.0</name>
+  <description>JBoss JSF Deployer Test for Mojarra 2.0</description>
+  
+  <dependencies>
+    <dependency>
+       <groupId>org.jboss.jsf.integration</groupId>
+       <artifactId>jboss-jsf-testwar</artifactId>
+       <version>${project.version}</version>
+       <scope>compile</scope>
+       <type>war</type>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <finalName>${artifactId}-jsfunit</finalName>
+  </build>
+  
+</project>

Added: projects/jboss-jsf-int/trunk/jsf20test/src/main/webapp/WEB-INF/web.xml
===================================================================
--- projects/jboss-jsf-int/trunk/jsf20test/src/main/webapp/WEB-INF/web.xml	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/jsf20test/src/main/webapp/WEB-INF/web.xml	2009-03-29 20:32:30 UTC (rev 86446)
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!DOCTYPE web-app PUBLIC
+   "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+   "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>    
+
+   <context-param>
+      <param-name>org.jboss.jsf.integration.jsfprofile</param-name>
+      <param-value>Mojarra2.0</param-value>
+   </context-param>
+   
+   <servlet>
+      <servlet-name>Faces Servlet</servlet-name>
+      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+      <load-on-startup>1</load-on-startup>
+   </servlet>      
+
+   <servlet-mapping>
+      <servlet-name>Faces Servlet</servlet-name>
+      <url-pattern>*.faces</url-pattern>
+   </servlet-mapping>  
+   
+   <welcome-file-list>
+      <welcome-file>index.html</welcome-file>
+   </welcome-file-list>
+</web-app>

Added: projects/jboss-jsf-int/trunk/jsfbundledtest/pom.xml
===================================================================
--- projects/jboss-jsf-int/trunk/jsfbundledtest/pom.xml	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/jsfbundledtest/pom.xml	2009-03-29 20:32:30 UTC (rev 86446)
@@ -0,0 +1,38 @@
+<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-jsf-jsfbundledtest</artifactId>
+  <packaging>war</packaging>
+  <name>JBoss JSF Deployer Test Bundled JSF</name>
+  <description>JBoss JSF Deployer Test for a war that has JSF bundled in WEB-INF/lib</description>
+  
+  <dependencies>
+    <dependency>
+       <groupId>org.jboss.jsf.integration</groupId>
+       <artifactId>jboss-jsf-testwar</artifactId>
+       <version>${project.version}</version>
+       <scope>compile</scope>
+       <type>war</type>
+    </dependency>
+    
+    <dependency>
+       <groupId>org.apache.myfaces.core</groupId>
+       <artifactId>myfaces-api</artifactId>
+    </dependency>
+    
+    <dependency>
+       <groupId>org.apache.myfaces.core</groupId>
+       <artifactId>myfaces-impl</artifactId>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <finalName>${artifactId}-jsfunit</finalName>
+  </build>
+  
+</project>

Added: projects/jboss-jsf-int/trunk/jsfbundledtest/src/main/webapp/WEB-INF/web.xml
===================================================================
--- projects/jboss-jsf-int/trunk/jsfbundledtest/src/main/webapp/WEB-INF/web.xml	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/jsfbundledtest/src/main/webapp/WEB-INF/web.xml	2009-03-29 20:32:30 UTC (rev 86446)
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!DOCTYPE web-app PUBLIC
+   "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+   "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>    
+
+   <context-param>
+     <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
+     <param-value>true</param-value>
+   </context-param> 
+
+   <servlet>
+      <servlet-name>Faces Servlet</servlet-name>
+      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+      <load-on-startup>1</load-on-startup>
+   </servlet>      
+
+   <servlet-mapping>
+      <servlet-name>Faces Servlet</servlet-name>
+      <url-pattern>*.faces</url-pattern>
+   </servlet-mapping>  
+   
+   <welcome-file-list>
+      <welcome-file>index.html</welcome-file>
+   </welcome-file-list>
+</web-app>

Added: projects/jboss-jsf-int/trunk/pom.xml
===================================================================
--- projects/jboss-jsf-int/trunk/pom.xml	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/pom.xml	2009-03-29 20:32:30 UTC (rev 86446)
@@ -0,0 +1,174 @@
+<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>
+  
+  <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>1.2_12</version>
+       </dependency>
+       
+       <dependency>
+          <groupId>javax.faces</groupId>
+          <artifactId>jsf-impl</artifactId>
+          <version>1.2_12</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>

Added: projects/jboss-jsf-int/trunk/testwar/pom.xml
===================================================================
--- projects/jboss-jsf-int/trunk/testwar/pom.xml	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/testwar/pom.xml	2009-03-29 20:32:30 UTC (rev 86446)
@@ -0,0 +1,22 @@
+<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-jsf-testwar</artifactId>
+  <packaging>war</packaging>
+  <name>JBoss JSF Deployer Test WAR</name>
+  <description>JBoss JSF Deployer Test WAR</description>
+  
+  <dependencies>
+    
+  </dependencies>
+
+  <build>
+    <finalName>${artifactId}</finalName>
+  </build>
+  
+</project>

Added: projects/jboss-jsf-int/trunk/testwar/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- projects/jboss-jsf-int/trunk/testwar/src/main/webapp/WEB-INF/faces-config.xml	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/testwar/src/main/webapp/WEB-INF/faces-config.xml	2009-03-29 20:32:30 UTC (rev 86446)
@@ -0,0 +1,12 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+
+<!DOCTYPE faces-config PUBLIC
+  "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
+  "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
+
+<faces-config>
+
+  
+
+</faces-config>

Added: projects/jboss-jsf-int/trunk/testwar/src/main/webapp/WEB-INF/web.xml
===================================================================
--- projects/jboss-jsf-int/trunk/testwar/src/main/webapp/WEB-INF/web.xml	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/testwar/src/main/webapp/WEB-INF/web.xml	2009-03-29 20:32:30 UTC (rev 86446)
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<!DOCTYPE web-app PUBLIC
+   "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+   "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>    
+
+   <servlet>
+      <servlet-name>Faces Servlet</servlet-name>
+      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+      <load-on-startup>1</load-on-startup>
+   </servlet>      
+
+   <servlet-mapping>
+      <servlet-name>Faces Servlet</servlet-name>
+      <url-pattern>*.faces</url-pattern>
+   </servlet-mapping>  
+   
+   <welcome-file-list>
+      <welcome-file>index.html</welcome-file>
+   </welcome-file-list>
+</web-app>

Added: projects/jboss-jsf-int/trunk/testwar/src/main/webapp/index.html
===================================================================
--- projects/jboss-jsf-int/trunk/testwar/src/main/webapp/index.html	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/testwar/src/main/webapp/index.html	2009-03-29 20:32:30 UTC (rev 86446)
@@ -0,0 +1,9 @@
+<html> 
+   <head>
+      <meta http-equiv="Refresh" content= "0; URL=index.faces"/>
+      <title>Start Web Application</title>
+   </head>
+   <body>
+      <p>Please wait for the web application to start.</p>   
+   </body> 
+</html>

Added: projects/jboss-jsf-int/trunk/testwar/src/main/webapp/index.jsp
===================================================================
--- projects/jboss-jsf-int/trunk/testwar/src/main/webapp/index.jsp	                        (rev 0)
+++ projects/jboss-jsf-int/trunk/testwar/src/main/webapp/index.jsp	2009-03-29 20:32:30 UTC (rev 86446)
@@ -0,0 +1,34 @@
+<%--
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.
+ */
+--%>
+
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+
+<HTML>
+
+<f:view>  
+   <h:outputText value="Hello World!" id="hello"/>
+</f:view>
+
+</HTML>




More information about the jboss-cvs-commits mailing list