[weld-commits] Weld SVN: r5037 - in extensions/trunk: faces and 9 other directories.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Fri Nov 13 11:24:17 EST 2009


Author: dan.j.allen
Date: 2009-11-13 11:24:17 -0500 (Fri, 13 Nov 2009)
New Revision: 5037

Added:
   extensions/trunk/faces/
   extensions/trunk/faces/pom.xml
   extensions/trunk/faces/src/
   extensions/trunk/faces/src/main/
   extensions/trunk/faces/src/main/java/
   extensions/trunk/faces/src/main/java/org/
   extensions/trunk/faces/src/main/java/org/jboss/
   extensions/trunk/faces/src/main/java/org/jboss/weld/
   extensions/trunk/faces/src/main/java/org/jboss/weld/faces/
   extensions/trunk/faces/src/main/java/org/jboss/weld/faces/FacesContextProducer.java
   extensions/trunk/faces/src/main/resources/
   extensions/trunk/faces/src/main/resources/META-INF/
   extensions/trunk/faces/src/main/resources/META-INF/beans.xml
Log:
The starting point of a faces (JSF) extension
currently provides an injectable FacesContext



Property changes on: extensions/trunk/faces
___________________________________________________________________
Name: svn:ignore
   + .classpath
.project
.settings
target


Added: extensions/trunk/faces/pom.xml
===================================================================
--- extensions/trunk/faces/pom.xml	                        (rev 0)
+++ extensions/trunk/faces/pom.xml	2009-11-13 16:24:17 UTC (rev 5037)
@@ -0,0 +1,58 @@
+<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">
+   <parent>
+      <artifactId>weld-extensions-parent</artifactId>
+      <groupId>org.jboss.weld</groupId>
+      <version>1.0.0-SNAPSHOT</version>
+      <relativePath>../parent/pom.xml</relativePath>
+   </parent>
+   <modelVersion>4.0.0</modelVersion>
+   <groupId>org.jboss.weld</groupId>
+   <artifactId>weld-faces</artifactId>
+   
+   <name>Weld JSF Extensions</name>
+   
+   <description>Weld JSF Extensions, such as an injectable FacesContext</description>
+   
+   <contributors>
+      <contributor>
+         <name>Dan Allen</name>
+         <roles>
+            <role>Module lead</role>
+         </roles>
+      </contributor>
+   </contributors>
+   
+   <issueManagement>
+      <system>JIRA</system>
+      <url>https://jira.jboss.org/jira/browse/WELDX</url>
+   </issueManagement>
+   
+   <dependencies>
+
+      <dependency>
+         <groupId>org.testng</groupId>
+         <artifactId>testng</artifactId>
+         <scope>test</scope>
+         <classifier>jdk15</classifier>
+         <exclusions>
+         	<exclusion>
+         		<artifactId>junit</artifactId>
+         		<groupId>junit</groupId>
+         	</exclusion>
+         </exclusions>
+      </dependency>
+      
+      <dependency>
+      	<groupId>javax.enterprise</groupId>
+      	<artifactId>cdi-api</artifactId>
+         <scope>provided</scope>
+      </dependency>
+      <dependency>
+      	<groupId>javax.faces</groupId>
+      	<artifactId>jsf-api</artifactId>
+      	<scope>provided</scope>
+      </dependency>
+      
+   </dependencies>
+   
+</project>

Added: extensions/trunk/faces/src/main/java/org/jboss/weld/faces/FacesContextProducer.java
===================================================================
--- extensions/trunk/faces/src/main/java/org/jboss/weld/faces/FacesContextProducer.java	                        (rev 0)
+++ extensions/trunk/faces/src/main/java/org/jboss/weld/faces/FacesContextProducer.java	2009-11-13 16:24:17 UTC (rev 5037)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.weld.faces;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Produces;
+import javax.faces.context.FacesContext;
+
+/**
+ * <p>
+ * A producer which retrieves the current JSF FacesContext by calling
+ * {@link FacesContext#getCurrentInstance}, thus allowing it to be injected.
+ * </p>
+ * 
+ * @author Gavin King
+ * @author Dan Allen
+ */
+public class FacesContextProducer
+{
+   public
+   @Produces
+   @RequestScoped
+   FacesContext getFacesContext()
+   {
+      return FacesContext.getCurrentInstance();
+   }
+}

Added: extensions/trunk/faces/src/main/resources/META-INF/beans.xml
===================================================================



More information about the weld-commits mailing list