You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by ff...@apache.org on 2013/12/12 23:02:50 UTC

[1/3] TAP5-2260: Add support for CDI

Updated Branches:
  refs/heads/master 1bb0ba364 -> db68d5b9b


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/resources/arquillian.xml
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/resources/arquillian.xml b/tapestry-cdi/src/test/resources/arquillian.xml
new file mode 100755
index 0000000..bfd69d7
--- /dev/null
+++ b/tapestry-cdi/src/test/resources/arquillian.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xmlns="http://jboss.org/schema/arquillian"
+   xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
+   
+   <engine>
+        <property name="deploymentExportPath">build/libs</property>
+   </engine>
+  
+   <container qualifier="tomee_embedded">
+     <configuration>
+          <property name="appWorkingDir">target/arquillian-embedded-working-dir</property>
+          <property name="dir">target/apache-tomee-embedded</property>
+      </configuration>
+   </container>
+   
+   <container qualifier="jbossas_managed">
+      <protocol type="Servlet 3.0">
+         <property name="executionType">MANAGED</property>
+      </protocol>
+      <configuration>
+         <property name="jbossHome">target/jboss-as-7.1.1.Final/</property>
+         <property name="allowConnectingToRunningServer">true</property>
+      </configuration>
+   </container>
+   
+   <container qualifier="glassfish_managed">
+        <configuration>
+            <property name="glassFishHome">target/glassfish3</property>
+            <property name="debug">true</property>
+            <property name="allowConnectingToRunningServer">true</property>
+        </configuration>
+    </container>
+  
+</arquillian>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/resources/log4j.xml
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/resources/log4j.xml b/tapestry-cdi/src/test/resources/log4j.xml
new file mode 100755
index 0000000..5d3ed59
--- /dev/null
+++ b/tapestry-cdi/src/test/resources/log4j.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  Log4j Configuration                                                  -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<!--
+   | For more configuration information and examples see the Jakarta Log4j
+   | website: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+  <!-- ============================== -->
+  <!-- Append messages to the console -->
+  <!-- ============================== -->
+
+  <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+    <param name="Threshold" value="DEBUG"/>
+    <param name="Target" value="System.err"/>
+
+    <layout class="org.apache.log4j.PatternLayout">
+      <param name="ConversionPattern" value="%-5p | %c | %d{ISO8601}%n   > %m%n%n"/>
+    </layout>
+  </appender>
+
+  <!-- ======================= -->
+  <!-- Setup the Root category -->
+  <!-- ======================= -->
+  
+  <logger name="org.apache.tapestry5.cdi.CDIInjectionProvider">
+    <level value="DEBUG" />
+  </logger>
+  
+  <logger name="org.apache.tapestry5.cdi.CDIObjectProvider">
+    <level value="DEBUG" />
+  </logger>
+  
+  <logger name="org.apache.tapestry5.cdi.internal.InternalUtils">
+    <level value="DEBUG" />
+  </logger>
+    
+  <logger name="org.apache.tapestry5.cdi.BeanHelper">
+      <level value="DEBUG" />
+  </logger>
+
+  <logger name="org.apache.tapestry5.cdi.extension.TapestryExtension">
+      <level value="DEBUG" />
+  </logger>
+
+  <root>
+    <priority value ="DEBUG" /> 
+    <appender-ref ref="CONSOLE"/>
+  </root>
+  
+</log4j:configuration>

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/components/DumbComponent.tml
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/components/DumbComponent.tml b/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/components/DumbComponent.tml
new file mode 100755
index 0000000..81df81a
--- /dev/null
+++ b/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/components/DumbComponent.tml
@@ -0,0 +1,7 @@
+<t:container
+	xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd"
+	xmlns:p="tapestry:parameter">
+
+	<p>${pojo.nameforcomponent}</p>
+	<p>${namedpojo.nameforcomponent}</p>
+</t:container>

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/DessertPage.tml
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/DessertPage.tml b/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/DessertPage.tml
new file mode 100755
index 0000000..c22a0c2
--- /dev/null
+++ b/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/DessertPage.tml
@@ -0,0 +1,10 @@
+<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
+
+<p>${qualifier1}</p>
+<p>${qualifier2}</p>
+<p>${qualifier3}</p>
+<p>${qualifier4}</p>
+
+<p>${qualifier5}</p>
+
+</html>

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/Index.properties
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/Index.properties b/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/Index.properties
new file mode 100755
index 0000000..ed3e965
--- /dev/null
+++ b/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/Index.properties
@@ -0,0 +1,18 @@
+#
+# Copyright 2013 GOT5
+#
+# 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.
+#
+
+messagecdi=message_cdi
+messagetapestry=message_tapestry
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/Index.tml
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/Index.tml b/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/Index.tml
new file mode 100755
index 0000000..b000ddd
--- /dev/null
+++ b/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/Index.tml
@@ -0,0 +1,22 @@
+<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
+    <p>${pojo}</p>
+    <p>${namedPojo}</p>
+
+    <p>Counter : ${counterService.count}</p>
+
+   
+    <t:dumbcomponent />
+    
+    <p>${messagecdi}</p>
+    <p>${messagetapestry}</p>
+    
+    <p>${statelessejb}</p>
+    
+    <p>${requestscopepojo}</p>
+
+    <p>${sessionscopepojo}</p>
+    
+    <p>${stereotype}</p>
+    
+
+</html>

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/InvalidateSessionPage.tml
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/InvalidateSessionPage.tml b/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/InvalidateSessionPage.tml
new file mode 100755
index 0000000..30efab3
--- /dev/null
+++ b/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/InvalidateSessionPage.tml
@@ -0,0 +1,2 @@
+<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
+</html>

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/RequestScopePage.tml
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/RequestScopePage.tml b/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/RequestScopePage.tml
new file mode 100755
index 0000000..d3b0230
--- /dev/null
+++ b/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/RequestScopePage.tml
@@ -0,0 +1,3 @@
+<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
+    <p>${requestscopepojo}</p>
+</html>

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/SessionScopePage.tml
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/SessionScopePage.tml b/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/SessionScopePage.tml
new file mode 100755
index 0000000..20b6832
--- /dev/null
+++ b/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/SessionScopePage.tml
@@ -0,0 +1,3 @@
+<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
+<p>${sessionscopepojo}</p>
+</html>

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/SomePage.tml
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/SomePage.tml b/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/SomePage.tml
new file mode 100755
index 0000000..30efab3
--- /dev/null
+++ b/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/SomePage.tml
@@ -0,0 +1,2 @@
+<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
+</html>

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/StatefulPage.tml
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/StatefulPage.tml b/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/StatefulPage.tml
new file mode 100755
index 0000000..6e6a1fa
--- /dev/null
+++ b/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/StatefulPage.tml
@@ -0,0 +1,6 @@
+<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
+
+    <!-- see in MyStateful (beginRender) -->
+    
+    
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/StereotypePage.tml
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/StereotypePage.tml b/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/StereotypePage.tml
new file mode 100755
index 0000000..c0cc4f2
--- /dev/null
+++ b/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/StereotypePage.tml
@@ -0,0 +1,5 @@
+<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
+    <p>${stereotypeBeanInfo}</p>
+    <p>${sameInstanceInfo}</p>
+    
+</html>

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/VegetablePage.tml
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/VegetablePage.tml b/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/VegetablePage.tml
new file mode 100755
index 0000000..30d66ea
--- /dev/null
+++ b/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/VegetablePage.tml
@@ -0,0 +1,4 @@
+<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
+
+
+</html>

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/WSPage.tml
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/WSPage.tml b/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/WSPage.tml
new file mode 100755
index 0000000..e183dd8
--- /dev/null
+++ b/tapestry-cdi/src/test/resources/org/apache/tapestry5/cdi/test/pages/WSPage.tml
@@ -0,0 +1,3 @@
+<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
+    <p>Message from a webservice @Inject'ed in the page and managed by CDI : ${message}</p>
+</html>


[2/3] TAP5-2260: Add support for CDI

Posted by ff...@apache.org.
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension b/tapestry-cdi/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
new file mode 100755
index 0000000..2bd30a5
--- /dev/null
+++ b/tapestry-cdi/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
@@ -0,0 +1,2 @@
+org.apache.tapestry5.cdi.extension.BeanManagerHolder
+org.apache.tapestry5.cdi.extension.TapestryExtension

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/InjectTest.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/InjectTest.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/InjectTest.java
new file mode 100755
index 0000000..92583ec
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/InjectTest.java
@@ -0,0 +1,445 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+
+import javax.enterprise.inject.spi.Extension;
+
+import org.antlr.runtime.Lexer;
+import org.apache.commons.codec.StringEncoder;
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpException;
+import org.apache.commons.httpclient.HttpMethod;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.tapestry5.TapestryFilter;
+import org.apache.tapestry5.cdi.CDIInjectModule;
+import org.apache.tapestry5.cdi.extension.BeanManagerHolder;
+import org.apache.tapestry5.cdi.extension.TapestryExtension;
+import org.apache.tapestry5.cdi.test.components.DumbComponent;
+import org.apache.tapestry5.cdi.test.pages.DessertPage;
+import org.apache.tapestry5.cdi.test.pages.Index;
+import org.apache.tapestry5.cdi.test.pages.InvalidateSessionPage;
+import org.apache.tapestry5.cdi.test.pages.RequestScopePage;
+import org.apache.tapestry5.cdi.test.pages.SessionScopePage;
+import org.apache.tapestry5.cdi.test.pages.SomePage;
+import org.apache.tapestry5.cdi.test.pages.StatefulPage;
+import org.apache.tapestry5.cdi.test.pages.StereotypePage;
+import org.apache.tapestry5.cdi.test.pages.VegetablePage;
+import org.apache.tapestry5.cdi.test.pages.WSPage;
+import org.apache.tapestry5.func.Mapper;
+import org.apache.tapestry5.ioc.IOCConstants;
+import org.apache.tapestry5.ioc.annotations.InjectService;
+import org.apache.tapestry5.json.JSONArray;
+import org.apache.tapestry5.modules.TapestryModule;
+import org.apache.tapestry5.plastic.PlasticClass;
+import org.apache.ziplock.JarLocation;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.junit.InSequence;
+import org.jboss.arquillian.test.api.ArquillianResource;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.EmptyAsset;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.shrinkwrap.descriptor.api.Descriptors;
+import org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+
+@RunWith(Arquillian.class)
+public class InjectTest {
+
+    @ArquillianResource
+    private static URL indexUrl;
+
+    private static final String TEST_RESOURCES_ROOT_PATH = "src/test/resources/";
+    
+    private static final String METAINF_PATH = "src/main/resources/META-INF/";
+        		
+    /**
+     * Generate a web archive for arquillian
+     * @return a WebArchive object
+     */
+    @Deployment(testable = false)
+    public static WebArchive war() {
+    
+    	File indexPage = new File(toPath(Index.class.getName()));
+    	Package rootPackage = toPackage(indexPage.getParentFile().getParent());
+    	WebArchive war =  ShrinkWrap
+                .create(WebArchive.class, "inject.war")
+                .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
+                .addAsWebInfResource(
+                        new StringAsset(createWebXml()),
+                        "web.xml")
+                 // our test classes (src/test) = the webapp
+                .addPackages(true, rootPackage)
+                // tapestry dependencies, for real project put it in a helper
+                // class: new TapestryArchive(name)...
+                .addAsLibraries(JarLocation.jarLocation(HttpClient.class))
+                .addAsLibraries(JarLocation.jarLocation(Lexer.class))
+                .addAsLibraries(JarLocation.jarLocation(StringEncoder.class))
+                .addAsLibraries(JarLocation.jarLocation(IOCConstants.class))
+                .addAsLibraries(JarLocation.jarLocation(PlasticClass.class))
+                .addAsLibraries(JarLocation.jarLocation(JSONArray.class))
+                .addAsLibraries(JarLocation.jarLocation(InjectService.class))
+                .addAsLibraries(JarLocation.jarLocation(Mapper.class))
+                .addAsLibraries(JarLocation.jarLocation(TapestryModule.class))
+                // for jbossAS7 server
+                .addAsLibraries(JarLocation.jarLocation(org.jboss.shrinkwrap.api.asset.Asset.class))
+                // for Glassfish container
+                .addAsLibraries(JarLocation.jarLocation(org.slf4j.Logger.class));
+    			
+    			// our test resources (src/test) = the webapp
+    			// add template resources from package "pages"
+    			Package pagePackage = toPackage(indexPage.getParent());
+    	    	File pageDirectory = 
+		    			new File(TEST_RESOURCES_ROOT_PATH + toPath(pagePackage.getName()));
+		    	for (String template : pageDirectory.list()) {
+		    		war.addAsResource(pagePackage, template);
+				}
+
+    	    	// add template resources from package "components"
+    	    	Package componentPackage = DumbComponent.class.getPackage();    	    	
+    	    	File componentDirectory = 
+		    			new File(TEST_RESOURCES_ROOT_PATH + toPath(componentPackage.getName()));
+		    	for (String template : componentDirectory.list()) {
+		    		war.addAsResource(componentPackage, template);
+				}
+		    	
+		    	// add tapestry-cdi module to the archive
+		    	war.addAsLibraries(createJarArchive("tapestry-cdi.jar"));
+		    	war.addAsWebInfResource(new File(TEST_RESOURCES_ROOT_PATH + "log4j.xml"));
+    	return war;
+    }
+    
+    @Test
+    @InSequence(0)
+    public void checkApplicationScope() throws IOException {
+    	
+    	//get the index page (that increments an applicationScope counter)
+    	String output = getResponse(indexUrl);
+    	
+    	//check that the counter has been incremented
+        assertTrue("Injection of Application Scope Bean failed in page Index", output.contains("Counter : 1"));
+
+        //change the page
+        output = getResponse(new URL(indexUrl.toString() + "/"+  SomePage.class.getSimpleName()));
+        assertNotNull(output);
+
+        //get the index page (that increments an applicationScope counter)
+        output = getResponse(indexUrl);
+
+        //check that the counter has been incremented based on previous value (has not been re-initialized)
+        assertTrue("Injection of Application Scope Bean failed in page Index", output.contains("Counter : 2"));
+    }
+
+    @Test
+    @InSequence(1)
+    public void checkSessionScope() throws IOException {
+    	
+    	HttpClient client  = new HttpClient();
+    	
+    	String output = getResponse(new URL(indexUrl.toString() + "/"+  SessionScopePage.class.getSimpleName()), client );
+        assertTrue("Injection of SessionScope pojo failed in page Index 1", output.contains("session:true"));
+        
+    	output = getResponse(indexUrl, client);
+        assertTrue("Injection of SessionScope pojo failed in page Index 2", output.contains("session:true"));
+
+        output = getResponse(new URL(indexUrl.toString() + "/"+  InvalidateSessionPage.class.getSimpleName()), client);
+
+        assertNotNull(output);
+
+        output = getResponse(indexUrl, client);
+        assertTrue("Injection of SessionScope pojo failed in page Index 3", output.contains("session:false"));
+    }
+
+    @Test
+    @InSequence(2)
+    public void checkInjectionsPojoFromOutput() throws IOException {
+
+        String output = getResponse(indexUrl);
+        
+        assertTrue("Injection of Pojo failed in page index",
+                output.contains("injected pojo"));
+        assertTrue("Injection of NamedPojo failed in page index",
+                output.contains("injected named pojo"));
+        assertTrue("Injection of Pojo failed in component DumbComponent",
+                output.contains("I named pojo into component"));
+        assertTrue("Injection of NamedPojo failed in component DumbComponent",
+                output.contains("I pojo into component"));
+
+    }
+
+    @Test
+    @InSequence(3)
+    public void checkInjectionTapestryServices() throws IOException {
+        String output = getResponse(indexUrl);
+        assertTrue(
+                "Injection of Tapestry Service Messages by CDI annotation failed in page Index",
+                output.contains("message_cdi"));
+        assertTrue(
+                "Injection of Tapestry Service Messages by Tapestry annotation failed in page Index",
+                output.contains("message_tapestry"));
+
+    }
+
+    @Test
+    @InSequence(4)
+    public void checkInjectionSessionBeans() throws IOException {
+
+        String output = getResponse(indexUrl);
+        assertTrue("Injection of Stateless Session Bean failed in page Index", output.contains("Hello Stateless EJB"));
+
+        HttpClient client = new HttpClient();
+        output = getResponse(new URL(indexUrl.toString() + "/"+  StatefulPage.class.getSimpleName()), client);
+        assertTrue("Injection of Stateful Session Bean failed in page MyStateful\n" + output, output.contains("011stateful"));
+
+        output = getResponse(new URL(indexUrl.toString() + "/"+  StatefulPage.class.getSimpleName()), client);
+        assertTrue("Injection of Stateful Session Bean failed in page MyStateful\n" + output, output.contains("122stateful"));
+
+    }
+
+
+    @Test
+    @InSequence(5)
+    public void checkInjectionRequestScope() throws IOException {
+    	HttpClient client = new HttpClient();
+    	
+    	String output = getResponse(indexUrl, client);
+        assertTrue("Injection of RequestScope pojo failed in page Index", output.contains("request:true"));
+
+        output = getResponse(new URL(indexUrl.toString() + "/"+  RequestScopePage.class.getSimpleName()), client);
+        assertTrue("Injection of RequestScope pojo failed in page Index", output.contains("request:false"));
+
+    }
+
+
+   /**
+     * Todo - Add tests for session state. How  notify cdi about changes in session state objects ?
+     *
+     */
+
+    @Test
+    @InSequence(6)
+    public void checkQualifierBasic() throws IOException {
+
+        String output = getResponse(new URL(indexUrl.toString() + "/"+  DessertPage.class.getSimpleName()));
+        assertTrue("Injection of pojo with qualifier failed in page Dessert", output.contains("dessert1:true"));
+        assertTrue("Injection of pojo with qualifier failed in page Dessert", output.contains("dessert2:true"));
+        assertTrue("Injection of pojo with qualifier and produces method failed in page Dessert", output.contains("dessert3:true"));
+        assertTrue("Injection of pojo with qualifier and produces method + @new failed in page Dessert", output.contains("dessert4:true"));
+
+        /**
+         Todo - Add support to @Inject method | uncomment the line below to test it
+         */
+        //assertTrue("Injection of pojo with qualifier and inject method in page Dessert",output.contains("dessert5:true"));
+
+
+    }
+
+    @Test
+    @InSequence(7)
+    public void checkConversationScope() throws IOException {
+
+        String output = getResponse(new URL(indexUrl.toString() + "/"+  VegetablePage.class.getSimpleName()));
+        /**
+         Todo - Create a test with drone to play with the conversation scope
+         */
+
+    }
+
+    @Test
+    @InSequence(8)
+    public void checkEventBasic() throws IOException {
+        /**
+         Todo - find a usecase... issues while fire event in page/ cannot observes in page either
+         */
+        
+    }
+
+    @Test
+    @InSequence(9)
+    public void checkBindingType() throws IOException {
+        /**
+         Todo - Use Produces method with parameter to present a great use case
+         */
+
+
+    }
+
+    @Test
+    @InSequence(10)
+    public void checkWebService() throws IOException {
+    	 String output = getResponse(new URL(indexUrl.toString() + "/"+ WSPage.class.getSimpleName()));
+    	 assertNotNull(output);
+    	 assertTrue("Injection of webservice failed in page WSPage", output.contains("Hello John"));
+    }
+    
+    @Test
+    @InSequence(11)
+    public void checkStereotype() throws IOException {
+    	
+    	HttpClient client  = new HttpClient();
+    	
+    	//Check if injection of specific stereotyped bean is ok 
+    	   
+    	String output = getResponse(new URL(indexUrl.toString() + "/"+ StereotypePage.class.getSimpleName()), client);
+    	assertNotNull(output);
+    	assertTrue("Injection of stereotyped bean failed in page StereotypePage", output.contains("Stereotype bean:true"));
+    	assertTrue("Stereotype Bean not SessionScoped as expected in page StereotypePage", output.contains("Same instance:true"));
+    	
+    	//Check if the bean is really SessionScoped as its Stereotype says
+
+    	output = getResponse(indexUrl, client);
+    	/** 
+    	 * TODO : uncomment the following assertion 
+    	 * An issue occurs randomly only with TomEE : the bean is not SessionScoped as expected
+    	 * Works perfectly with glassfish and jbossAS7
+    	 * */
+    	// assertTrue("Stereotype Bean not SessionScoped as expected in page StereotypePage \n"+output, output.contains("stereotype:true")); 
+    	 
+    	output = getResponse(new URL(indexUrl.toString() + "/"+  InvalidateSessionPage.class.getSimpleName()), client);
+    	assertNotNull(output);
+    	output = getResponse(indexUrl, client);
+    	assertTrue("Stereotype Bean not SessionScoped as expected in page StereotypePage", output.contains("stereotype:false"));
+    }
+    
+    /**
+     * Create a jar archive for tapestry-cdi
+     * @param archiveName the archive name
+     * @return a JarArchive object
+     */
+     private static JavaArchive createJarArchive(String archiveName){
+    	JavaArchive jar =  ShrinkWrap
+    			// our module (src/main), as we are in the same project building
+                // the jar on the fly
+                .create(JavaArchive.class,
+                		archiveName)
+                .addPackages(true,
+                        CDIInjectModule.class.getPackage()
+                                .getName())
+                // do not include test package
+                .deletePackages(true,
+                        InjectTest.class.getPackage()
+                                .getName())
+                .addAsManifestResource(
+                        new StringAsset(BeanManagerHolder.class
+                                .getName()),
+                        "services/" + Extension.class.getName());
+
+    	jar.addAsManifestResource(
+                    new StringAsset(TapestryExtension.class.getName()),
+                    "services/" + Extension.class.getName());
+    	jar.addAsManifestResource(
+    			new File(METAINF_PATH + "services/" + Extension.class.getName()),
+                "services/" + Extension.class.getName());
+    	jar.addAsManifestResource(
+    			new File(METAINF_PATH + "beans.xml"),
+                "beans.xml");
+    	jar.addAsManifestResource(
+    			new File(METAINF_PATH + "MANIFEST.MF"),
+                "MANIFEST.MF");
+    	return jar;
+    }
+    
+    
+    /**
+     * Create a web.xml file and return its content as a String
+     * @return a String
+     */
+    private static String createWebXml(){
+    	return Descriptors
+                .create(WebAppDescriptor.class).version("3.0")
+                .createContextParam()
+                .paramName("tapestry.app-package")
+                .paramValue(InjectTest.class.getPackage().getName())
+                .up().createContextParam()
+                .paramName("tapestry.production-mode")
+                .paramValue("false").up().createFilter()
+                .filterName("pojo")
+                .filterClass(TapestryFilter.class.getName())
+                .up().createFilterMapping().filterName("pojo")
+                .urlPattern("/*").up()
+                .exportAsString();
+    }
+    
+    /**
+     * Convert a package name to a path
+     * @param packageName the package name
+     * @return a String
+     */
+    private static String toPath(String packageName) {
+		return packageName.replace(".", File.separator);
+	}
+
+    /**
+     * Convert a file path to a Package
+     * @param path the file path
+     * @return a Package
+     */
+    private static Package toPackage(String path) {
+		return Package.getPackage(path.replace(File.separator, "."));
+	}
+
+    /**
+     * Connect to an url and return the response content as a String 
+     * @param url an url to connect to
+     * @return the response as a String
+     */
+    private String getResponse(URL url) {
+    	return getResponse(url, null);
+    }
+    
+    /**
+     * Connect to an url thanks to an HttpClient if provided and return the response content as a String 
+     * Use same HttpClient to keep same HttpSession through multiple getResponse method calls  
+     * @param url an url to connect to
+     * @param client an HTTPClient to use to serve the url
+     * @return the response as a String
+     */
+    private String getResponse(URL url, HttpClient client) {
+    	HttpClient newClient = client==null ? new HttpClient() : client;
+        HttpMethod get = new GetMethod(url.toString());
+        String output = null;
+        int out = 200;
+    	 try {
+             out = newClient.executeMethod(get);
+             if (out != 200) {
+                 throw new RuntimeException("get " + get.getURI() + " returned " + out);
+             }
+             output = get.getResponseBodyAsString();
+             
+         } catch (HttpException e) {
+        	 e.printStackTrace();
+        	 throw new RuntimeException("get " + url + " returned " + out);
+		} catch (IOException e) {
+			e.printStackTrace();
+			throw new RuntimeException("get " + url + " returned " + out);
+		} finally {
+             get.releaseConnection();
+         }
+         return output;
+    }
+
+}
+

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/Choco.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/Choco.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/Choco.java
new file mode 100755
index 0000000..59102e2
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/Choco.java
@@ -0,0 +1,29 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.annotation;
+
+import javax.inject.Qualifier;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Qualifier
+@Retention(RUNTIME)
+@Target({TYPE,METHOD,FIELD,PARAMETER})
+public @interface Choco {
+
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/CustomDessert.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/CustomDessert.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/CustomDessert.java
new file mode 100755
index 0000000..1d5a567
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/CustomDessert.java
@@ -0,0 +1,29 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.annotation;
+
+import javax.inject.Qualifier;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Qualifier
+@Retention(RUNTIME)
+@Target({TYPE,METHOD,FIELD,PARAMETER})
+public @interface CustomDessert {
+
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/DessertTime.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/DessertTime.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/DessertTime.java
new file mode 100755
index 0000000..b9e785d
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/DessertTime.java
@@ -0,0 +1,29 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.annotation;
+
+import javax.inject.Qualifier;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Qualifier
+@Retention(RUNTIME)
+@Target({TYPE,METHOD,FIELD,PARAMETER})
+public @interface DessertTime {
+
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/Iced.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/Iced.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/Iced.java
new file mode 100755
index 0000000..3c43b3e
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/Iced.java
@@ -0,0 +1,32 @@
+/**
+ * Copyright 2013 GOT5
+ *
+ * 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.apache.tapestry5.cdi.test.annotation;
+
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+import javax.inject.Qualifier;
+
+@Qualifier
+@Retention(RUNTIME)
+@Target({TYPE,METHOD,FIELD,PARAMETER})
+public @interface Iced{
+
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/MyStereotype.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/MyStereotype.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/MyStereotype.java
new file mode 100755
index 0000000..757bc09
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/MyStereotype.java
@@ -0,0 +1,33 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.annotation;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.inject.Stereotype;
+import javax.inject.Named;
+
+@Stereotype
+@SessionScoped
+@Named
+@Retention(RUNTIME)
+@Target(TYPE)
+public @interface MyStereotype{
+
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/BrownieImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/BrownieImpl.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/BrownieImpl.java
new file mode 100755
index 0000000..859c66e
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/BrownieImpl.java
@@ -0,0 +1,50 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.beans;
+
+import org.apache.tapestry5.cdi.test.annotation.Choco;
+import org.apache.tapestry5.cdi.test.annotation.Iced;
+
+import javax.enterprise.context.SessionScoped;
+
+@Choco
+@SessionScoped
+public class BrownieImpl implements Dessert{
+
+    private String name = "Baked Brownie";
+
+    private String secondName = "Chewy Brownies";
+
+
+    public String getName(){
+        return name;
+    }
+
+    public String getOtherName(){
+        return secondName;
+    }
+
+    public void setName(String name){
+        this.name = name;
+    }
+
+    public void changeName(){
+        name = secondName;
+    }
+
+    public boolean getCheckName(){
+        return name.equals(secondName);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Counter.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Counter.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Counter.java
new file mode 100755
index 0000000..aeffda4
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Counter.java
@@ -0,0 +1,34 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.beans;
+
+import java.io.Serializable;
+import java.util.concurrent.atomic.AtomicInteger;
+
+public abstract class Counter implements Serializable
+{
+	private static final long serialVersionUID = 1L;
+	private AtomicInteger counter = new AtomicInteger();
+
+	public int getCount()
+	{
+		return counter.get();
+	}
+
+	public void increment()
+	{
+		counter.incrementAndGet();
+	}
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/CounterService.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/CounterService.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/CounterService.java
new file mode 100755
index 0000000..7482abb
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/CounterService.java
@@ -0,0 +1,31 @@
+/**
+ * Copyright 2013 GOT5
+ *
+ * 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.apache.tapestry5.cdi.test.beans;
+
+import javax.enterprise.context.ApplicationScoped;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@ApplicationScoped
+public class CounterService extends Counter{
+	
+	private static final long serialVersionUID = 1L;
+	
+	private static final Logger logger = LoggerFactory.getLogger(CounterService.class);
+
+}
+

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Dessert.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Dessert.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Dessert.java
new file mode 100755
index 0000000..a16452e
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Dessert.java
@@ -0,0 +1,30 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.beans;
+
+import java.io.Serializable;
+
+public interface Dessert extends Serializable {
+
+    public String getName();
+
+    public String getOtherName();
+
+    public void setName(String name);
+
+    public void changeName();
+
+    public boolean getCheckName();
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/DessertFactory.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/DessertFactory.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/DessertFactory.java
new file mode 100755
index 0000000..3d9774d
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/DessertFactory.java
@@ -0,0 +1,51 @@
+/**
+ * Copyright 2013 GOT5
+ *
+ * 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.apache.tapestry5.cdi.test.beans;
+
+import org.apache.tapestry5.cdi.test.annotation.CustomDessert;
+import org.apache.tapestry5.cdi.test.annotation.DessertTime;
+
+import javax.enterprise.inject.New;
+import javax.enterprise.inject.Produces;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+
+public class DessertFactory {
+
+    @Produces
+    @CustomDessert
+    public Dessert getCustomDessert(){
+        Dessert d = new IceCreamImpl();
+        d.changeName();
+        return d;
+    }
+
+    @Produces
+    @DessertTime
+    public Dessert getGoodDessert(@New DessertImpl dImpl,@New BrownieImpl brownie,@New IceCreamImpl iceCream){
+        Calendar today = new GregorianCalendar();
+        int hourOfDay = today.get(Calendar.HOUR_OF_DAY);
+        if(hourOfDay < 12){
+            return dImpl;
+        }if(hourOfDay == 12){
+            return iceCream;
+        }else{
+            return brownie;
+        }
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/DessertImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/DessertImpl.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/DessertImpl.java
new file mode 100755
index 0000000..3526cb0
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/DessertImpl.java
@@ -0,0 +1,47 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.beans;
+
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.inject.Default;
+
+
+@SessionScoped
+@Default
+public class DessertImpl implements Dessert{
+    private String name = "Ice Cream Sandwich";
+
+    private String secondName = "Jelly Bean";
+
+    public String getName(){
+        return name;
+    }
+
+    public String getOtherName(){
+        return secondName;
+    }
+
+    public void setName(String name){
+        this.name = name;
+    }
+
+    public void changeName(){
+        name = secondName;
+    }
+
+    public boolean getCheckName(){
+        return name.equals(secondName);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/IceCreamImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/IceCreamImpl.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/IceCreamImpl.java
new file mode 100755
index 0000000..1a29ae1
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/IceCreamImpl.java
@@ -0,0 +1,50 @@
+/**
+ * Copyright 2013 GOT5
+ *
+ * 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.apache.tapestry5.cdi.test.beans;
+
+import org.apache.tapestry5.cdi.test.annotation.Iced;
+
+import javax.enterprise.context.SessionScoped;
+
+@Iced
+@SessionScoped
+public class IceCreamImpl implements Dessert{
+
+    private String name = "Sorbet";
+
+    private String secondName = "Snow Cones";
+
+
+    public String getName(){
+        return name;
+    }
+
+    public String getOtherName(){
+        return secondName;
+    }
+
+    public void setName(String name){
+        this.name = name;
+    }
+
+    public void changeName(){
+        name = secondName;
+    }
+
+    public boolean getCheckName(){
+        return name.equals(secondName);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Menu.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Menu.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Menu.java
new file mode 100755
index 0000000..a42cdbb
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Menu.java
@@ -0,0 +1,40 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.beans;
+
+import javax.inject.Inject;
+
+import org.apache.tapestry5.cdi.test.annotation.Iced;
+
+public class Menu {
+
+    private Dessert dessert;
+
+    @Inject
+    void initQuery(@Iced Dessert dessert){
+
+            this.dessert = dessert;
+
+    }
+
+    public String getDessert(){
+        if(dessert !=null){
+            return dessert.getName();
+        }else{
+            return "no dessert";
+        }
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/NamedPojo.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/NamedPojo.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/NamedPojo.java
new file mode 100755
index 0000000..f54934e
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/NamedPojo.java
@@ -0,0 +1,29 @@
+/**
+ * Copyright 2013 GOT5
+ *
+ * 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.apache.tapestry5.cdi.test.beans;
+
+import javax.inject.Named;
+
+@Named("named")
+public class NamedPojo {
+    public String getName() {
+        return "injected named pojo";
+    }
+    
+    public String getNameForComponent(){
+    	return "I named pojo into component";
+    }
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Pojo.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Pojo.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Pojo.java
new file mode 100755
index 0000000..96dafc1
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Pojo.java
@@ -0,0 +1,26 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.beans;
+
+
+public class Pojo {
+    public String getName() {
+        return "injected pojo";
+    }
+    
+    public String getNameForComponent(){
+    	return "I pojo into component";
+    }
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Soup.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Soup.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Soup.java
new file mode 100755
index 0000000..1b81d11
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Soup.java
@@ -0,0 +1,42 @@
+/**
+ * Copyright 2013 GOT5
+ *
+ * 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.apache.tapestry5.cdi.test.beans;
+
+import javax.enterprise.context.RequestScoped;
+
+@RequestScoped
+public class Soup {
+
+	private String name = "Soup of the day";
+	private String secondName = "Soup of Tomorrow";
+
+	public String getName() {
+		return name;
+
+	}
+
+	public void changeName(){
+		name = secondName;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public boolean getCheckNames(){
+		return name.equals(secondName);
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/StatefulEJBBean.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/StatefulEJBBean.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/StatefulEJBBean.java
new file mode 100755
index 0000000..3f48a21
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/StatefulEJBBean.java
@@ -0,0 +1,28 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.beans;
+
+import javax.ejb.Local;
+
+@Local
+public interface StatefulEJBBean {
+	
+	int num();
+	
+	int inc();
+	
+	int reset();
+
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/StatefulEJBBeanImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/StatefulEJBBeanImpl.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/StatefulEJBBeanImpl.java
new file mode 100755
index 0000000..61a4074
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/StatefulEJBBeanImpl.java
@@ -0,0 +1,41 @@
+/**
+ * Copyright 2013 GOT5
+ *
+ * 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.apache.tapestry5.cdi.test.beans;
+
+import javax.ejb.Stateful;
+
+@Stateful
+public class StatefulEJBBeanImpl implements StatefulEJBBean{
+	
+	private int num = 0;
+
+	@Override
+	public int num() {
+		return num;
+	}
+	@Override
+	public int inc(){
+		return ++num;
+	}
+	
+	@Override
+	public int reset(){
+		return (num = 0);
+	}
+	
+	
+	
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/StatelessEJBBean.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/StatelessEJBBean.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/StatelessEJBBean.java
new file mode 100755
index 0000000..f1509b4
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/StatelessEJBBean.java
@@ -0,0 +1,25 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.beans;
+
+import javax.ejb.Local;
+
+@Local
+public interface StatelessEJBBean {
+	
+	String helloStatelessEJB();
+	
+
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/StatelessEJBBeanImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/StatelessEJBBeanImpl.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/StatelessEJBBeanImpl.java
new file mode 100755
index 0000000..a816344
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/StatelessEJBBeanImpl.java
@@ -0,0 +1,29 @@
+/**
+ * Copyright 2013 GOT5
+ *
+ * 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.apache.tapestry5.cdi.test.beans;
+
+import javax.ejb.Stateless;
+
+@Stateless
+public class StatelessEJBBeanImpl implements StatelessEJBBean{
+
+	@Override
+	public String helloStatelessEJB() {
+		return "Hello Stateless EJB";
+	}
+
+	
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Stereotyped.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Stereotyped.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Stereotyped.java
new file mode 100755
index 0000000..63067b6
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Stereotyped.java
@@ -0,0 +1,47 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.beans;
+
+import java.io.Serializable;
+
+import org.apache.tapestry5.cdi.test.annotation.MyStereotype;
+
+@SuppressWarnings("serial")
+@MyStereotype
+public class Stereotyped implements Serializable {
+
+	private String name = "Stereotyped";
+
+	private String secondName = "Stereotyped name changed";
+
+    public String getName(){
+        return name;
+    }
+
+    public String getOtherName(){
+        return secondName;
+    }
+
+    public void setName(String name){
+        this.name = name;
+    }
+
+    public void changeName(){
+        name = secondName;
+    }
+
+    public boolean getCheckName(){
+        return name.equals(secondName);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Vegetable.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Vegetable.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Vegetable.java
new file mode 100755
index 0000000..16709a2
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Vegetable.java
@@ -0,0 +1,62 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.beans;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.ConversationScoped;
+import javax.inject.Inject;
+import java.io.Serializable;
+
+@ConversationScoped
+public class Vegetable implements Serializable{
+    private String name = "salad";
+    private String secondName = "tomato";
+
+    @Inject
+    private
+    javax.enterprise.context.Conversation conversation;
+
+    @PostConstruct
+    public void init(){
+        if(conversation.isTransient()){
+            conversation.begin();
+        }
+        throw new IllegalStateException();
+    }
+
+
+    public String getName(){
+        return name;
+    }
+
+
+    public void changeName(){
+        name = secondName;
+    }
+
+    public void getEndConversation(){
+        if(!conversation.isTransient()){
+            conversation.end();
+        }
+        throw new IllegalStateException();
+    }
+
+    public boolean getCheckName(){
+        return name.equals(secondName);
+    }
+    public String getSecondName(){
+        return secondName;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/ws/HelloWorldService.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/ws/HelloWorldService.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/ws/HelloWorldService.java
new file mode 100755
index 0000000..11597f9
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/ws/HelloWorldService.java
@@ -0,0 +1,37 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.beans.ws;
+
+import javax.ejb.Local;
+import javax.jws.WebService;
+
+@WebService(targetNamespace = "https://github.com/got5/tapestry-cdi/beans/ws/HelloWorld")
+@Local
+public interface HelloWorldService {
+
+    /**
+     * Say hello as a response
+     * 
+     * @return A simple hello world message
+     */
+    public String sayHello();
+
+    /**
+     * Say hello to someone 
+     * 
+     * @param name The name of the person to say hello to
+     */
+    public String sayHelloToName(String name);
+}
+

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/ws/HelloWorldServiceImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/ws/HelloWorldServiceImpl.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/ws/HelloWorldServiceImpl.java
new file mode 100755
index 0000000..f6eb643
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/ws/HelloWorldServiceImpl.java
@@ -0,0 +1,38 @@
+/**
+ * Copyright 2013 GOT5
+ *
+ * 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.apache.tapestry5.cdi.test.beans.ws;
+
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+
+@Stateless
+@WebService(
+		serviceName = "HelloWorldService", 
+		portName = "HelloWorldPort", 
+		endpointInterface = "org.apache.tapestry5.cdi.test.beans.ws.HelloWorldService", 
+		targetNamespace = "https://github.com/got5/tapestry-cdi/beans/ws/HelloWorld")
+public class HelloWorldServiceImpl implements HelloWorldService {
+
+    @Override
+    public String sayHello() {
+        return "Hello World!";
+    }
+
+    @Override
+    public String sayHelloToName(final String name) {
+          return "Hello "+name;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/components/DumbComponent.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/components/DumbComponent.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/components/DumbComponent.java
new file mode 100755
index 0000000..021cf38
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/components/DumbComponent.java
@@ -0,0 +1,33 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.components;
+
+import javax.inject.Inject;
+
+import org.apache.tapestry5.annotations.Property;
+import org.apache.tapestry5.cdi.test.beans.NamedPojo;
+import org.apache.tapestry5.cdi.test.beans.Pojo;
+
+public class DumbComponent {
+
+	@Inject
+	@Property
+	private Pojo pojo;
+	
+	@Inject
+	@Property
+	private NamedPojo namedPojo;
+	
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/DessertPage.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/DessertPage.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/DessertPage.java
new file mode 100755
index 0000000..53ed6e5
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/DessertPage.java
@@ -0,0 +1,95 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.pages;
+
+import org.apache.tapestry5.cdi.test.annotation.Choco;
+import org.apache.tapestry5.cdi.test.annotation.CustomDessert;
+import org.apache.tapestry5.cdi.test.annotation.DessertTime;
+import org.apache.tapestry5.cdi.test.annotation.Iced;
+import org.apache.tapestry5.cdi.test.beans.*;
+
+import javax.inject.Inject;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+
+public class DessertPage {
+
+    @Inject
+    @Iced
+    private Dessert dessert1;
+
+    @Choco
+    @Inject
+    private Dessert dessert2;
+
+    @CustomDessert
+    @Inject
+    private Dessert dessert3;
+
+    @DessertTime
+    @Inject
+    private Dessert dessert4;
+
+    @Inject
+    private Menu menu;
+
+
+    public String getQualifier1() {
+        if (dessert1 != null) {
+            return "dessert1:" + dessert1.getName().equals(new IceCreamImpl().getName());
+        } else {
+            return "";
+        }
+    }
+
+    public String getQualifier2() {
+        if (dessert1 != null) {
+            return "dessert2:" + dessert2.getName().equals(new BrownieImpl().getName());
+        } else {
+            return "";
+        }
+    }
+
+    public String getQualifier3() {
+        if (dessert3 != null) {
+            return "dessert3:" + dessert3.getName().equals(new IceCreamImpl().getOtherName());
+        } else {
+            return "";
+        }
+    }
+
+    public String getQualifier4() {
+        Calendar today = new GregorianCalendar();
+        int hourOfDay = today.get(Calendar.HOUR_OF_DAY);
+        if (dessert4 != null) {
+            if (hourOfDay < 12) {
+                return "dessert4:" + dessert4.getName().equals(new DessertImpl().getName());
+
+            }
+            if (hourOfDay == 12) {
+                return "dessert4:" + dessert4.getName().equals(new IceCreamImpl().getName());
+            } else {
+                return "dessert4:" + dessert4.getName().equals(new BrownieImpl().getName());
+            }
+        }else{
+            return "";
+        }
+    }
+
+    public String getQualifier5(){
+       return "dessert5:" + menu.getDessert().equals(new IceCreamImpl().getName());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/Index.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/Index.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/Index.java
new file mode 100755
index 0000000..bd7b835
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/Index.java
@@ -0,0 +1,122 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.pages;
+
+import javax.inject.Named;
+
+import org.apache.tapestry5.ComponentResources;
+import org.apache.tapestry5.SymbolConstants;
+import org.apache.tapestry5.annotations.Property;
+import org.apache.tapestry5.cdi.test.beans.CounterService;
+import org.apache.tapestry5.cdi.test.beans.Dessert;
+import org.apache.tapestry5.cdi.test.beans.NamedPojo;
+import org.apache.tapestry5.cdi.test.beans.Pojo;
+import org.apache.tapestry5.cdi.test.beans.Soup;
+import org.apache.tapestry5.cdi.test.beans.StatelessEJBBean;
+import org.apache.tapestry5.cdi.test.beans.Stereotyped;
+import org.apache.tapestry5.ioc.Messages;
+import org.apache.tapestry5.ioc.annotations.Symbol;
+
+
+public class Index {
+    @javax.inject.Inject
+    private Pojo pojo;
+
+    @javax.inject.Inject
+    @Named("named")
+    private NamedPojo namedPojo;
+    
+
+    @javax.inject.Inject
+    @Property
+    private CounterService counterService;
+    
+
+    @javax.inject.Inject
+    private Messages messageCDI;
+    
+    @org.apache.tapestry5.ioc.annotations.Inject
+    private Messages messageTapestry;
+    
+    @javax.inject.Inject
+    private ComponentResources resources;
+    
+    @javax.inject.Inject
+    @Symbol(value=SymbolConstants.PRODUCTION_MODE)
+    private boolean production_mode;
+    
+    @javax.inject.Inject
+    private StatelessEJBBean statelessBean;
+
+    
+    @javax.inject.Inject
+    private Soup soup1;
+    
+    @javax.inject.Inject
+    private Soup soup2;
+
+    @javax.inject.Inject
+    private Dessert dessert;
+
+    @javax.inject.Inject
+    private Stereotyped stereotyped;
+
+        
+   
+    public String getPojo() {
+        return pojo.getName();
+    }
+    public String getNamedPojo() {
+        return namedPojo.getName();
+    }
+    
+    public String getMessageCDI(){
+    	return messageCDI.get("messagecdi");
+    }
+    
+    public String getMessageTapestry(){
+    	return messageTapestry.get("messagetapestry");
+    }
+    public String getStatelessEJB(){
+    	return statelessBean.helloStatelessEJB();
+    }
+
+    public String getRequestScopePojo(){
+    	if(soup1 !=null){
+    		soup1.changeName();
+    		return "request:"+soup1.getName().equals(soup2.getName());
+    	}
+    	return "";
+    }
+
+    public String getSessionScopePojo(){
+        if(dessert != null){
+            return "session:"+dessert.getName().equals(dessert.getOtherName());
+        }
+         return "";
+     }
+
+    public String getStereotype(){
+        if(stereotyped != null){
+            return "stereotype:"+stereotyped.getCheckName();
+        }
+         return "";
+     }
+
+
+    public void onActivate(){
+    	counterService.increment();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/InvalidateSessionPage.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/InvalidateSessionPage.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/InvalidateSessionPage.java
new file mode 100755
index 0000000..b76d3be
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/InvalidateSessionPage.java
@@ -0,0 +1,30 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.pages;
+
+
+import javax.inject.Inject;
+
+public class InvalidateSessionPage {
+
+
+    @Inject
+    private org.apache.tapestry5.services.Request request;
+
+
+    public void onActivate(){
+    	request.getSession(true).invalidate();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/RequestScopePage.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/RequestScopePage.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/RequestScopePage.java
new file mode 100755
index 0000000..e073d26
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/RequestScopePage.java
@@ -0,0 +1,38 @@
+/**
+ * Copyright 2013 GOT5
+ *
+ * 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.apache.tapestry5.cdi.test.pages;
+
+import javax.inject.Inject;
+
+import org.apache.tapestry5.cdi.test.beans.Soup;
+
+public class RequestScopePage {
+
+	@Inject
+	private Soup soup1;
+	
+	@Inject
+	private Soup soup2;
+	
+	 public String getRequestScopePojo(){
+	    	
+	    	if(soup1 !=null){
+	    		return "request:" + soup1.getCheckNames();
+	    	}
+	    	return "";
+	    		
+	    }
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/SessionScopePage.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/SessionScopePage.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/SessionScopePage.java
new file mode 100755
index 0000000..dfaa296
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/SessionScopePage.java
@@ -0,0 +1,39 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.pages;
+
+import javax.inject.Inject;
+
+import org.apache.tapestry5.cdi.test.beans.Dessert;
+
+public class SessionScopePage {
+
+   @Inject
+   private Dessert dessert1;
+
+   @Inject
+   private Dessert dessert2;
+
+   public String getSessionScopePojo(){
+
+    	if(dessert1!=null && dessert1.getName().equals(dessert2.getName())){
+    		dessert1.changeName();
+        	return "session:" + dessert1.getName().equals(dessert2.getName());
+        }else{
+            return "";
+        }
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/SomePage.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/SomePage.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/SomePage.java
new file mode 100755
index 0000000..2c1b5be
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/SomePage.java
@@ -0,0 +1,20 @@
+/**
+ * Copyright 2013 GOT5
+ *
+ * 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.apache.tapestry5.cdi.test.pages;
+
+public class SomePage {
+
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/StatefulPage.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/StatefulPage.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/StatefulPage.java
new file mode 100755
index 0000000..1530627
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/StatefulPage.java
@@ -0,0 +1,42 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.pages;
+
+import javax.inject.Inject;
+
+import org.apache.tapestry5.MarkupWriter;
+import org.apache.tapestry5.annotations.BeginRender;
+import org.apache.tapestry5.annotations.CleanupRender;
+import org.apache.tapestry5.cdi.test.beans.StatefulEJBBean;
+
+public class StatefulPage {
+
+	@Inject
+	private StatefulEJBBean statefulBean;
+
+	@BeginRender
+	public void rend(MarkupWriter mw) {
+		
+		mw.writeRaw(String.valueOf(statefulBean.num()) + String.valueOf(statefulBean.inc())
+				+ String.valueOf(statefulBean.num())+"stateful");//prepend XXXstateful at the root of the page
+
+	}
+
+	@CleanupRender
+	public void clean() {
+		
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/StereotypePage.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/StereotypePage.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/StereotypePage.java
new file mode 100755
index 0000000..a28487e
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/StereotypePage.java
@@ -0,0 +1,43 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.pages;
+
+import javax.inject.Inject;
+
+import org.apache.tapestry5.cdi.test.beans.Stereotyped;
+
+public class StereotypePage {
+
+	@Inject
+	private Stereotyped stereotype1;
+	
+	@Inject
+	private Stereotyped stereotype2;
+	
+	public String getStereotypeBeanInfo(){
+		
+		if(stereotype1!=null && stereotype1.getName().equals(stereotype2.getName())){
+			stereotype1.changeName();
+        	return "Stereotype bean:true";
+        }else{
+            return "";
+        }
+	}
+
+	public String getSameInstanceInfo(){
+		return "Same instance:"+(stereotype1 == stereotype2);
+	}
+	
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/VegetablePage.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/VegetablePage.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/VegetablePage.java
new file mode 100755
index 0000000..0503ba9
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/VegetablePage.java
@@ -0,0 +1,39 @@
+/**
+ * Copyright 2013 GOT5
+ *
+ * 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.apache.tapestry5.cdi.test.pages;
+
+import javax.inject.Inject;
+
+import org.apache.tapestry5.cdi.test.beans.Vegetable;
+
+public class VegetablePage {
+
+    @Inject
+    private Vegetable vegetable;
+
+
+
+    public String getVegetable(){
+        if(vegetable != null){
+            return "vegetable:" + vegetable.getName().equals(vegetable.getSecondName());
+        }
+        else
+            return "";
+    }
+
+
+
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/WSPage.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/WSPage.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/WSPage.java
new file mode 100755
index 0000000..4e3c550
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/WSPage.java
@@ -0,0 +1,35 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.pages;
+
+import javax.inject.Inject;
+
+import org.apache.tapestry5.annotations.Property;
+import org.apache.tapestry5.cdi.test.beans.ws.HelloWorldService;
+
+public class WSPage {
+
+	@Inject
+	private HelloWorldService client;
+	
+	@SuppressWarnings("unused")
+	@Property
+	private String message;
+
+	public void onActivate(){
+		message = client.sayHelloToName("John");
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/services/ClasspathURLConverterJBoss7Dot1.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/services/ClasspathURLConverterJBoss7Dot1.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/services/ClasspathURLConverterJBoss7Dot1.java
new file mode 100755
index 0000000..336a66f
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/services/ClasspathURLConverterJBoss7Dot1.java
@@ -0,0 +1,99 @@
+package org.apache.tapestry5.cdi.test.services;
+
+import java.io.File;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLConnection;
+
+import org.apache.tapestry5.ioc.services.ClasspathURLConverter;
+
+public class ClasspathURLConverterJBoss7Dot1 implements ClasspathURLConverter
+{
+    
+    public URL convert(URL url)
+    {
+        // If the URL is a "vfs" URL (JBoss 7.1 uses a Virtual File System)...
+
+        if (url != null && url.getProtocol().startsWith("vfs"))
+        {
+            // Ask the VFS what the physical URL is...
+
+            try
+            {
+                String urlString = url.toString();
+                        
+                // If the virtual URL involves a JAR file, 
+                // we have to figure out its physical URL ourselves because
+                // in JBoss 7.1 the JAR files exploded into the VFS are empty 
+                // (see https://issues.jboss.org/browse/JBAS-8786).
+                // Our workaround is that they are available, unexploded, 
+                // within the otherwise exploded WAR file.
+
+                if (urlString.contains(".jar")) {
+                                        
+                    // An example URL: "vfs:/devel/jboss-7.1.0.Final/server/default/deploy/myapp.ear/myapp.war/WEB-INF/lib/tapestry-core-5.3.3.jar/org/apache/tapestry5/corelib/components/"
+                    // Break the URL into its WAR part, the JAR part, 
+                    // and the Java package part.
+                                        
+                    int warPartEnd = urlString.indexOf(".war") + 4;
+                    String warPart = urlString.substring(0, warPartEnd);
+                    int jarPartEnd = urlString.indexOf(".jar") + 4;
+                    String jarPart = urlString.substring(warPartEnd, jarPartEnd);
+                    String packagePart = urlString.substring(jarPartEnd);
+
+                    // Ask the VFS where the exploded WAR is.
+
+                    URL warURL = new URL(warPart);
+                    URLConnection warConnection = warURL.openConnection();
+                    Object jBossVirtualWarDir = warConnection.getContent();
+                    // Use reflection so that we don't need JBoss in the classpath at compile time.
+                    File physicalWarDir = (File) invokerGetter(jBossVirtualWarDir, "getPhysicalFile");
+                    String physicalWarDirStr = physicalWarDir.toURI().toString();
+
+                    // Return a "jar:" URL constructed from the parts
+                    // eg. "jar:file:/devel/jboss-7.1.0.Final/server/default/tmp/vfs/automount40a6ed1db5eabeab/myapp.war-43e2c3dfa858f4d2//WEB-INF/lib/tapestry-core-5.3.3.jar!/org/apache/tapestry5/corelib/components/".
+
+                    String actualJarPath = "jar:" + physicalWarDirStr + jarPart + "!" + packagePart;
+                    return new URL(actualJarPath);
+                }
+                                
+                // Otherwise, ask the VFS what the physical URL is...
+                                
+                else {
+
+                    URLConnection connection = url.openConnection();
+                    Object jBossVirtualFile = connection.getContent();
+                    // Use reflection so that we don't need JBoss in the classpath at compile time.
+                    File physicalFile = (File) invokerGetter(jBossVirtualFile, "getPhysicalFile");
+                    URL physicalFileURL = physicalFile.toURI().toURL();
+                    return physicalFileURL;
+                }
+
+            }
+            catch (Exception e)
+            {
+                e.printStackTrace();
+            }
+        }
+
+        return url;
+    }
+
+    private Object invokerGetter(Object target, String getter) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException
+    {
+        Class<?> type = target.getClass();
+        Method method;
+        try
+        {
+            method = type.getMethod(getter);
+        }
+        catch (NoSuchMethodException e)
+        {
+            method = type.getDeclaredMethod(getter);
+            method.setAccessible(true);
+        }
+        return method.invoke(target);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/services/PojoModule.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/services/PojoModule.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/services/PojoModule.java
new file mode 100755
index 0000000..f6c7056
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/services/PojoModule.java
@@ -0,0 +1,32 @@
+/**
+ * Copyright 2013 GOT5
+ *
+ * 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.apache.tapestry5.cdi.test.services;
+
+
+import org.apache.tapestry5.cdi.CDIInjectModule;
+import org.apache.tapestry5.ioc.MappedConfiguration;
+import org.apache.tapestry5.ioc.annotations.SubModule;
+import org.apache.tapestry5.ioc.services.ClasspathURLConverter;
+
+@SubModule({
+    CDIInjectModule.class
+})
+public final class PojoModule {
+	public static void contributeServiceOverride(MappedConfiguration<Class,Object> configuration)
+	{
+		configuration.add(ClasspathURLConverter.class, new ClasspathURLConverterJBoss7Dot1());
+	}  
+}


[3/3] git commit: TAP5-2260: Add support for CDI

Posted by ff...@apache.org.
TAP5-2260: Add support for CDI

Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/db68d5b9
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/db68d5b9
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/db68d5b9

Branch: refs/heads/master
Commit: db68d5b9bb5069d4ee3df9fc88904e4e1da85de8
Parents: 1bb0ba3
Author: frafac <fr...@MacBook-de-frafac.local>
Authored: Thu Dec 12 23:00:49 2013 +0100
Committer: frafac <fr...@MacBook-de-frafac.local>
Committed: Thu Dec 12 23:00:49 2013 +0100

----------------------------------------------------------------------
 settings.gradle                                 |   1 +
 tapestry-cdi/LICENSE.txt                        | 437 ++++++++++++++++++
 tapestry-cdi/build.gradle                       | 114 +++++
 tapestry-cdi/pom.xml                            | 266 +++++++++++
 .../org/apache/tapestry5/cdi/BeanHelper.java    | 154 +++++++
 .../org/apache/tapestry5/cdi/BeanInstance.java  |  51 +++
 .../apache/tapestry5/cdi/CDIInjectModule.java   |  46 ++
 .../tapestry5/cdi/CDIInjectionProvider.java     | 152 +++++++
 .../apache/tapestry5/cdi/CDIObjectProvider.java |  57 +++
 .../cdi/extension/BeanManagerHolder.java        |  43 ++
 .../cdi/extension/TapestryExtension.java        |  50 +++
 .../cdi/internal/utils/InternalUtils.java       | 136 ++++++
 .../src/main/resources/META-INF/beans.xml       |  22 +
 .../javax.enterprise.inject.spi.Extension       |   2 +
 .../apache/tapestry5/cdi/test/InjectTest.java   | 445 +++++++++++++++++++
 .../tapestry5/cdi/test/annotation/Choco.java    |  29 ++
 .../cdi/test/annotation/CustomDessert.java      |  29 ++
 .../cdi/test/annotation/DessertTime.java        |  29 ++
 .../tapestry5/cdi/test/annotation/Iced.java     |  32 ++
 .../cdi/test/annotation/MyStereotype.java       |  33 ++
 .../tapestry5/cdi/test/beans/BrownieImpl.java   |  50 +++
 .../tapestry5/cdi/test/beans/Counter.java       |  34 ++
 .../cdi/test/beans/CounterService.java          |  31 ++
 .../tapestry5/cdi/test/beans/Dessert.java       |  30 ++
 .../cdi/test/beans/DessertFactory.java          |  51 +++
 .../tapestry5/cdi/test/beans/DessertImpl.java   |  47 ++
 .../tapestry5/cdi/test/beans/IceCreamImpl.java  |  50 +++
 .../apache/tapestry5/cdi/test/beans/Menu.java   |  40 ++
 .../tapestry5/cdi/test/beans/NamedPojo.java     |  29 ++
 .../apache/tapestry5/cdi/test/beans/Pojo.java   |  26 ++
 .../apache/tapestry5/cdi/test/beans/Soup.java   |  42 ++
 .../cdi/test/beans/StatefulEJBBean.java         |  28 ++
 .../cdi/test/beans/StatefulEJBBeanImpl.java     |  41 ++
 .../cdi/test/beans/StatelessEJBBean.java        |  25 ++
 .../cdi/test/beans/StatelessEJBBeanImpl.java    |  29 ++
 .../tapestry5/cdi/test/beans/Stereotyped.java   |  47 ++
 .../tapestry5/cdi/test/beans/Vegetable.java     |  62 +++
 .../cdi/test/beans/ws/HelloWorldService.java    |  37 ++
 .../test/beans/ws/HelloWorldServiceImpl.java    |  38 ++
 .../cdi/test/components/DumbComponent.java      |  33 ++
 .../tapestry5/cdi/test/pages/DessertPage.java   |  95 ++++
 .../apache/tapestry5/cdi/test/pages/Index.java  | 122 +++++
 .../cdi/test/pages/InvalidateSessionPage.java   |  30 ++
 .../cdi/test/pages/RequestScopePage.java        |  38 ++
 .../cdi/test/pages/SessionScopePage.java        |  39 ++
 .../tapestry5/cdi/test/pages/SomePage.java      |  20 +
 .../tapestry5/cdi/test/pages/StatefulPage.java  |  42 ++
 .../cdi/test/pages/StereotypePage.java          |  43 ++
 .../tapestry5/cdi/test/pages/VegetablePage.java |  39 ++
 .../apache/tapestry5/cdi/test/pages/WSPage.java |  35 ++
 .../ClasspathURLConverterJBoss7Dot1.java        |  99 +++++
 .../tapestry5/cdi/test/services/PojoModule.java |  32 ++
 tapestry-cdi/src/test/resources/arquillian.xml  |  35 ++
 tapestry-cdi/src/test/resources/log4j.xml       |  59 +++
 .../cdi/test/components/DumbComponent.tml       |   7 +
 .../tapestry5/cdi/test/pages/DessertPage.tml    |  10 +
 .../tapestry5/cdi/test/pages/Index.properties   |  18 +
 .../apache/tapestry5/cdi/test/pages/Index.tml   |  22 +
 .../cdi/test/pages/InvalidateSessionPage.tml    |   2 +
 .../cdi/test/pages/RequestScopePage.tml         |   3 +
 .../cdi/test/pages/SessionScopePage.tml         |   3 +
 .../tapestry5/cdi/test/pages/SomePage.tml       |   2 +
 .../tapestry5/cdi/test/pages/StatefulPage.tml   |   6 +
 .../tapestry5/cdi/test/pages/StereotypePage.tml |   5 +
 .../tapestry5/cdi/test/pages/VegetablePage.tml  |   4 +
 .../apache/tapestry5/cdi/test/pages/WSPage.tml  |   3 +
 66 files changed, 3711 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/settings.gradle
----------------------------------------------------------------------
diff --git a/settings.gradle b/settings.gradle
index 89db79f..6c5092f 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -4,3 +4,4 @@ include "tapestry-beanvalidator", "tapestry-jpa", "tapestry-kaptcha"
 include "tapestry-javadoc", "quickstart", "tapestry-clojure", "tapestry-mongodb"
 include "tapestry-test-data", 'tapestry-internal-test'
 include "tapestry-webresources", "tapestry-runner"
+include "tapestry-cdi"
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/LICENSE.txt
----------------------------------------------------------------------
diff --git a/tapestry-cdi/LICENSE.txt b/tapestry-cdi/LICENSE.txt
new file mode 100644
index 0000000..75248b8
--- /dev/null
+++ b/tapestry-cdi/LICENSE.txt
@@ -0,0 +1,437 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   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.
+
+-------------------------------------------------------------------------------
+
+This module, tapestry-core, includes a number of resources with seperate copyrights and licenses.
+
+-------------------------------------------------------------------------------
+
+JAVASSIST
+
+Javassist is not bundled with tapestry-core, but tapestry-core is not functional without Javassist.
+Javassist is distributed under a dual license: Mozilla Public License or LGPL (Lesser Gnu Public License). Tapestry
+invokes the MPL for compatibility with the Apache Software License.
+
+MOZILLA PUBLIC LICENSE
+Version 1.1
+
+1. Definitions.
+
+      1.0.1. "Commercial Use" means distribution or otherwise making the Covered Code available to a third party.
+
+      1.1. ''Contributor'' means each entity that creates or contributes to the creation of Modifications.
+
+      1.2. ''Contributor Version'' means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor.
+
+      1.3. ''Covered Code'' means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof.
+
+      1.4. ''Electronic Distribution Mechanism'' means a mechanism generally accepted in the software development community for the electronic transfer of data.
+
+      1.5. ''Executable'' means Covered Code in any form other than Source Code.
+
+      1.6. ''Initial Developer'' means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A.
+
+      1.7. ''Larger Work'' means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.
+
+      1.8. ''License'' means this document.
+
+      1.8.1. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.
+
+      1.9. ''Modifications'' means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is:
+            A. Any addition to or deletion from the contents of a file containing Original Code or previous Modifications.
+
+            B. Any new file that contains any part of the Original Code or previous Modifications.
+             
+      1.10. ''Original Code'' means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License.
+
+      1.10.1. "Patent Claims" means any patent claim(s), now owned or hereafter acquired, including without limitation,  method, process, and apparatus claims, in any patent Licensable by grantor.
+
+      1.11. ''Source Code'' means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an Executable, or source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor's choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge.
+
+      1.12. "You'' (or "Your")  means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, "You'' includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control'' means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
+
+2. Source Code License.
+
+      2.1. The Initial Developer Grant.
+      The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims:
+            (a)  under intellectual property rights (other than patent or trademark) Licensable by Initial Developer to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, and/or as part of a Larger Work; and
+
+            (b) under Patents Claims infringed by the making, using or selling of Original Code, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Code (or portions thereof).
+            (c) the licenses granted in this Section 2.1(a) and (b) are effective on the date Initial Developer first distributes Original Code under the terms of this License.
+
+            (d) Notwithstanding Section 2.1(b) above, no patent license is granted: 1) for code that You delete from the Original Code; 2) separate from the Original Code;  or 3) for infringements caused by: i) the modification of the Original Code or ii) the combination of the Original Code with other software or devices.
+             
+      2.2. Contributor Grant.
+      Subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license
+
+            (a)  under intellectual property rights (other than patent or trademark) Licensable by Contributor, to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code and/or as part of a Larger Work; and
+
+            (b) under Patent Claims infringed by the making, using, or selling of  Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications made by that Contributor (or portions thereof); and 2) the combination of  Modifications made by that Contributor with its Contributor Version (or portions of such combination).
+
+            (c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first makes Commercial Use of the Covered Code.
+
+            (d)    Notwithstanding Section 2.2(b) above, no patent license is granted: 1) for any code that Contributor has deleted from the Contributor Version; 2)  separate from the Contributor Version;  3)  for infringements caused by: i) third party modifications of Contributor Version or ii)  the combination of Modifications made by that Contributor with other software  (except as part of the Contributor Version) or other devices; or 4) under Patent Claims infringed by Covered Code in the absence of Modifications made by that Contributor.
+
+
+3. Distribution Obligations.
+
+      3.1. Application of License.
+      The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients' rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5.
+
+      3.2. Availability of Source Code.
+      Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable version or via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available; and if made available via Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party.
+
+      3.3. Description of Modifications.
+      You must cause all Covered Code to which You contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code.
+
+      3.4. Intellectual Property Matters
+            (a) Third Party Claims.
+            If Contributor has knowledge that a license under a third party's intellectual property rights is required to exercise the rights granted by such Contributor under Sections 2.1 or 2.2, Contributor must include a text file with the Source Code distribution titled "LEGAL'' which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If Contributor obtains such knowledge after the Modification is made available as described in Section 3.2, Contributor shall promptly modify the LEGAL file in all copies Contributor makes available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained.
+
+            (b) Contributor APIs.
+            If Contributor's Modifications include an application programming interface and Contributor has knowledge of patent licenses which are reasonably necessary to implement that API, Contributor must also include this information in the LEGAL file.
+             
+                (c)    Representations.
+            Contributor represents that, except as disclosed pursuant to Section 3.4(a) above, Contributor believes that Contributor's Modifications are Contributor's original creation(s) and/or Contributor has sufficient rights to grant the rights conveyed by this License.
+
+
+      3.5. Required Notices.
+      You must duplicate the notice in Exhibit A in each file of the Source Code.  If it is not possible to put such notice in a particular Source Code file due to its structure, then You must include such notice in a location (such as a relevant directory) where a user would be likely to look for such a notice.  If You created one or more Modification(s) You may add your name as a Contributor to the notice described in Exhibit A.  You must also duplicate this License in any documentation for the Source Code where You describe recipients' rights or ownership rights relating to Covered Code.  You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby
  agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer.
+
+      3.6. Distribution of Executable Versions.
+      You may distribute Covered Code in Executable form only if the requirements of Section 3.1-3.5 have been met for that Covered Code, and if You include a notice stating that the Source Code version of the Covered Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable version, related documentation or collateral in which You describe recipients' rights relating to the Covered Code. You may distribute the Executable version of Covered Code or ownership rights under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient's rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version 
 under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or any Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer.
+
+      3.7. Larger Works.
+      You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+
+      If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.
+
+5. Application of this License.
+
+      This License applies to code to which the Initial Developer has attached the notice in Exhibit A and to related Covered Code.
+
+6. Versions of the License.
+
+      6.1. New Versions.
+      Netscape Communications Corporation (''Netscape'') may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number.
+
+      6.2. Effect of New Versions.
+      Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License published by Netscape. No one other than Netscape has the right to modify the terms applicable to Covered Code created under this License.
+
+      6.3. Derivative Works.
+      If You create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), You must (a) rename Your license so that the phrases ''Mozilla'', ''MOZILLAPL'', ''MOZPL'', ''Netscape'', "MPL", ''NPL'' or any confusingly similar phrase do not appear in your license (except to note that your license differs from this License) and (b) otherwise make it clear that Your version of the license contains terms which differ from the Mozilla Public License and Netscape Public License. (Filling in the name of the Initial Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.)
+
+7. DISCLAIMER OF WARRANTY.
+
+      COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS'' BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+8. TERMINATION.
+
+      8.1.  This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
+
+      8.2.  If You initiate litigation by asserting a patent infringement claim (excluding declatory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You file such action is referred to as "Participant")  alleging that:
+
+      (a)  such Participant's Contributor Version directly or indirectly infringes any patent, then any and all rights granted by such Participant to You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively, unless if within 60 days after receipt of notice You either: (i)  agree in writing to pay Participant a mutually agreeable reasonable royalty for Your past and future use of Modifications made by such Participant, or (ii) withdraw Your litigation claim with respect to the Contributor Version against such Participant.  If within 60 days of notice, a reasonable royalty and payment arrangement are not mutually agreed upon in writing by the parties or the litigation claim is not withdrawn, the rights granted by Participant to You under Sections 2.1 and/or 2.2 automatically terminate at the expiration of the 60 day notice period specified above.
+
+      (b)  any software, hardware, or device, other than such Participant's Contributor Version, directly or indirectly infringes any patent, then any rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are revoked effective as of the date You first made, used, sold, distributed, or had made, Modifications made by that Participant.
+
+      8.3.  If You assert a patent infringement claim against Participant alleging that such Participant's Contributor Version directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license.
+
+      8.4.  In the event of termination under Sections 8.1 or 8.2 above,  all end user license agreements (excluding distributors and resellers) which have been validly granted by You or any distributor hereunder prior to termination shall survive termination.
+
+9. LIMITATION OF LIABILITY.
+
+      UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS.
+
+      The Covered Code is a ''commercial item,'' as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of ''commercial computer software'' and ''commercial computer software documentation,'' as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Code with only those rights set forth herein.
+
+11. MISCELLANEOUS.
+
+      This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by California law provisions (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in the United States of America, any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California, with venue lying in Santa Clara County, California, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys' fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excl
 uded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License.
+
+12. RESPONSIBILITY FOR CLAIMS.
+
+      As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability.
+
+13. MULTIPLE-LICENSED CODE.
+
+      Initial Developer may designate portions of the Covered Code as �Multiple-Licensed?.  �Multiple-Licensed? means that the Initial Developer permits you to utilize portions of the Covered Code under Your choice of the MPL or the alternative licenses, if any, specified by the Initial Developer in the file described in Exhibit A.
+
+
+EXHIBIT A -Mozilla Public License.
+
+      The contents of this file are subject to the Mozilla Public License Version 1.1 (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.mozilla.org/MPL/
+
+      Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
+      ANY KIND, either express or implied. See the License for the specific language governing rights and
+      limitations under the License.
+
+      The Original Code is Javassist.
+
+      The Initial Developer of the Original Code is Shigeru Chiba. Portions created by the Initial Developer are
+        Copyright (C) 1999-2006 Shigeru Chiba. All Rights Reserved.
+
+      Contributor(s): ______________________________________.
+
+      Alternatively, the contents of this file may be used under the terms of the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), in which case the provisions of the LGPL are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of the LGPL, and not to allow others to use your version of this file under the terms of the MPL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the LGPL. If you do not delete the provisions above, a recipient may use your version of this file under the terms of either the MPL or the LGPL.
+
+
+-------------------------------------------------------------------------------
+
+PROTOTYPE
+
+Copyright (c) 2005-2007 Sam Stephenson
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+-------------------------------------------------------------------------------
+
+SCRIPTACULOUS
+
+Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+-------------------------------------------------------------------------------
+
+WEBFX DATEPICKER
+
+Distributed under the terms of the Apache Software License 2.0.
+  
+  

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/build.gradle
----------------------------------------------------------------------
diff --git a/tapestry-cdi/build.gradle b/tapestry-cdi/build.gradle
new file mode 100755
index 0000000..e105a73
--- /dev/null
+++ b/tapestry-cdi/build.gradle
@@ -0,0 +1,114 @@
+import org.gradle.plugins.ide.idea.model.*
+import t5build.*
+
+description = "Bridge to CDI for Apache Tapestry 5 Project"
+
+apply plugin: JavaPlugin
+
+buildDir = 'target/gradle-build'
+       
+project.ext.libraryVersions = [
+    javaeeapi: '6.0-4', 
+    tomee: '1.6.0', 
+    ziplock: '1.5.1',
+    junit: '4.8.1', 
+    commonsHttpclient: '3.1',
+    arquillian: '1.1.1.Final', 
+    jbossJavaeeSpec: '1.0.0.Final',
+    arquillianGlassfish: '1.0.0.CR4',
+    glassfishDistrib: '3.1.1-b04', 
+    jbossDistrib: '7.1.1.Final', 
+    cdi: '1.0-SP4',
+    jbossAS7: '7.1.1.Final', 
+    shrinkwrapDesc: '2.0.0-alpha-3'
+]
+
+
+configurations {
+    compileOnly 
+    jboss
+    glassfish
+    tomeeEmbeddedTestRuntime  { extendsFrom testRuntime, compileOnly }
+    jbossAS7ManagedTestRuntime { extendsFrom testRuntime, compileOnly }
+    glassfishManagedTestRuntime { extendsFrom testRuntime, compileOnly }
+}
+
+dependencies {
+    compile project(':tapestry-core')
+    compile project(':tapestry-ioc')
+    testCompile (project(':tapestry-test')){
+         transitive = false
+     } 
+      
+    // replace javax.enterprise:cdi-api with group: 'org.jboss.spec', name: 'jboss-javaee-6.0', version: libraryVersions.jbossJavaeeSpec to compile against full Java EE API
+    compileOnly group: 'javax.enterprise', name: 'cdi-api', version: libraryVersions.cdi
+    
+    
+    testCompile group: 'org.apache.openejb', name: 'ziplock', version: libraryVersions.ziplock
+    testCompile group: 'junit', name: 'junit', version: libraryVersions.junit
+    testCompile group: 'commons-httpclient', name: 'commons-httpclient', version: libraryVersions.commonsHttpclient
+    
+    testCompile group: 'org.jboss.arquillian.junit', name: 'arquillian-junit-container', version: libraryVersions.arquillian
+    testCompile group: 'org.jboss.shrinkwrap.descriptors', name: 'shrinkwrap-descriptors-api-javaee', version: libraryVersions.shrinkwrapDesc
+    testRuntime group: 'org.jboss.shrinkwrap.descriptors', name: 'shrinkwrap-descriptors-impl-javaee', version: libraryVersions.shrinkwrapDesc
+    
+    tomeeEmbeddedTestRuntime group: 'org.apache.openejb', name: 'arquillian-tomee-embedded', version: libraryVersions.tomee
+    
+    jbossAS7ManagedTestRuntime group: 'org.jboss.as', name: 'jboss-as-arquillian-container-managed', version: libraryVersions.jbossAS7
+    jbossAS7ManagedTestRuntime group: 'org.jboss.spec', name: 'jboss-javaee-6.0', version: libraryVersions.jbossJavaeeSpec
+    jboss "org.jboss.as:jboss-as-dist:$libraryVersions.jbossDistrib@zip"
+ 
+    glassfishManagedTestRuntime group: 'org.jboss.arquillian.container', name: 'arquillian-glassfish-managed-3.1', version: libraryVersions.arquillianGlassfish
+    glassfish "org.glassfish.distributions:glassfish:$libraryVersions.glassfishDistrib@zip"     
+}
+
+sourceSets {
+    main {
+        compileClasspath = configurations.compile + configurations.compileOnly
+    }
+    test {
+        compileClasspath = compileClasspath + configurations.compileOnly
+    }
+}
+
+task resolveJBoss(type: Copy) {  
+    destinationDir = file('target') 
+    from { zipTree(configurations.jboss.singleFile) }
+}
+
+task resolveGlassfish(type: Copy) {
+    destinationDir = file('target')
+    from { zipTree(configurations.glassfish.singleFile) }
+}
+
+
+task tomeeEmbeddedTest(type: Test) {
+  systemProperty 'arquillian.launch', "tomee_embedded"
+}
+
+task jbossAS7ManagedTest(type: Test) {
+  systemProperty 'arquillian.launch', "jbossas_managed"
+   dependsOn { resolveJBoss }
+}
+
+task glassfishManagedTest(type: Test){
+  systemProperty 'arquillian.launch', "glassfish_managed"
+   dependsOn { resolveGlassfish }
+}
+
+tasks.withType(Test).matching({ t-> t.name.endsWith('Test') } as Spec).each { t ->
+    t.testClassesDir = sourceSets.test.output.classesDir
+    t.classpath = sourceSets.test.output + sourceSets.main.output + configurations[t.name + 'Runtime']
+}
+
+test {
+  dependsOn { tomeeEmbeddedTest }
+  setEnabled(false)
+}
+
+jar {	
+
+	manifest {	
+		attributes 'Tapestry-Module-Classes': 'org.apache.tapestry5.cdi.CDIInjectModule'
+		}
+ }

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/pom.xml
----------------------------------------------------------------------
diff --git a/tapestry-cdi/pom.xml b/tapestry-cdi/pom.xml
new file mode 100755
index 0000000..eb83669
--- /dev/null
+++ b/tapestry-cdi/pom.xml
@@ -0,0 +1,266 @@
+<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/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  
+  <parent>
+    <groupId>org.sonatype.oss</groupId>
+    <artifactId>oss-parent</artifactId>
+    <version>7</version>
+  </parent>
+  
+  <groupId>org.apache.tapestry</groupId>
+  <artifactId>tapestry-cdi</artifactId>
+  <version>1.0.0-SNAPSHOT</version>
+  <name>Tapestry 5 CDI Module</name>
+  <packaging>${packaging.type}</packaging>
+  <description>CDI integration for Tapestry</description>
+  <url>https://github.com/got5/tapestry-cdi</url>
+   <licenses>
+       <license>
+           <name>The Apache Software License, Version 2.0</name>
+           <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+           <distribution>repo</distribution>
+       </license>
+   </licenses>
+   <scm>
+	   <connection>scm:git:git@github.com:got5/tapestry-cdi.git</connection>
+	   <developerConnection>scm:git:git@github.com:got5/tapestry-cdi.git</developerConnection>
+	   <url>git@github.com:got5/tapestry-cdi.git</url>
+   </scm>
+   <developers>
+	   <developer>
+	   		<id>rmannibucau</id>
+			<name>Romain MANNI-BUCAU</name>
+			<roles>
+		    	<role>Developer</role>
+		    </roles>
+		    <timezone>+1</timezone>
+		</developer>
+		<developer>
+		    <id>adaptivui</id>
+	       <name>Nourredine KHADRI</name>
+	       <email>nourredine.k@gmail.com</email>
+	       <roles>
+	       		<role>Developer</role>
+	       </roles>
+	       <timezone>+1</timezone>
+	   </developer>
+	   <developer>
+	       <id>krazar</id>
+	       <name>Pierre MAROT</name>
+	       <roles>
+	       		<role>Developer</role>
+	       </roles>
+	       <timezone>+1</timezone>
+	   </developer>
+	   <developer>
+	       <id>got5</id>
+	       <name>François FACON</name>
+	       <roles>
+	       		<role>Developer</role>
+	       </roles>
+	       <timezone>+1</timezone>
+	    </developer>
+   </developers>
+   <repositories>
+		<repository>
+			<id>staging</id>
+			<url>https://repository.apache.org/content/groups/staging</url>
+			<snapshots>
+				<enabled>true</enabled>
+			</snapshots>
+		</repository>
+	</repositories>
+  
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.openejb</groupId>
+      <artifactId>javaee-api</artifactId>
+      <version>${javaee-api.version}</version>
+      <scope>provided</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.tapestry</groupId>
+      <artifactId>tapestry-core</artifactId>
+      <version>${tapestry-core.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.openejb</groupId>
+      <artifactId>arquillian-tomee-embedded</artifactId>
+      <version>${arquillian-tomee-embedded.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.openejb</groupId>
+      <artifactId>ziplock</artifactId>
+      <version>${ziplock.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.arquillian.junit</groupId>
+      <artifactId>arquillian-junit-container</artifactId>
+      <version>${arquillian.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.arquillian.container</groupId>
+      <artifactId>arquillian-container-spi</artifactId>
+      <version>${arquillian-container-spi.version}</version>
+      <scope>test</scope>
+    </dependency>    
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>${junit.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+    	<groupId>commons-httpclient</groupId>
+    	<artifactId>commons-httpclient</artifactId>
+    	<version>${commons-httpclient.version}</version>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <version>${maven-jar-plugin.version}</version>
+        <configuration>
+          <archive>
+            <manifestEntries>
+              <Tapestry-Module-Classes>org.apache.tapestry5.cdi.CDIInjectModule</Tapestry-Module-Classes>
+            </manifestEntries>
+          </archive>
+        </configuration>
+      </plugin>
+     
+      <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <version>${maven-compiler-plugin.version}</version>
+          <configuration>
+          <source>1.6</source>
+          <target>1.6</target>
+        </configuration>
+      </plugin>
+
+     </plugins>
+  </build>
+
+  <properties>
+    <tapestry-cdi.version>1.0.0-SNAPSHOT</tapestry-cdi.version>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <javaee-api.version>6.0-4</javaee-api.version>
+    <tapestry-core.version>5.4-alpha-29</tapestry-core.version>
+    <arquillian.version>1.1.1.Final</arquillian.version>
+    <arquillian-container-spi.version>1.1.0.Final</arquillian-container-spi.version>  
+    <arquillian-tomee-embedded.version>1.5.2</arquillian-tomee-embedded.version>  
+    <ziplock.version>1.5.1</ziplock.version>
+    <junit.version>4.11</junit.version>
+    <maven-jar-plugin.version>2.4</maven-jar-plugin.version>
+    <maven-compiler-plugin.version>3.0</maven-compiler-plugin.version>
+    <commons-httpclient.version>3.1</commons-httpclient.version>
+  </properties>
+  
+  <profiles>
+     <profile>
+           <id>module</id>
+           <activation>
+               <activeByDefault>true</activeByDefault>
+           </activation>
+           <properties>
+                <packaging.type>jar</packaging.type>
+           </properties>
+           <build>
+      		<plugins>
+	      		<plugin>
+				  <groupId>org.apache.maven.plugins</groupId>
+				  <artifactId>maven-source-plugin</artifactId>
+				  <executions>
+				    <execution>
+				      <id>attach-sources</id>
+				      <goals>
+				        <goal>jar</goal>
+				      </goals>
+				    </execution>
+				  </executions>
+				</plugin>
+				<plugin>
+				  <groupId>org.apache.maven.plugins</groupId>
+				  <artifactId>maven-javadoc-plugin</artifactId>
+				  <executions>
+				    <execution>
+				      <id>attach-javadocs</id>
+				      <goals>
+				        <goal>jar</goal>
+				      </goals>
+				    </execution>
+				  </executions>
+				</plugin>
+			</plugins>
+		   </build> 
+     </profile>
+     <profile>
+            <id>webapp</id>
+            <properties>
+                <packaging.type>war</packaging.type>
+                <tomee.version>1.5.2</tomee.version>
+                <tomee-plugin.version>1.0.1</tomee-plugin.version>
+            </properties>
+      		<build>
+      		<finalName>tapestry-cdi</finalName>
+      		<plugins>
+      		   <plugin>
+        		<artifactId>maven-clean-plugin</artifactId>
+        		<version>2.4.1</version>
+      		  </plugin>	
+	      	  <plugin>
+		        <groupId>org.apache.maven.plugins</groupId>
+		        <artifactId>maven-war-plugin</artifactId>
+		        <version>2.3</version>
+		        <configuration>
+		          <failOnMissingWebXml>false</failOnMissingWebXml>
+		          <maven-war-plugin>tapestry-cdi</maven-war-plugin>
+		       	<webResources>
+	            <resource>
+	              <directory>${project.build.directory}/test-classes</directory>
+	              <targetPath>WEB-INF/classes</targetPath>
+	              <excludes>
+                	<exclude>**/InjectTest.class</exclude>
+              	  </excludes>
+	            </resource>
+	          	</webResources>
+	          	
+        		</configuration>
+		      </plugin>
+		
+		      <plugin>
+		        <groupId>org.apache.maven.plugins</groupId>
+		        <artifactId>maven-surefire-plugin</artifactId>
+		        <version>2.13</version>
+		      </plugin>
+		      <plugin>
+               <groupId>org.apache.openejb.maven</groupId>
+               <artifactId>tomee-maven-plugin</artifactId>
+               <version>${tomee-plugin.version}</version>
+               <configuration>
+               		  <simpleLog>true</simpleLog>	
+                      <tomeeVersion>${tomee.version}</tomeeVersion>
+                      <!-- <debug>true</debug> -->
+                      <tomeeClassifier>plus</tomeeClassifier>
+                      <libs>
+                             <lib>org.apache.tapestry:tapestry-core:${tapestry-core.version}</lib>
+                             <lib>org.apache.tapestry:tapestry-ioc:${tapestry-core.version}</lib>
+                             <lib>org.apache.tapestry:tapestry-cdi:${tapestry-cdi.version}</lib>               
+                      </libs>
+                      <args>-Xms256m -Xmx1024m</args>
+               </configuration>
+          </plugin>
+		  </plugins>
+		  </build>
+    </profile>
+  </profiles>
+</project>

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/BeanHelper.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/BeanHelper.java b/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/BeanHelper.java
new file mode 100755
index 0000000..f8f736e
--- /dev/null
+++ b/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/BeanHelper.java
@@ -0,0 +1,154 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi;
+
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import javax.enterprise.context.Dependent;
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.Any;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.BeanManager;
+
+import org.apache.tapestry5.cdi.extension.BeanManagerHolder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Helper that provides you handy methods to get a BeanManager instance or any CDI bean instance from its interface and eventually qualifiers 
+ *
+ */
+public final class BeanHelper {
+
+	private static Logger logger = LoggerFactory.getLogger(BeanHelper.class); 
+
+	private BeanHelper() {
+		// no-op
+	}
+
+	/**
+	 * Get a BeanInstance from a type and its qualifiers
+	 * @param clazz the class representing the bean's type 
+	 * @param qualifiers an array representing the bean's qualifiers
+	 * @return a BeanInstance
+	 */
+	public static BeanInstance getInstance(final Class<?> clazz, final Annotation[] qualifiers) {
+		final BeanManager beanManager = getBeanManager();
+		final Set<Bean<?>> beans = beanManager.getBeans(clazz, qualifiers);
+		logger.debug("getInstance() - beans found : "+beans+" for class "+clazz.getSimpleName());
+		if (beans == null || beans.isEmpty()) {
+			return null;
+		}
+		final Bean<?> bean = beanManager.resolve(beans);
+		logger.debug("getInstance() - bean resolved : "+bean);
+		final CreationalContext<?> creationalContext = beanManager.createCreationalContext(bean);
+		final Object result = beanManager.getReference(bean, clazz, creationalContext);
+		return new BeanInstance(result, creationalContext, Dependent.class.equals(bean.getScope()));
+	}
+
+
+	/**
+	 * Handy method that returns a bean from its type and qualifiers
+	 * @param clazz the class representing the bean's type 
+	 * @param qualifiers an array representing the bean's qualifiers
+	 * @return a instance of the bean 
+	 */
+	@SuppressWarnings("unchecked")
+	public static <T> T get(final Class<T> clazz, final Annotation[] qualifiers) {
+		final BeanManager beanManager = getBeanManager();
+		Annotation[] beanQualifiers = qualifiers;
+		if(beanQualifiers == null || beanQualifiers.length == 0){
+			beanQualifiers = new Annotation[]{};
+		}
+		Set<Bean<?>> beans = beanManager.getBeans(clazz, beanQualifiers);
+		if(beans!=null && beans.size()>0) {
+			Bean<T> bean = (Bean<T>) beanManager.resolve(beans);
+			logger.debug("Bean found : "+bean);
+			CreationalContext<T> ctx = beanManager.createCreationalContext(bean);
+			T o = clazz.cast(beanManager.getReference(bean, clazz, ctx));
+			logger.debug("Found and returning: "+clazz.getCanonicalName());
+			return o;
+		}
+		return null;
+	}
+	
+	/**
+	 * Handy method that returns a bean without qualifiers from its type
+	 * @param clazz the class representing the bean's type 
+	 * @return a instance of the bean 
+	 */
+	public static <T> T get(Class<T> clazz) {
+		return get(clazz, null);
+	}
+
+	/**
+	 * Filter qualifiers from a list of annotations
+	 * @param annotations an annotation array that may contain qualifiers
+	 * @return an annotation array that contains exclusively qualifiers
+	 */
+	public static Annotation[] getQualifiers(final Annotation[] annotations) {
+		final BeanManager bm = getBeanManager();
+		final List<Annotation> qualifiers = new ArrayList<Annotation>();
+		for (Annotation annotation : annotations) {
+			logger.debug("Check annotation : "+annotation+"...");
+			if (bm.isQualifier(annotation.annotationType())) {
+				qualifiers.add(annotation);
+			}
+		}
+		return qualifiers.toArray(new Annotation[qualifiers.size()]);
+	}
+
+	/**
+	 * Get all qualifiers of a type
+	 * @param clazz the class of which we retrieve the qualifiers
+	 * @return an annotation array
+	 */
+	public static Annotation[] getQualifiers(final Class<?> clazz) {
+		final BeanManager beanManager = getBeanManager();
+		final List<Annotation> qualifiers = new ArrayList<Annotation>();
+		// Get all qualified bean by using the @Any annotation
+		final Set<Bean<?>> beans = beanManager.getBeans(clazz, 
+				new Annotation[]{
+				new Any() {
+					@Override
+					public Class<? extends Annotation> annotationType() {
+						return Any.class;
+					}
+				}
+		}
+				);
+		logger.debug("Qualified bean found for class "+clazz.getSimpleName());
+		for (Bean<?> bean : beans) {
+			for (Annotation annotation : bean.getQualifiers()) {
+				if(! annotation.annotationType().isAssignableFrom(Any.class)){
+					logger.debug("==> ["+annotation.annotationType()+"] Qualifier found for bean "+bean.toString());
+					qualifiers.add(annotation);
+				}
+			}
+		}
+		return qualifiers.toArray(new Annotation[qualifiers.size()]);
+
+	}
+
+	/**
+	 * @return the BeanManager
+	 */
+	private static BeanManager getBeanManager() {
+		return BeanManagerHolder.get();
+	}
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/BeanInstance.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/BeanInstance.java b/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/BeanInstance.java
new file mode 100755
index 0000000..d0f64bc
--- /dev/null
+++ b/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/BeanInstance.java
@@ -0,0 +1,51 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi;
+
+import javax.enterprise.context.spi.CreationalContext;
+
+/**
+ * A CDI bean wrapper that embeds a {@link javax.enterprise.context.spi.CreationalContext CreationalContext}
+ *
+ */
+public class BeanInstance {
+    private final Object bean;
+    private boolean releasable;
+    private final CreationalContext<?> context;
+
+    public BeanInstance(final Object bean, final CreationalContext<?> context, boolean releasable) {
+        this.bean = bean;
+        this.context = context;
+        this.releasable = releasable;
+    }
+
+    public boolean isResolved() {
+        return bean != null;
+    }
+
+    public Object getBean() {
+        return bean;
+    }
+
+    public void release() {
+        if (isReleasable()) {
+            context.release();
+        }
+    }
+
+    public boolean isReleasable() {
+        return releasable;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/CDIInjectModule.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/CDIInjectModule.java b/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/CDIInjectModule.java
new file mode 100755
index 0000000..77d034c
--- /dev/null
+++ b/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/CDIInjectModule.java
@@ -0,0 +1,46 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi;
+
+import org.apache.tapestry5.ioc.ObjectProvider;
+import org.apache.tapestry5.ioc.OrderedConfiguration;
+import org.apache.tapestry5.ioc.ServiceBinder;
+import org.apache.tapestry5.ioc.annotations.Contribute;
+import org.apache.tapestry5.ioc.annotations.Local;
+import org.apache.tapestry5.ioc.services.MasterObjectProvider;
+import org.apache.tapestry5.services.transform.InjectionProvider2;
+
+/**
+ * This module provides an InjectionProvider and an ObjectProvider to handle CDI beans
+ *
+ */
+public final class CDIInjectModule {
+	
+	public static void bind(ServiceBinder binder) {
+		binder.bind(ObjectProvider.class, CDIObjectProvider.class);
+	} 
+	
+	@Contribute(value=MasterObjectProvider.class)
+	public static void provideMasterObjectProvider(
+			@Local ObjectProvider cdiProvider,
+			OrderedConfiguration<ObjectProvider> configuration) {
+		configuration.add("cdiProvider", cdiProvider, "after:*");
+	}
+	
+	@Contribute(InjectionProvider2.class)
+	public static void provideStandardInjectionProviders(final OrderedConfiguration<InjectionProvider2> configuration) {
+		configuration.addInstance("CDI", CDIInjectionProvider.class, "before:*");
+	}
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/CDIInjectionProvider.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/CDIInjectionProvider.java b/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/CDIInjectionProvider.java
new file mode 100755
index 0000000..0889c42
--- /dev/null
+++ b/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/CDIInjectionProvider.java
@@ -0,0 +1,152 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi;
+
+import static org.apache.tapestry5.cdi.BeanHelper.getInstance;
+import static org.apache.tapestry5.cdi.BeanHelper.getQualifiers;
+
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.tapestry5.cdi.internal.utils.InternalUtils;
+import org.apache.tapestry5.internal.services.ComponentClassCache;
+import org.apache.tapestry5.ioc.AnnotationProvider;
+import org.apache.tapestry5.ioc.ObjectLocator;
+import org.apache.tapestry5.ioc.annotations.PostInjection;
+import org.apache.tapestry5.ioc.annotations.Symbol;
+import org.apache.tapestry5.ioc.annotations.UsesOrderedConfiguration;
+import org.apache.tapestry5.ioc.services.RegistryShutdownHub;
+import org.apache.tapestry5.model.MutableComponentModel;
+import org.apache.tapestry5.plastic.PlasticField;
+import org.apache.tapestry5.services.transform.InjectionProvider2;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * An InjectionProvider implementation that handles CDI beans
+ * Check first that the bean is not managed by tapestry-ioc
+ * If so, it is ignored by CDI 
+ */
+@UsesOrderedConfiguration(InjectionProvider2.class)
+public final class CDIInjectionProvider implements InjectionProvider2 {
+	private final ComponentClassCache cache;
+	private final ObjectLocator locator;
+	@SuppressWarnings("rawtypes")
+	private final Map<Class, Annotation[]> annotationsCache = new HashMap<Class, Annotation[]>();
+	private final Collection<BeanInstance> instancesToRelease = new ArrayList<BeanInstance>();
+
+	private static Logger logger = LoggerFactory.getLogger(CDIInjectionProvider.class); 
+
+	public CDIInjectionProvider(final ObjectLocator locator, final ComponentClassCache cache) {
+		this.locator = locator;
+		this.cache = cache;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.tapestry5.services.transform.InjectionProvider2#provideInjection(org.apache.tapestry5.plastic.PlasticField, org.apache.tapestry5.ioc.ObjectLocator, org.apache.tapestry5.model.MutableComponentModel)
+	 */
+	@SuppressWarnings("rawtypes")
+	@Override
+	public boolean provideInjection(final PlasticField field, final ObjectLocator locator, final MutableComponentModel componentModel) {
+		Class type = cache.forName(field.getTypeName());
+		if(InternalUtils.isManagedByTapestry(
+				type, 
+				new AnnotationProvider(){
+
+					@Override
+					public <T extends Annotation> T getAnnotation(
+							Class<T> annotationClass) {
+						return field.getAnnotation(annotationClass);
+					}}, 
+				locator)){
+			logger.debug("Field "+field.getName()+" of type "+field.getTypeName()+" is managed by Tapestry");
+			return false;
+		}
+
+		logger.debug("Field "+field.getName()+" of type "+field.getTypeName()+" will be managed by CDI");
+		final Class<?> fieldClass = load(field.getTypeName());
+		final Annotation[] qualifiers = 
+				InternalUtils.getFieldQualifiers(type, new AnnotationProvider(){
+
+					@Override
+					public <T extends Annotation> T getAnnotation(
+							Class<T> annotationClass) {
+						return field.getAnnotation(annotationClass);
+					}});
+		
+		logger.debug("["+field.getName()+"]["+componentModel.getComponentClassName()+"] Qualifiers : ");
+		for (Annotation annotation : qualifiers) {
+			logger.debug("==> "+annotation.toString());
+		}
+		try {
+			final BeanInstance instance = getInstance(fieldClass, qualifiers);
+			final boolean resolved = instance != null && instance.isResolved();
+			if (resolved) {
+				field.inject(instance.getBean());
+			}
+
+			if (instance != null && instance.isReleasable()) {
+				synchronized (instancesToRelease) {
+					instancesToRelease.add(instance);
+				}
+			}
+			logger.debug("Is field "+field.getName()+" of type "+field.getTypeName()+" has been succesfully managed by CDI ? "+resolved);
+			return resolved;
+		} catch (IllegalStateException isa) {
+			logger.debug("CDI failed to manage the field "+field.getName()+" of type "+field.getTypeName());
+			return false;
+		}
+	}
+
+	private Class<?> load(String typeName) {
+		try {
+			return cache.forName(typeName);
+		} catch (RuntimeException re) {
+			try {
+				return Thread.currentThread().getContextClassLoader().loadClass(typeName);
+			} catch (ClassNotFoundException e) {
+				throw re;
+			}
+		}
+	}
+
+	@PostInjection
+	public void startupService(final RegistryShutdownHub shutdownHub) {
+		shutdownHub.addRegistryShutdownListener(new ShutdownCleanUpListener(instancesToRelease));
+	}
+
+	private static class ShutdownCleanUpListener implements Runnable {
+		private final Collection<BeanInstance> releasables;
+
+		public ShutdownCleanUpListener(final Collection<BeanInstance> instancesToRelease) {
+			releasables = instancesToRelease;
+		}
+
+		@Override
+		public void run() {
+			synchronized (releasables) { // should be useless but just to be sure
+				for (BeanInstance instance : releasables) {
+					instance.release();
+				}
+				releasables.clear();
+			}
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/CDIObjectProvider.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/CDIObjectProvider.java b/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/CDIObjectProvider.java
new file mode 100755
index 0000000..e9454bf
--- /dev/null
+++ b/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/CDIObjectProvider.java
@@ -0,0 +1,57 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi;
+
+import java.lang.annotation.Annotation;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.tapestry5.cdi.internal.utils.InternalUtils;
+import org.apache.tapestry5.ioc.AnnotationProvider;
+import org.apache.tapestry5.ioc.ObjectLocator;
+import org.apache.tapestry5.ioc.ObjectProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * An ObjectProvider implementation that handles CDI beans
+ * Check first if the bean is managed by tapestry-ioc
+ * if so, the bean is ignored.
+ *
+ */
+public class CDIObjectProvider implements ObjectProvider {
+
+	private static Logger logger = LoggerFactory.getLogger(CDIObjectProvider.class); 
+
+	/* (non-Javadoc)
+	 * @see org.apache.tapestry5.ioc.ObjectProvider#provide(java.lang.Class, org.apache.tapestry5.ioc.AnnotationProvider, org.apache.tapestry5.ioc.ObjectLocator)
+	 */
+	@Override
+	public <T> T provide(Class<T> objectType,
+			AnnotationProvider annotationProvider, ObjectLocator locator) {
+		
+		if(InternalUtils.isManagedByTapestry(objectType, annotationProvider, locator)){
+			return null;
+		}
+		
+		Annotation[] qualifiers = InternalUtils.getFieldQualifiers(objectType,annotationProvider);
+		
+		logger.debug("Try to load "+objectType+" - qualifiers ? : "+qualifiers.length);
+		
+		return BeanHelper.get(objectType, qualifiers);
+	}
+
+	
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/extension/BeanManagerHolder.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/extension/BeanManagerHolder.java b/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/extension/BeanManagerHolder.java
new file mode 100755
index 0000000..56b6681
--- /dev/null
+++ b/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/extension/BeanManagerHolder.java
@@ -0,0 +1,43 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.extension;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.AfterBeanDiscovery;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.Extension;
+
+/**
+ * A Holder that provides the {@link javax.enterprise.inject.spi.BeanManager BeanManager} instance by observing the CDI {@link javax.enterprise.inject.spi.AfterBeanDiscovery AfterBeanDiscovery} event
+ *
+ */
+public class BeanManagerHolder implements Extension {
+    private static BeanManagerHolder HOLDER = new BeanManagerHolder();
+    private BeanManager beanManager;
+
+    public static BeanManager get() {
+        return HOLDER.beanManager;
+    }
+
+    /**
+     * Store the {@link javax.enterprise.inject.spi.BeanManager BeanManager} during the container startup
+     * @param afterBeanDiscovery the CDI event
+     * @param bm a BeanManager object
+     */
+    protected void saveBeanManager(@Observes final AfterBeanDiscovery afterBeanDiscovery, final BeanManager bm) {
+    	HOLDER.beanManager = bm;
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/extension/TapestryExtension.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/extension/TapestryExtension.java b/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/extension/TapestryExtension.java
new file mode 100755
index 0000000..c8c4965
--- /dev/null
+++ b/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/extension/TapestryExtension.java
@@ -0,0 +1,50 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.extension;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.Extension;
+import javax.enterprise.inject.spi.ProcessAnnotatedType;
+
+import org.apache.tapestry5.internal.InternalConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * An spi extension to exclude tapestry resources from CDI management
+ * Veto each Tapestry pages, components and mixins to avoid CDI try to manage them
+ * Without this extension, CDI will complain about Tapestry services not well loaded in injection points from the webapp's pages,components and mixins 
+ */
+public class TapestryExtension implements Extension {
+
+	private static Logger logger = LoggerFactory.getLogger(TapestryExtension.class); 
+
+	/**
+	 * Exclude Tapestry resources from CDI management
+	 * Veto each Tapestry pages, components and mixins
+	 * @param pat a ProcessAnnotatedType
+	 */
+	protected <T> void excludeTapestryResources(@Observes final ProcessAnnotatedType<T> pat){
+		String annotatedTypeClassName = pat.getAnnotatedType().getJavaClass().getName(); 
+		logger.debug("Annotated type : "+annotatedTypeClassName);
+		
+		for (String subpackage : InternalConstants.SUBPACKAGES){
+			if(annotatedTypeClassName.contains("."+subpackage+".")){
+				logger.debug("Tapestry page/component/mixins found! - will be exclude from CDI management : "+annotatedTypeClassName);
+				pat.veto();
+			}
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/internal/utils/InternalUtils.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/internal/utils/InternalUtils.java b/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/internal/utils/InternalUtils.java
new file mode 100755
index 0000000..d9f311f
--- /dev/null
+++ b/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/internal/utils/InternalUtils.java
@@ -0,0 +1,136 @@
+/**
+ * Copyright 2013 GOT5
+ *
+ * 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.apache.tapestry5.cdi.internal.utils;
+
+import static org.apache.tapestry5.cdi.BeanHelper.getQualifiers;
+
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import org.apache.tapestry5.Block;
+import org.apache.tapestry5.ComponentResources;
+import org.apache.tapestry5.annotations.Path;
+import org.apache.tapestry5.ioc.AnnotationProvider;
+import org.apache.tapestry5.ioc.Messages;
+import org.apache.tapestry5.ioc.ObjectLocator;
+import org.apache.tapestry5.ioc.annotations.Symbol;
+import org.apache.tapestry5.services.pageload.ComponentResourceSelector;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A collection of utility methods including a method that checks if a bean is managed by tapestry-ioc or not 
+ *
+ */
+public final class InternalUtils {
+
+	private static Logger logger = LoggerFactory.getLogger(InternalUtils.class); 
+
+	@SuppressWarnings("rawtypes")
+	private static final Map<Class, Annotation[]> annotationsCache = new HashMap<Class, Annotation[]>();
+
+	private static final List<String> tapestry_injectable_resources = Arrays.asList(
+			new String[]{
+					ComponentResources.class.getName(),
+					ComponentResourceSelector.class.getName(),
+					Messages.class.getName(),
+					Locale.class.getName(),
+					Logger.class.getName(),
+					Block.class.getName()
+			});
+
+	/**
+	 * Check if the injected field is managed by tapestry (resource or service)
+	 * @param type the class type
+	 * @param annotationProvider used to check the annotation of the class/field
+	 * @param locator the objectLocator
+	 * @return true if the injected field is managed by Tapestry, false otherwise
+	 */
+	@SuppressWarnings({ "unchecked", "rawtypes" })
+	public static boolean isManagedByTapestry(final Class type, final AnnotationProvider annotationProvider, final ObjectLocator locator){
+		if(type == null) return false;
+		/**
+		 * We guess that in a tapestry webapp, injected resources are mostly from Tapestry
+		 * Is a tapestry resource/service ? 
+		 * First, we check if the injected resource is a tapestry one, 
+		 * then we check if it has a <i>Symbol</i> or <i>Path</i> annotation and 
+		 * finally if it's a tapestry service by asking the locator.
+		 */
+		try {
+			if(	
+					tapestry_injectable_resources.contains(type.getName()) 		
+					|| isAnnotation(annotationProvider, Symbol.class) 
+					|| isAnnotation(annotationProvider, Path.class)
+					|| locator.getService(type)!=null
+					){
+				logger.debug(type+" is a Tapestry resources or service");
+				return true;
+			}
+		} catch (RuntimeException e) {
+			// do nothing, the service is not managed by tapestry
+			logger.debug(type +" is not a known service of the tapestry registry");
+		}
+		return false;
+	}
+
+	private static <T extends Annotation> boolean isAnnotation(AnnotationProvider annotationProvider, final Class<T> annotation) {
+		return annotationProvider.getAnnotation(
+				new Annotation(){
+					@Override
+					public Class<? extends Annotation> annotationType() {
+						return annotation;
+					}
+				}.annotationType())!=null;
+	}
+
+	/**
+	 * Returns the field's annotations corresponding to qualifiers for the current PlasticClass
+	 * @param type the class type
+	 * @param annotationProvider used to check the annotation of the class/field
+	 * @return an annotation array
+	 */
+	@SuppressWarnings("rawtypes")
+	public static Annotation[] getFieldQualifiers(final Class type,final AnnotationProvider annotationProvider) {
+		logger.debug("Field type : "+type);
+		final Annotation[] annotations;
+		if (!annotationsCache.containsKey(type)) {
+			synchronized (annotationsCache) {
+				if (!annotationsCache.containsKey(type)) {
+					logger.debug("Put qualifiers in cache for type : "+type);
+					annotationsCache.put(type, getQualifiers(type));
+				}
+			}
+		}
+		annotations = annotationsCache.get(type);
+
+		List<Annotation> qualifiers = new ArrayList<Annotation>();
+		for (Annotation annotation : annotations) {
+			boolean isAnnotationPresent = annotationProvider.getAnnotation(annotation.annotationType())!=null;
+			logger.debug("Is "+type+" has qualifier : "+annotation.annotationType()+" ? "+isAnnotationPresent);
+			if(isAnnotationPresent){
+				logger.debug("Qualifier "+annotation+" found for "+type);
+				qualifiers.add(annotation);
+			}
+		}
+		return qualifiers.toArray(new Annotation[qualifiers.size()]);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/main/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/main/resources/META-INF/beans.xml b/tapestry-cdi/src/main/resources/META-INF/beans.xml
new file mode 100755
index 0000000..ed65eba
--- /dev/null
+++ b/tapestry-cdi/src/main/resources/META-INF/beans.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright 2013 The Apache Software Foundation
+
+    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.
+
+-->
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+      http://java.sun.com/xml/ns/javaee/beans_1_0.xsd" />


[3/3] git commit: TAP5-2260: Add support for CDI

Posted by ff...@apache.org.
TAP5-2260: Add support for CDI

Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/db68d5b9
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/db68d5b9
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/db68d5b9

Branch: refs/heads/master
Commit: db68d5b9bb5069d4ee3df9fc88904e4e1da85de8
Parents: 1bb0ba3
Author: frafac <fr...@MacBook-de-frafac.local>
Authored: Thu Dec 12 23:00:49 2013 +0100
Committer: frafac <fr...@MacBook-de-frafac.local>
Committed: Thu Dec 12 23:00:49 2013 +0100

----------------------------------------------------------------------
 settings.gradle                                 |   1 +
 tapestry-cdi/LICENSE.txt                        | 437 ++++++++++++++++++
 tapestry-cdi/build.gradle                       | 114 +++++
 tapestry-cdi/pom.xml                            | 266 +++++++++++
 .../org/apache/tapestry5/cdi/BeanHelper.java    | 154 +++++++
 .../org/apache/tapestry5/cdi/BeanInstance.java  |  51 +++
 .../apache/tapestry5/cdi/CDIInjectModule.java   |  46 ++
 .../tapestry5/cdi/CDIInjectionProvider.java     | 152 +++++++
 .../apache/tapestry5/cdi/CDIObjectProvider.java |  57 +++
 .../cdi/extension/BeanManagerHolder.java        |  43 ++
 .../cdi/extension/TapestryExtension.java        |  50 +++
 .../cdi/internal/utils/InternalUtils.java       | 136 ++++++
 .../src/main/resources/META-INF/beans.xml       |  22 +
 .../javax.enterprise.inject.spi.Extension       |   2 +
 .../apache/tapestry5/cdi/test/InjectTest.java   | 445 +++++++++++++++++++
 .../tapestry5/cdi/test/annotation/Choco.java    |  29 ++
 .../cdi/test/annotation/CustomDessert.java      |  29 ++
 .../cdi/test/annotation/DessertTime.java        |  29 ++
 .../tapestry5/cdi/test/annotation/Iced.java     |  32 ++
 .../cdi/test/annotation/MyStereotype.java       |  33 ++
 .../tapestry5/cdi/test/beans/BrownieImpl.java   |  50 +++
 .../tapestry5/cdi/test/beans/Counter.java       |  34 ++
 .../cdi/test/beans/CounterService.java          |  31 ++
 .../tapestry5/cdi/test/beans/Dessert.java       |  30 ++
 .../cdi/test/beans/DessertFactory.java          |  51 +++
 .../tapestry5/cdi/test/beans/DessertImpl.java   |  47 ++
 .../tapestry5/cdi/test/beans/IceCreamImpl.java  |  50 +++
 .../apache/tapestry5/cdi/test/beans/Menu.java   |  40 ++
 .../tapestry5/cdi/test/beans/NamedPojo.java     |  29 ++
 .../apache/tapestry5/cdi/test/beans/Pojo.java   |  26 ++
 .../apache/tapestry5/cdi/test/beans/Soup.java   |  42 ++
 .../cdi/test/beans/StatefulEJBBean.java         |  28 ++
 .../cdi/test/beans/StatefulEJBBeanImpl.java     |  41 ++
 .../cdi/test/beans/StatelessEJBBean.java        |  25 ++
 .../cdi/test/beans/StatelessEJBBeanImpl.java    |  29 ++
 .../tapestry5/cdi/test/beans/Stereotyped.java   |  47 ++
 .../tapestry5/cdi/test/beans/Vegetable.java     |  62 +++
 .../cdi/test/beans/ws/HelloWorldService.java    |  37 ++
 .../test/beans/ws/HelloWorldServiceImpl.java    |  38 ++
 .../cdi/test/components/DumbComponent.java      |  33 ++
 .../tapestry5/cdi/test/pages/DessertPage.java   |  95 ++++
 .../apache/tapestry5/cdi/test/pages/Index.java  | 122 +++++
 .../cdi/test/pages/InvalidateSessionPage.java   |  30 ++
 .../cdi/test/pages/RequestScopePage.java        |  38 ++
 .../cdi/test/pages/SessionScopePage.java        |  39 ++
 .../tapestry5/cdi/test/pages/SomePage.java      |  20 +
 .../tapestry5/cdi/test/pages/StatefulPage.java  |  42 ++
 .../cdi/test/pages/StereotypePage.java          |  43 ++
 .../tapestry5/cdi/test/pages/VegetablePage.java |  39 ++
 .../apache/tapestry5/cdi/test/pages/WSPage.java |  35 ++
 .../ClasspathURLConverterJBoss7Dot1.java        |  99 +++++
 .../tapestry5/cdi/test/services/PojoModule.java |  32 ++
 tapestry-cdi/src/test/resources/arquillian.xml  |  35 ++
 tapestry-cdi/src/test/resources/log4j.xml       |  59 +++
 .../cdi/test/components/DumbComponent.tml       |   7 +
 .../tapestry5/cdi/test/pages/DessertPage.tml    |  10 +
 .../tapestry5/cdi/test/pages/Index.properties   |  18 +
 .../apache/tapestry5/cdi/test/pages/Index.tml   |  22 +
 .../cdi/test/pages/InvalidateSessionPage.tml    |   2 +
 .../cdi/test/pages/RequestScopePage.tml         |   3 +
 .../cdi/test/pages/SessionScopePage.tml         |   3 +
 .../tapestry5/cdi/test/pages/SomePage.tml       |   2 +
 .../tapestry5/cdi/test/pages/StatefulPage.tml   |   6 +
 .../tapestry5/cdi/test/pages/StereotypePage.tml |   5 +
 .../tapestry5/cdi/test/pages/VegetablePage.tml  |   4 +
 .../apache/tapestry5/cdi/test/pages/WSPage.tml  |   3 +
 66 files changed, 3711 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/settings.gradle
----------------------------------------------------------------------
diff --git a/settings.gradle b/settings.gradle
index 89db79f..6c5092f 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -4,3 +4,4 @@ include "tapestry-beanvalidator", "tapestry-jpa", "tapestry-kaptcha"
 include "tapestry-javadoc", "quickstart", "tapestry-clojure", "tapestry-mongodb"
 include "tapestry-test-data", 'tapestry-internal-test'
 include "tapestry-webresources", "tapestry-runner"
+include "tapestry-cdi"
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/LICENSE.txt
----------------------------------------------------------------------
diff --git a/tapestry-cdi/LICENSE.txt b/tapestry-cdi/LICENSE.txt
new file mode 100644
index 0000000..75248b8
--- /dev/null
+++ b/tapestry-cdi/LICENSE.txt
@@ -0,0 +1,437 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   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.
+
+-------------------------------------------------------------------------------
+
+This module, tapestry-core, includes a number of resources with seperate copyrights and licenses.
+
+-------------------------------------------------------------------------------
+
+JAVASSIST
+
+Javassist is not bundled with tapestry-core, but tapestry-core is not functional without Javassist.
+Javassist is distributed under a dual license: Mozilla Public License or LGPL (Lesser Gnu Public License). Tapestry
+invokes the MPL for compatibility with the Apache Software License.
+
+MOZILLA PUBLIC LICENSE
+Version 1.1
+
+1. Definitions.
+
+      1.0.1. "Commercial Use" means distribution or otherwise making the Covered Code available to a third party.
+
+      1.1. ''Contributor'' means each entity that creates or contributes to the creation of Modifications.
+
+      1.2. ''Contributor Version'' means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor.
+
+      1.3. ''Covered Code'' means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof.
+
+      1.4. ''Electronic Distribution Mechanism'' means a mechanism generally accepted in the software development community for the electronic transfer of data.
+
+      1.5. ''Executable'' means Covered Code in any form other than Source Code.
+
+      1.6. ''Initial Developer'' means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A.
+
+      1.7. ''Larger Work'' means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.
+
+      1.8. ''License'' means this document.
+
+      1.8.1. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.
+
+      1.9. ''Modifications'' means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is:
+            A. Any addition to or deletion from the contents of a file containing Original Code or previous Modifications.
+
+            B. Any new file that contains any part of the Original Code or previous Modifications.
+             
+      1.10. ''Original Code'' means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License.
+
+      1.10.1. "Patent Claims" means any patent claim(s), now owned or hereafter acquired, including without limitation,  method, process, and apparatus claims, in any patent Licensable by grantor.
+
+      1.11. ''Source Code'' means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an Executable, or source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor's choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge.
+
+      1.12. "You'' (or "Your")  means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, "You'' includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control'' means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
+
+2. Source Code License.
+
+      2.1. The Initial Developer Grant.
+      The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims:
+            (a)  under intellectual property rights (other than patent or trademark) Licensable by Initial Developer to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, and/or as part of a Larger Work; and
+
+            (b) under Patents Claims infringed by the making, using or selling of Original Code, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Code (or portions thereof).
+            (c) the licenses granted in this Section 2.1(a) and (b) are effective on the date Initial Developer first distributes Original Code under the terms of this License.
+
+            (d) Notwithstanding Section 2.1(b) above, no patent license is granted: 1) for code that You delete from the Original Code; 2) separate from the Original Code;  or 3) for infringements caused by: i) the modification of the Original Code or ii) the combination of the Original Code with other software or devices.
+             
+      2.2. Contributor Grant.
+      Subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license
+
+            (a)  under intellectual property rights (other than patent or trademark) Licensable by Contributor, to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code and/or as part of a Larger Work; and
+
+            (b) under Patent Claims infringed by the making, using, or selling of  Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications made by that Contributor (or portions thereof); and 2) the combination of  Modifications made by that Contributor with its Contributor Version (or portions of such combination).
+
+            (c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first makes Commercial Use of the Covered Code.
+
+            (d)    Notwithstanding Section 2.2(b) above, no patent license is granted: 1) for any code that Contributor has deleted from the Contributor Version; 2)  separate from the Contributor Version;  3)  for infringements caused by: i) third party modifications of Contributor Version or ii)  the combination of Modifications made by that Contributor with other software  (except as part of the Contributor Version) or other devices; or 4) under Patent Claims infringed by Covered Code in the absence of Modifications made by that Contributor.
+
+
+3. Distribution Obligations.
+
+      3.1. Application of License.
+      The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients' rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5.
+
+      3.2. Availability of Source Code.
+      Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable version or via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available; and if made available via Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party.
+
+      3.3. Description of Modifications.
+      You must cause all Covered Code to which You contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code.
+
+      3.4. Intellectual Property Matters
+            (a) Third Party Claims.
+            If Contributor has knowledge that a license under a third party's intellectual property rights is required to exercise the rights granted by such Contributor under Sections 2.1 or 2.2, Contributor must include a text file with the Source Code distribution titled "LEGAL'' which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If Contributor obtains such knowledge after the Modification is made available as described in Section 3.2, Contributor shall promptly modify the LEGAL file in all copies Contributor makes available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained.
+
+            (b) Contributor APIs.
+            If Contributor's Modifications include an application programming interface and Contributor has knowledge of patent licenses which are reasonably necessary to implement that API, Contributor must also include this information in the LEGAL file.
+             
+                (c)    Representations.
+            Contributor represents that, except as disclosed pursuant to Section 3.4(a) above, Contributor believes that Contributor's Modifications are Contributor's original creation(s) and/or Contributor has sufficient rights to grant the rights conveyed by this License.
+
+
+      3.5. Required Notices.
+      You must duplicate the notice in Exhibit A in each file of the Source Code.  If it is not possible to put such notice in a particular Source Code file due to its structure, then You must include such notice in a location (such as a relevant directory) where a user would be likely to look for such a notice.  If You created one or more Modification(s) You may add your name as a Contributor to the notice described in Exhibit A.  You must also duplicate this License in any documentation for the Source Code where You describe recipients' rights or ownership rights relating to Covered Code.  You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby
  agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer.
+
+      3.6. Distribution of Executable Versions.
+      You may distribute Covered Code in Executable form only if the requirements of Section 3.1-3.5 have been met for that Covered Code, and if You include a notice stating that the Source Code version of the Covered Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable version, related documentation or collateral in which You describe recipients' rights relating to the Covered Code. You may distribute the Executable version of Covered Code or ownership rights under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient's rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version 
 under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or any Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer.
+
+      3.7. Larger Works.
+      You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+
+      If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.
+
+5. Application of this License.
+
+      This License applies to code to which the Initial Developer has attached the notice in Exhibit A and to related Covered Code.
+
+6. Versions of the License.
+
+      6.1. New Versions.
+      Netscape Communications Corporation (''Netscape'') may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number.
+
+      6.2. Effect of New Versions.
+      Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License published by Netscape. No one other than Netscape has the right to modify the terms applicable to Covered Code created under this License.
+
+      6.3. Derivative Works.
+      If You create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), You must (a) rename Your license so that the phrases ''Mozilla'', ''MOZILLAPL'', ''MOZPL'', ''Netscape'', "MPL", ''NPL'' or any confusingly similar phrase do not appear in your license (except to note that your license differs from this License) and (b) otherwise make it clear that Your version of the license contains terms which differ from the Mozilla Public License and Netscape Public License. (Filling in the name of the Initial Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.)
+
+7. DISCLAIMER OF WARRANTY.
+
+      COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS'' BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+8. TERMINATION.
+
+      8.1.  This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
+
+      8.2.  If You initiate litigation by asserting a patent infringement claim (excluding declatory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You file such action is referred to as "Participant")  alleging that:
+
+      (a)  such Participant's Contributor Version directly or indirectly infringes any patent, then any and all rights granted by such Participant to You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively, unless if within 60 days after receipt of notice You either: (i)  agree in writing to pay Participant a mutually agreeable reasonable royalty for Your past and future use of Modifications made by such Participant, or (ii) withdraw Your litigation claim with respect to the Contributor Version against such Participant.  If within 60 days of notice, a reasonable royalty and payment arrangement are not mutually agreed upon in writing by the parties or the litigation claim is not withdrawn, the rights granted by Participant to You under Sections 2.1 and/or 2.2 automatically terminate at the expiration of the 60 day notice period specified above.
+
+      (b)  any software, hardware, or device, other than such Participant's Contributor Version, directly or indirectly infringes any patent, then any rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are revoked effective as of the date You first made, used, sold, distributed, or had made, Modifications made by that Participant.
+
+      8.3.  If You assert a patent infringement claim against Participant alleging that such Participant's Contributor Version directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license.
+
+      8.4.  In the event of termination under Sections 8.1 or 8.2 above,  all end user license agreements (excluding distributors and resellers) which have been validly granted by You or any distributor hereunder prior to termination shall survive termination.
+
+9. LIMITATION OF LIABILITY.
+
+      UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS.
+
+      The Covered Code is a ''commercial item,'' as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of ''commercial computer software'' and ''commercial computer software documentation,'' as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Code with only those rights set forth herein.
+
+11. MISCELLANEOUS.
+
+      This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by California law provisions (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in the United States of America, any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California, with venue lying in Santa Clara County, California, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys' fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excl
 uded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License.
+
+12. RESPONSIBILITY FOR CLAIMS.
+
+      As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability.
+
+13. MULTIPLE-LICENSED CODE.
+
+      Initial Developer may designate portions of the Covered Code as �Multiple-Licensed?.  �Multiple-Licensed? means that the Initial Developer permits you to utilize portions of the Covered Code under Your choice of the MPL or the alternative licenses, if any, specified by the Initial Developer in the file described in Exhibit A.
+
+
+EXHIBIT A -Mozilla Public License.
+
+      The contents of this file are subject to the Mozilla Public License Version 1.1 (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.mozilla.org/MPL/
+
+      Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
+      ANY KIND, either express or implied. See the License for the specific language governing rights and
+      limitations under the License.
+
+      The Original Code is Javassist.
+
+      The Initial Developer of the Original Code is Shigeru Chiba. Portions created by the Initial Developer are
+        Copyright (C) 1999-2006 Shigeru Chiba. All Rights Reserved.
+
+      Contributor(s): ______________________________________.
+
+      Alternatively, the contents of this file may be used under the terms of the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), in which case the provisions of the LGPL are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of the LGPL, and not to allow others to use your version of this file under the terms of the MPL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the LGPL. If you do not delete the provisions above, a recipient may use your version of this file under the terms of either the MPL or the LGPL.
+
+
+-------------------------------------------------------------------------------
+
+PROTOTYPE
+
+Copyright (c) 2005-2007 Sam Stephenson
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+-------------------------------------------------------------------------------
+
+SCRIPTACULOUS
+
+Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+-------------------------------------------------------------------------------
+
+WEBFX DATEPICKER
+
+Distributed under the terms of the Apache Software License 2.0.
+  
+  

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/build.gradle
----------------------------------------------------------------------
diff --git a/tapestry-cdi/build.gradle b/tapestry-cdi/build.gradle
new file mode 100755
index 0000000..e105a73
--- /dev/null
+++ b/tapestry-cdi/build.gradle
@@ -0,0 +1,114 @@
+import org.gradle.plugins.ide.idea.model.*
+import t5build.*
+
+description = "Bridge to CDI for Apache Tapestry 5 Project"
+
+apply plugin: JavaPlugin
+
+buildDir = 'target/gradle-build'
+       
+project.ext.libraryVersions = [
+    javaeeapi: '6.0-4', 
+    tomee: '1.6.0', 
+    ziplock: '1.5.1',
+    junit: '4.8.1', 
+    commonsHttpclient: '3.1',
+    arquillian: '1.1.1.Final', 
+    jbossJavaeeSpec: '1.0.0.Final',
+    arquillianGlassfish: '1.0.0.CR4',
+    glassfishDistrib: '3.1.1-b04', 
+    jbossDistrib: '7.1.1.Final', 
+    cdi: '1.0-SP4',
+    jbossAS7: '7.1.1.Final', 
+    shrinkwrapDesc: '2.0.0-alpha-3'
+]
+
+
+configurations {
+    compileOnly 
+    jboss
+    glassfish
+    tomeeEmbeddedTestRuntime  { extendsFrom testRuntime, compileOnly }
+    jbossAS7ManagedTestRuntime { extendsFrom testRuntime, compileOnly }
+    glassfishManagedTestRuntime { extendsFrom testRuntime, compileOnly }
+}
+
+dependencies {
+    compile project(':tapestry-core')
+    compile project(':tapestry-ioc')
+    testCompile (project(':tapestry-test')){
+         transitive = false
+     } 
+      
+    // replace javax.enterprise:cdi-api with group: 'org.jboss.spec', name: 'jboss-javaee-6.0', version: libraryVersions.jbossJavaeeSpec to compile against full Java EE API
+    compileOnly group: 'javax.enterprise', name: 'cdi-api', version: libraryVersions.cdi
+    
+    
+    testCompile group: 'org.apache.openejb', name: 'ziplock', version: libraryVersions.ziplock
+    testCompile group: 'junit', name: 'junit', version: libraryVersions.junit
+    testCompile group: 'commons-httpclient', name: 'commons-httpclient', version: libraryVersions.commonsHttpclient
+    
+    testCompile group: 'org.jboss.arquillian.junit', name: 'arquillian-junit-container', version: libraryVersions.arquillian
+    testCompile group: 'org.jboss.shrinkwrap.descriptors', name: 'shrinkwrap-descriptors-api-javaee', version: libraryVersions.shrinkwrapDesc
+    testRuntime group: 'org.jboss.shrinkwrap.descriptors', name: 'shrinkwrap-descriptors-impl-javaee', version: libraryVersions.shrinkwrapDesc
+    
+    tomeeEmbeddedTestRuntime group: 'org.apache.openejb', name: 'arquillian-tomee-embedded', version: libraryVersions.tomee
+    
+    jbossAS7ManagedTestRuntime group: 'org.jboss.as', name: 'jboss-as-arquillian-container-managed', version: libraryVersions.jbossAS7
+    jbossAS7ManagedTestRuntime group: 'org.jboss.spec', name: 'jboss-javaee-6.0', version: libraryVersions.jbossJavaeeSpec
+    jboss "org.jboss.as:jboss-as-dist:$libraryVersions.jbossDistrib@zip"
+ 
+    glassfishManagedTestRuntime group: 'org.jboss.arquillian.container', name: 'arquillian-glassfish-managed-3.1', version: libraryVersions.arquillianGlassfish
+    glassfish "org.glassfish.distributions:glassfish:$libraryVersions.glassfishDistrib@zip"     
+}
+
+sourceSets {
+    main {
+        compileClasspath = configurations.compile + configurations.compileOnly
+    }
+    test {
+        compileClasspath = compileClasspath + configurations.compileOnly
+    }
+}
+
+task resolveJBoss(type: Copy) {  
+    destinationDir = file('target') 
+    from { zipTree(configurations.jboss.singleFile) }
+}
+
+task resolveGlassfish(type: Copy) {
+    destinationDir = file('target')
+    from { zipTree(configurations.glassfish.singleFile) }
+}
+
+
+task tomeeEmbeddedTest(type: Test) {
+  systemProperty 'arquillian.launch', "tomee_embedded"
+}
+
+task jbossAS7ManagedTest(type: Test) {
+  systemProperty 'arquillian.launch', "jbossas_managed"
+   dependsOn { resolveJBoss }
+}
+
+task glassfishManagedTest(type: Test){
+  systemProperty 'arquillian.launch', "glassfish_managed"
+   dependsOn { resolveGlassfish }
+}
+
+tasks.withType(Test).matching({ t-> t.name.endsWith('Test') } as Spec).each { t ->
+    t.testClassesDir = sourceSets.test.output.classesDir
+    t.classpath = sourceSets.test.output + sourceSets.main.output + configurations[t.name + 'Runtime']
+}
+
+test {
+  dependsOn { tomeeEmbeddedTest }
+  setEnabled(false)
+}
+
+jar {	
+
+	manifest {	
+		attributes 'Tapestry-Module-Classes': 'org.apache.tapestry5.cdi.CDIInjectModule'
+		}
+ }

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/pom.xml
----------------------------------------------------------------------
diff --git a/tapestry-cdi/pom.xml b/tapestry-cdi/pom.xml
new file mode 100755
index 0000000..eb83669
--- /dev/null
+++ b/tapestry-cdi/pom.xml
@@ -0,0 +1,266 @@
+<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/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  
+  <parent>
+    <groupId>org.sonatype.oss</groupId>
+    <artifactId>oss-parent</artifactId>
+    <version>7</version>
+  </parent>
+  
+  <groupId>org.apache.tapestry</groupId>
+  <artifactId>tapestry-cdi</artifactId>
+  <version>1.0.0-SNAPSHOT</version>
+  <name>Tapestry 5 CDI Module</name>
+  <packaging>${packaging.type}</packaging>
+  <description>CDI integration for Tapestry</description>
+  <url>https://github.com/got5/tapestry-cdi</url>
+   <licenses>
+       <license>
+           <name>The Apache Software License, Version 2.0</name>
+           <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+           <distribution>repo</distribution>
+       </license>
+   </licenses>
+   <scm>
+	   <connection>scm:git:git@github.com:got5/tapestry-cdi.git</connection>
+	   <developerConnection>scm:git:git@github.com:got5/tapestry-cdi.git</developerConnection>
+	   <url>git@github.com:got5/tapestry-cdi.git</url>
+   </scm>
+   <developers>
+	   <developer>
+	   		<id>rmannibucau</id>
+			<name>Romain MANNI-BUCAU</name>
+			<roles>
+		    	<role>Developer</role>
+		    </roles>
+		    <timezone>+1</timezone>
+		</developer>
+		<developer>
+		    <id>adaptivui</id>
+	       <name>Nourredine KHADRI</name>
+	       <email>nourredine.k@gmail.com</email>
+	       <roles>
+	       		<role>Developer</role>
+	       </roles>
+	       <timezone>+1</timezone>
+	   </developer>
+	   <developer>
+	       <id>krazar</id>
+	       <name>Pierre MAROT</name>
+	       <roles>
+	       		<role>Developer</role>
+	       </roles>
+	       <timezone>+1</timezone>
+	   </developer>
+	   <developer>
+	       <id>got5</id>
+	       <name>François FACON</name>
+	       <roles>
+	       		<role>Developer</role>
+	       </roles>
+	       <timezone>+1</timezone>
+	    </developer>
+   </developers>
+   <repositories>
+		<repository>
+			<id>staging</id>
+			<url>https://repository.apache.org/content/groups/staging</url>
+			<snapshots>
+				<enabled>true</enabled>
+			</snapshots>
+		</repository>
+	</repositories>
+  
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.openejb</groupId>
+      <artifactId>javaee-api</artifactId>
+      <version>${javaee-api.version}</version>
+      <scope>provided</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.tapestry</groupId>
+      <artifactId>tapestry-core</artifactId>
+      <version>${tapestry-core.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.openejb</groupId>
+      <artifactId>arquillian-tomee-embedded</artifactId>
+      <version>${arquillian-tomee-embedded.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.openejb</groupId>
+      <artifactId>ziplock</artifactId>
+      <version>${ziplock.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.arquillian.junit</groupId>
+      <artifactId>arquillian-junit-container</artifactId>
+      <version>${arquillian.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.arquillian.container</groupId>
+      <artifactId>arquillian-container-spi</artifactId>
+      <version>${arquillian-container-spi.version}</version>
+      <scope>test</scope>
+    </dependency>    
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>${junit.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+    	<groupId>commons-httpclient</groupId>
+    	<artifactId>commons-httpclient</artifactId>
+    	<version>${commons-httpclient.version}</version>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <version>${maven-jar-plugin.version}</version>
+        <configuration>
+          <archive>
+            <manifestEntries>
+              <Tapestry-Module-Classes>org.apache.tapestry5.cdi.CDIInjectModule</Tapestry-Module-Classes>
+            </manifestEntries>
+          </archive>
+        </configuration>
+      </plugin>
+     
+      <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <version>${maven-compiler-plugin.version}</version>
+          <configuration>
+          <source>1.6</source>
+          <target>1.6</target>
+        </configuration>
+      </plugin>
+
+     </plugins>
+  </build>
+
+  <properties>
+    <tapestry-cdi.version>1.0.0-SNAPSHOT</tapestry-cdi.version>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <javaee-api.version>6.0-4</javaee-api.version>
+    <tapestry-core.version>5.4-alpha-29</tapestry-core.version>
+    <arquillian.version>1.1.1.Final</arquillian.version>
+    <arquillian-container-spi.version>1.1.0.Final</arquillian-container-spi.version>  
+    <arquillian-tomee-embedded.version>1.5.2</arquillian-tomee-embedded.version>  
+    <ziplock.version>1.5.1</ziplock.version>
+    <junit.version>4.11</junit.version>
+    <maven-jar-plugin.version>2.4</maven-jar-plugin.version>
+    <maven-compiler-plugin.version>3.0</maven-compiler-plugin.version>
+    <commons-httpclient.version>3.1</commons-httpclient.version>
+  </properties>
+  
+  <profiles>
+     <profile>
+           <id>module</id>
+           <activation>
+               <activeByDefault>true</activeByDefault>
+           </activation>
+           <properties>
+                <packaging.type>jar</packaging.type>
+           </properties>
+           <build>
+      		<plugins>
+	      		<plugin>
+				  <groupId>org.apache.maven.plugins</groupId>
+				  <artifactId>maven-source-plugin</artifactId>
+				  <executions>
+				    <execution>
+				      <id>attach-sources</id>
+				      <goals>
+				        <goal>jar</goal>
+				      </goals>
+				    </execution>
+				  </executions>
+				</plugin>
+				<plugin>
+				  <groupId>org.apache.maven.plugins</groupId>
+				  <artifactId>maven-javadoc-plugin</artifactId>
+				  <executions>
+				    <execution>
+				      <id>attach-javadocs</id>
+				      <goals>
+				        <goal>jar</goal>
+				      </goals>
+				    </execution>
+				  </executions>
+				</plugin>
+			</plugins>
+		   </build> 
+     </profile>
+     <profile>
+            <id>webapp</id>
+            <properties>
+                <packaging.type>war</packaging.type>
+                <tomee.version>1.5.2</tomee.version>
+                <tomee-plugin.version>1.0.1</tomee-plugin.version>
+            </properties>
+      		<build>
+      		<finalName>tapestry-cdi</finalName>
+      		<plugins>
+      		   <plugin>
+        		<artifactId>maven-clean-plugin</artifactId>
+        		<version>2.4.1</version>
+      		  </plugin>	
+	      	  <plugin>
+		        <groupId>org.apache.maven.plugins</groupId>
+		        <artifactId>maven-war-plugin</artifactId>
+		        <version>2.3</version>
+		        <configuration>
+		          <failOnMissingWebXml>false</failOnMissingWebXml>
+		          <maven-war-plugin>tapestry-cdi</maven-war-plugin>
+		       	<webResources>
+	            <resource>
+	              <directory>${project.build.directory}/test-classes</directory>
+	              <targetPath>WEB-INF/classes</targetPath>
+	              <excludes>
+                	<exclude>**/InjectTest.class</exclude>
+              	  </excludes>
+	            </resource>
+	          	</webResources>
+	          	
+        		</configuration>
+		      </plugin>
+		
+		      <plugin>
+		        <groupId>org.apache.maven.plugins</groupId>
+		        <artifactId>maven-surefire-plugin</artifactId>
+		        <version>2.13</version>
+		      </plugin>
+		      <plugin>
+               <groupId>org.apache.openejb.maven</groupId>
+               <artifactId>tomee-maven-plugin</artifactId>
+               <version>${tomee-plugin.version}</version>
+               <configuration>
+               		  <simpleLog>true</simpleLog>	
+                      <tomeeVersion>${tomee.version}</tomeeVersion>
+                      <!-- <debug>true</debug> -->
+                      <tomeeClassifier>plus</tomeeClassifier>
+                      <libs>
+                             <lib>org.apache.tapestry:tapestry-core:${tapestry-core.version}</lib>
+                             <lib>org.apache.tapestry:tapestry-ioc:${tapestry-core.version}</lib>
+                             <lib>org.apache.tapestry:tapestry-cdi:${tapestry-cdi.version}</lib>               
+                      </libs>
+                      <args>-Xms256m -Xmx1024m</args>
+               </configuration>
+          </plugin>
+		  </plugins>
+		  </build>
+    </profile>
+  </profiles>
+</project>

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/BeanHelper.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/BeanHelper.java b/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/BeanHelper.java
new file mode 100755
index 0000000..f8f736e
--- /dev/null
+++ b/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/BeanHelper.java
@@ -0,0 +1,154 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi;
+
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import javax.enterprise.context.Dependent;
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.Any;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.BeanManager;
+
+import org.apache.tapestry5.cdi.extension.BeanManagerHolder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Helper that provides you handy methods to get a BeanManager instance or any CDI bean instance from its interface and eventually qualifiers 
+ *
+ */
+public final class BeanHelper {
+
+	private static Logger logger = LoggerFactory.getLogger(BeanHelper.class); 
+
+	private BeanHelper() {
+		// no-op
+	}
+
+	/**
+	 * Get a BeanInstance from a type and its qualifiers
+	 * @param clazz the class representing the bean's type 
+	 * @param qualifiers an array representing the bean's qualifiers
+	 * @return a BeanInstance
+	 */
+	public static BeanInstance getInstance(final Class<?> clazz, final Annotation[] qualifiers) {
+		final BeanManager beanManager = getBeanManager();
+		final Set<Bean<?>> beans = beanManager.getBeans(clazz, qualifiers);
+		logger.debug("getInstance() - beans found : "+beans+" for class "+clazz.getSimpleName());
+		if (beans == null || beans.isEmpty()) {
+			return null;
+		}
+		final Bean<?> bean = beanManager.resolve(beans);
+		logger.debug("getInstance() - bean resolved : "+bean);
+		final CreationalContext<?> creationalContext = beanManager.createCreationalContext(bean);
+		final Object result = beanManager.getReference(bean, clazz, creationalContext);
+		return new BeanInstance(result, creationalContext, Dependent.class.equals(bean.getScope()));
+	}
+
+
+	/**
+	 * Handy method that returns a bean from its type and qualifiers
+	 * @param clazz the class representing the bean's type 
+	 * @param qualifiers an array representing the bean's qualifiers
+	 * @return a instance of the bean 
+	 */
+	@SuppressWarnings("unchecked")
+	public static <T> T get(final Class<T> clazz, final Annotation[] qualifiers) {
+		final BeanManager beanManager = getBeanManager();
+		Annotation[] beanQualifiers = qualifiers;
+		if(beanQualifiers == null || beanQualifiers.length == 0){
+			beanQualifiers = new Annotation[]{};
+		}
+		Set<Bean<?>> beans = beanManager.getBeans(clazz, beanQualifiers);
+		if(beans!=null && beans.size()>0) {
+			Bean<T> bean = (Bean<T>) beanManager.resolve(beans);
+			logger.debug("Bean found : "+bean);
+			CreationalContext<T> ctx = beanManager.createCreationalContext(bean);
+			T o = clazz.cast(beanManager.getReference(bean, clazz, ctx));
+			logger.debug("Found and returning: "+clazz.getCanonicalName());
+			return o;
+		}
+		return null;
+	}
+	
+	/**
+	 * Handy method that returns a bean without qualifiers from its type
+	 * @param clazz the class representing the bean's type 
+	 * @return a instance of the bean 
+	 */
+	public static <T> T get(Class<T> clazz) {
+		return get(clazz, null);
+	}
+
+	/**
+	 * Filter qualifiers from a list of annotations
+	 * @param annotations an annotation array that may contain qualifiers
+	 * @return an annotation array that contains exclusively qualifiers
+	 */
+	public static Annotation[] getQualifiers(final Annotation[] annotations) {
+		final BeanManager bm = getBeanManager();
+		final List<Annotation> qualifiers = new ArrayList<Annotation>();
+		for (Annotation annotation : annotations) {
+			logger.debug("Check annotation : "+annotation+"...");
+			if (bm.isQualifier(annotation.annotationType())) {
+				qualifiers.add(annotation);
+			}
+		}
+		return qualifiers.toArray(new Annotation[qualifiers.size()]);
+	}
+
+	/**
+	 * Get all qualifiers of a type
+	 * @param clazz the class of which we retrieve the qualifiers
+	 * @return an annotation array
+	 */
+	public static Annotation[] getQualifiers(final Class<?> clazz) {
+		final BeanManager beanManager = getBeanManager();
+		final List<Annotation> qualifiers = new ArrayList<Annotation>();
+		// Get all qualified bean by using the @Any annotation
+		final Set<Bean<?>> beans = beanManager.getBeans(clazz, 
+				new Annotation[]{
+				new Any() {
+					@Override
+					public Class<? extends Annotation> annotationType() {
+						return Any.class;
+					}
+				}
+		}
+				);
+		logger.debug("Qualified bean found for class "+clazz.getSimpleName());
+		for (Bean<?> bean : beans) {
+			for (Annotation annotation : bean.getQualifiers()) {
+				if(! annotation.annotationType().isAssignableFrom(Any.class)){
+					logger.debug("==> ["+annotation.annotationType()+"] Qualifier found for bean "+bean.toString());
+					qualifiers.add(annotation);
+				}
+			}
+		}
+		return qualifiers.toArray(new Annotation[qualifiers.size()]);
+
+	}
+
+	/**
+	 * @return the BeanManager
+	 */
+	private static BeanManager getBeanManager() {
+		return BeanManagerHolder.get();
+	}
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/BeanInstance.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/BeanInstance.java b/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/BeanInstance.java
new file mode 100755
index 0000000..d0f64bc
--- /dev/null
+++ b/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/BeanInstance.java
@@ -0,0 +1,51 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi;
+
+import javax.enterprise.context.spi.CreationalContext;
+
+/**
+ * A CDI bean wrapper that embeds a {@link javax.enterprise.context.spi.CreationalContext CreationalContext}
+ *
+ */
+public class BeanInstance {
+    private final Object bean;
+    private boolean releasable;
+    private final CreationalContext<?> context;
+
+    public BeanInstance(final Object bean, final CreationalContext<?> context, boolean releasable) {
+        this.bean = bean;
+        this.context = context;
+        this.releasable = releasable;
+    }
+
+    public boolean isResolved() {
+        return bean != null;
+    }
+
+    public Object getBean() {
+        return bean;
+    }
+
+    public void release() {
+        if (isReleasable()) {
+            context.release();
+        }
+    }
+
+    public boolean isReleasable() {
+        return releasable;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/CDIInjectModule.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/CDIInjectModule.java b/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/CDIInjectModule.java
new file mode 100755
index 0000000..77d034c
--- /dev/null
+++ b/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/CDIInjectModule.java
@@ -0,0 +1,46 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi;
+
+import org.apache.tapestry5.ioc.ObjectProvider;
+import org.apache.tapestry5.ioc.OrderedConfiguration;
+import org.apache.tapestry5.ioc.ServiceBinder;
+import org.apache.tapestry5.ioc.annotations.Contribute;
+import org.apache.tapestry5.ioc.annotations.Local;
+import org.apache.tapestry5.ioc.services.MasterObjectProvider;
+import org.apache.tapestry5.services.transform.InjectionProvider2;
+
+/**
+ * This module provides an InjectionProvider and an ObjectProvider to handle CDI beans
+ *
+ */
+public final class CDIInjectModule {
+	
+	public static void bind(ServiceBinder binder) {
+		binder.bind(ObjectProvider.class, CDIObjectProvider.class);
+	} 
+	
+	@Contribute(value=MasterObjectProvider.class)
+	public static void provideMasterObjectProvider(
+			@Local ObjectProvider cdiProvider,
+			OrderedConfiguration<ObjectProvider> configuration) {
+		configuration.add("cdiProvider", cdiProvider, "after:*");
+	}
+	
+	@Contribute(InjectionProvider2.class)
+	public static void provideStandardInjectionProviders(final OrderedConfiguration<InjectionProvider2> configuration) {
+		configuration.addInstance("CDI", CDIInjectionProvider.class, "before:*");
+	}
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/CDIInjectionProvider.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/CDIInjectionProvider.java b/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/CDIInjectionProvider.java
new file mode 100755
index 0000000..0889c42
--- /dev/null
+++ b/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/CDIInjectionProvider.java
@@ -0,0 +1,152 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi;
+
+import static org.apache.tapestry5.cdi.BeanHelper.getInstance;
+import static org.apache.tapestry5.cdi.BeanHelper.getQualifiers;
+
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.tapestry5.cdi.internal.utils.InternalUtils;
+import org.apache.tapestry5.internal.services.ComponentClassCache;
+import org.apache.tapestry5.ioc.AnnotationProvider;
+import org.apache.tapestry5.ioc.ObjectLocator;
+import org.apache.tapestry5.ioc.annotations.PostInjection;
+import org.apache.tapestry5.ioc.annotations.Symbol;
+import org.apache.tapestry5.ioc.annotations.UsesOrderedConfiguration;
+import org.apache.tapestry5.ioc.services.RegistryShutdownHub;
+import org.apache.tapestry5.model.MutableComponentModel;
+import org.apache.tapestry5.plastic.PlasticField;
+import org.apache.tapestry5.services.transform.InjectionProvider2;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * An InjectionProvider implementation that handles CDI beans
+ * Check first that the bean is not managed by tapestry-ioc
+ * If so, it is ignored by CDI 
+ */
+@UsesOrderedConfiguration(InjectionProvider2.class)
+public final class CDIInjectionProvider implements InjectionProvider2 {
+	private final ComponentClassCache cache;
+	private final ObjectLocator locator;
+	@SuppressWarnings("rawtypes")
+	private final Map<Class, Annotation[]> annotationsCache = new HashMap<Class, Annotation[]>();
+	private final Collection<BeanInstance> instancesToRelease = new ArrayList<BeanInstance>();
+
+	private static Logger logger = LoggerFactory.getLogger(CDIInjectionProvider.class); 
+
+	public CDIInjectionProvider(final ObjectLocator locator, final ComponentClassCache cache) {
+		this.locator = locator;
+		this.cache = cache;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.tapestry5.services.transform.InjectionProvider2#provideInjection(org.apache.tapestry5.plastic.PlasticField, org.apache.tapestry5.ioc.ObjectLocator, org.apache.tapestry5.model.MutableComponentModel)
+	 */
+	@SuppressWarnings("rawtypes")
+	@Override
+	public boolean provideInjection(final PlasticField field, final ObjectLocator locator, final MutableComponentModel componentModel) {
+		Class type = cache.forName(field.getTypeName());
+		if(InternalUtils.isManagedByTapestry(
+				type, 
+				new AnnotationProvider(){
+
+					@Override
+					public <T extends Annotation> T getAnnotation(
+							Class<T> annotationClass) {
+						return field.getAnnotation(annotationClass);
+					}}, 
+				locator)){
+			logger.debug("Field "+field.getName()+" of type "+field.getTypeName()+" is managed by Tapestry");
+			return false;
+		}
+
+		logger.debug("Field "+field.getName()+" of type "+field.getTypeName()+" will be managed by CDI");
+		final Class<?> fieldClass = load(field.getTypeName());
+		final Annotation[] qualifiers = 
+				InternalUtils.getFieldQualifiers(type, new AnnotationProvider(){
+
+					@Override
+					public <T extends Annotation> T getAnnotation(
+							Class<T> annotationClass) {
+						return field.getAnnotation(annotationClass);
+					}});
+		
+		logger.debug("["+field.getName()+"]["+componentModel.getComponentClassName()+"] Qualifiers : ");
+		for (Annotation annotation : qualifiers) {
+			logger.debug("==> "+annotation.toString());
+		}
+		try {
+			final BeanInstance instance = getInstance(fieldClass, qualifiers);
+			final boolean resolved = instance != null && instance.isResolved();
+			if (resolved) {
+				field.inject(instance.getBean());
+			}
+
+			if (instance != null && instance.isReleasable()) {
+				synchronized (instancesToRelease) {
+					instancesToRelease.add(instance);
+				}
+			}
+			logger.debug("Is field "+field.getName()+" of type "+field.getTypeName()+" has been succesfully managed by CDI ? "+resolved);
+			return resolved;
+		} catch (IllegalStateException isa) {
+			logger.debug("CDI failed to manage the field "+field.getName()+" of type "+field.getTypeName());
+			return false;
+		}
+	}
+
+	private Class<?> load(String typeName) {
+		try {
+			return cache.forName(typeName);
+		} catch (RuntimeException re) {
+			try {
+				return Thread.currentThread().getContextClassLoader().loadClass(typeName);
+			} catch (ClassNotFoundException e) {
+				throw re;
+			}
+		}
+	}
+
+	@PostInjection
+	public void startupService(final RegistryShutdownHub shutdownHub) {
+		shutdownHub.addRegistryShutdownListener(new ShutdownCleanUpListener(instancesToRelease));
+	}
+
+	private static class ShutdownCleanUpListener implements Runnable {
+		private final Collection<BeanInstance> releasables;
+
+		public ShutdownCleanUpListener(final Collection<BeanInstance> instancesToRelease) {
+			releasables = instancesToRelease;
+		}
+
+		@Override
+		public void run() {
+			synchronized (releasables) { // should be useless but just to be sure
+				for (BeanInstance instance : releasables) {
+					instance.release();
+				}
+				releasables.clear();
+			}
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/CDIObjectProvider.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/CDIObjectProvider.java b/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/CDIObjectProvider.java
new file mode 100755
index 0000000..e9454bf
--- /dev/null
+++ b/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/CDIObjectProvider.java
@@ -0,0 +1,57 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi;
+
+import java.lang.annotation.Annotation;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.tapestry5.cdi.internal.utils.InternalUtils;
+import org.apache.tapestry5.ioc.AnnotationProvider;
+import org.apache.tapestry5.ioc.ObjectLocator;
+import org.apache.tapestry5.ioc.ObjectProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * An ObjectProvider implementation that handles CDI beans
+ * Check first if the bean is managed by tapestry-ioc
+ * if so, the bean is ignored.
+ *
+ */
+public class CDIObjectProvider implements ObjectProvider {
+
+	private static Logger logger = LoggerFactory.getLogger(CDIObjectProvider.class); 
+
+	/* (non-Javadoc)
+	 * @see org.apache.tapestry5.ioc.ObjectProvider#provide(java.lang.Class, org.apache.tapestry5.ioc.AnnotationProvider, org.apache.tapestry5.ioc.ObjectLocator)
+	 */
+	@Override
+	public <T> T provide(Class<T> objectType,
+			AnnotationProvider annotationProvider, ObjectLocator locator) {
+		
+		if(InternalUtils.isManagedByTapestry(objectType, annotationProvider, locator)){
+			return null;
+		}
+		
+		Annotation[] qualifiers = InternalUtils.getFieldQualifiers(objectType,annotationProvider);
+		
+		logger.debug("Try to load "+objectType+" - qualifiers ? : "+qualifiers.length);
+		
+		return BeanHelper.get(objectType, qualifiers);
+	}
+
+	
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/extension/BeanManagerHolder.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/extension/BeanManagerHolder.java b/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/extension/BeanManagerHolder.java
new file mode 100755
index 0000000..56b6681
--- /dev/null
+++ b/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/extension/BeanManagerHolder.java
@@ -0,0 +1,43 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.extension;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.AfterBeanDiscovery;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.Extension;
+
+/**
+ * A Holder that provides the {@link javax.enterprise.inject.spi.BeanManager BeanManager} instance by observing the CDI {@link javax.enterprise.inject.spi.AfterBeanDiscovery AfterBeanDiscovery} event
+ *
+ */
+public class BeanManagerHolder implements Extension {
+    private static BeanManagerHolder HOLDER = new BeanManagerHolder();
+    private BeanManager beanManager;
+
+    public static BeanManager get() {
+        return HOLDER.beanManager;
+    }
+
+    /**
+     * Store the {@link javax.enterprise.inject.spi.BeanManager BeanManager} during the container startup
+     * @param afterBeanDiscovery the CDI event
+     * @param bm a BeanManager object
+     */
+    protected void saveBeanManager(@Observes final AfterBeanDiscovery afterBeanDiscovery, final BeanManager bm) {
+    	HOLDER.beanManager = bm;
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/extension/TapestryExtension.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/extension/TapestryExtension.java b/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/extension/TapestryExtension.java
new file mode 100755
index 0000000..c8c4965
--- /dev/null
+++ b/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/extension/TapestryExtension.java
@@ -0,0 +1,50 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.extension;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.Extension;
+import javax.enterprise.inject.spi.ProcessAnnotatedType;
+
+import org.apache.tapestry5.internal.InternalConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * An spi extension to exclude tapestry resources from CDI management
+ * Veto each Tapestry pages, components and mixins to avoid CDI try to manage them
+ * Without this extension, CDI will complain about Tapestry services not well loaded in injection points from the webapp's pages,components and mixins 
+ */
+public class TapestryExtension implements Extension {
+
+	private static Logger logger = LoggerFactory.getLogger(TapestryExtension.class); 
+
+	/**
+	 * Exclude Tapestry resources from CDI management
+	 * Veto each Tapestry pages, components and mixins
+	 * @param pat a ProcessAnnotatedType
+	 */
+	protected <T> void excludeTapestryResources(@Observes final ProcessAnnotatedType<T> pat){
+		String annotatedTypeClassName = pat.getAnnotatedType().getJavaClass().getName(); 
+		logger.debug("Annotated type : "+annotatedTypeClassName);
+		
+		for (String subpackage : InternalConstants.SUBPACKAGES){
+			if(annotatedTypeClassName.contains("."+subpackage+".")){
+				logger.debug("Tapestry page/component/mixins found! - will be exclude from CDI management : "+annotatedTypeClassName);
+				pat.veto();
+			}
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/internal/utils/InternalUtils.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/internal/utils/InternalUtils.java b/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/internal/utils/InternalUtils.java
new file mode 100755
index 0000000..d9f311f
--- /dev/null
+++ b/tapestry-cdi/src/main/java/org/apache/tapestry5/cdi/internal/utils/InternalUtils.java
@@ -0,0 +1,136 @@
+/**
+ * Copyright 2013 GOT5
+ *
+ * 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.apache.tapestry5.cdi.internal.utils;
+
+import static org.apache.tapestry5.cdi.BeanHelper.getQualifiers;
+
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import org.apache.tapestry5.Block;
+import org.apache.tapestry5.ComponentResources;
+import org.apache.tapestry5.annotations.Path;
+import org.apache.tapestry5.ioc.AnnotationProvider;
+import org.apache.tapestry5.ioc.Messages;
+import org.apache.tapestry5.ioc.ObjectLocator;
+import org.apache.tapestry5.ioc.annotations.Symbol;
+import org.apache.tapestry5.services.pageload.ComponentResourceSelector;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A collection of utility methods including a method that checks if a bean is managed by tapestry-ioc or not 
+ *
+ */
+public final class InternalUtils {
+
+	private static Logger logger = LoggerFactory.getLogger(InternalUtils.class); 
+
+	@SuppressWarnings("rawtypes")
+	private static final Map<Class, Annotation[]> annotationsCache = new HashMap<Class, Annotation[]>();
+
+	private static final List<String> tapestry_injectable_resources = Arrays.asList(
+			new String[]{
+					ComponentResources.class.getName(),
+					ComponentResourceSelector.class.getName(),
+					Messages.class.getName(),
+					Locale.class.getName(),
+					Logger.class.getName(),
+					Block.class.getName()
+			});
+
+	/**
+	 * Check if the injected field is managed by tapestry (resource or service)
+	 * @param type the class type
+	 * @param annotationProvider used to check the annotation of the class/field
+	 * @param locator the objectLocator
+	 * @return true if the injected field is managed by Tapestry, false otherwise
+	 */
+	@SuppressWarnings({ "unchecked", "rawtypes" })
+	public static boolean isManagedByTapestry(final Class type, final AnnotationProvider annotationProvider, final ObjectLocator locator){
+		if(type == null) return false;
+		/**
+		 * We guess that in a tapestry webapp, injected resources are mostly from Tapestry
+		 * Is a tapestry resource/service ? 
+		 * First, we check if the injected resource is a tapestry one, 
+		 * then we check if it has a <i>Symbol</i> or <i>Path</i> annotation and 
+		 * finally if it's a tapestry service by asking the locator.
+		 */
+		try {
+			if(	
+					tapestry_injectable_resources.contains(type.getName()) 		
+					|| isAnnotation(annotationProvider, Symbol.class) 
+					|| isAnnotation(annotationProvider, Path.class)
+					|| locator.getService(type)!=null
+					){
+				logger.debug(type+" is a Tapestry resources or service");
+				return true;
+			}
+		} catch (RuntimeException e) {
+			// do nothing, the service is not managed by tapestry
+			logger.debug(type +" is not a known service of the tapestry registry");
+		}
+		return false;
+	}
+
+	private static <T extends Annotation> boolean isAnnotation(AnnotationProvider annotationProvider, final Class<T> annotation) {
+		return annotationProvider.getAnnotation(
+				new Annotation(){
+					@Override
+					public Class<? extends Annotation> annotationType() {
+						return annotation;
+					}
+				}.annotationType())!=null;
+	}
+
+	/**
+	 * Returns the field's annotations corresponding to qualifiers for the current PlasticClass
+	 * @param type the class type
+	 * @param annotationProvider used to check the annotation of the class/field
+	 * @return an annotation array
+	 */
+	@SuppressWarnings("rawtypes")
+	public static Annotation[] getFieldQualifiers(final Class type,final AnnotationProvider annotationProvider) {
+		logger.debug("Field type : "+type);
+		final Annotation[] annotations;
+		if (!annotationsCache.containsKey(type)) {
+			synchronized (annotationsCache) {
+				if (!annotationsCache.containsKey(type)) {
+					logger.debug("Put qualifiers in cache for type : "+type);
+					annotationsCache.put(type, getQualifiers(type));
+				}
+			}
+		}
+		annotations = annotationsCache.get(type);
+
+		List<Annotation> qualifiers = new ArrayList<Annotation>();
+		for (Annotation annotation : annotations) {
+			boolean isAnnotationPresent = annotationProvider.getAnnotation(annotation.annotationType())!=null;
+			logger.debug("Is "+type+" has qualifier : "+annotation.annotationType()+" ? "+isAnnotationPresent);
+			if(isAnnotationPresent){
+				logger.debug("Qualifier "+annotation+" found for "+type);
+				qualifiers.add(annotation);
+			}
+		}
+		return qualifiers.toArray(new Annotation[qualifiers.size()]);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/main/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/main/resources/META-INF/beans.xml b/tapestry-cdi/src/main/resources/META-INF/beans.xml
new file mode 100755
index 0000000..ed65eba
--- /dev/null
+++ b/tapestry-cdi/src/main/resources/META-INF/beans.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright 2013 The Apache Software Foundation
+
+    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.
+
+-->
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+      http://java.sun.com/xml/ns/javaee/beans_1_0.xsd" />


[2/3] TAP5-2260: Add support for CDI

Posted by ff...@apache.org.
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension b/tapestry-cdi/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
new file mode 100755
index 0000000..2bd30a5
--- /dev/null
+++ b/tapestry-cdi/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
@@ -0,0 +1,2 @@
+org.apache.tapestry5.cdi.extension.BeanManagerHolder
+org.apache.tapestry5.cdi.extension.TapestryExtension

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/InjectTest.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/InjectTest.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/InjectTest.java
new file mode 100755
index 0000000..92583ec
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/InjectTest.java
@@ -0,0 +1,445 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+
+import javax.enterprise.inject.spi.Extension;
+
+import org.antlr.runtime.Lexer;
+import org.apache.commons.codec.StringEncoder;
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpException;
+import org.apache.commons.httpclient.HttpMethod;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.tapestry5.TapestryFilter;
+import org.apache.tapestry5.cdi.CDIInjectModule;
+import org.apache.tapestry5.cdi.extension.BeanManagerHolder;
+import org.apache.tapestry5.cdi.extension.TapestryExtension;
+import org.apache.tapestry5.cdi.test.components.DumbComponent;
+import org.apache.tapestry5.cdi.test.pages.DessertPage;
+import org.apache.tapestry5.cdi.test.pages.Index;
+import org.apache.tapestry5.cdi.test.pages.InvalidateSessionPage;
+import org.apache.tapestry5.cdi.test.pages.RequestScopePage;
+import org.apache.tapestry5.cdi.test.pages.SessionScopePage;
+import org.apache.tapestry5.cdi.test.pages.SomePage;
+import org.apache.tapestry5.cdi.test.pages.StatefulPage;
+import org.apache.tapestry5.cdi.test.pages.StereotypePage;
+import org.apache.tapestry5.cdi.test.pages.VegetablePage;
+import org.apache.tapestry5.cdi.test.pages.WSPage;
+import org.apache.tapestry5.func.Mapper;
+import org.apache.tapestry5.ioc.IOCConstants;
+import org.apache.tapestry5.ioc.annotations.InjectService;
+import org.apache.tapestry5.json.JSONArray;
+import org.apache.tapestry5.modules.TapestryModule;
+import org.apache.tapestry5.plastic.PlasticClass;
+import org.apache.ziplock.JarLocation;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.junit.InSequence;
+import org.jboss.arquillian.test.api.ArquillianResource;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.EmptyAsset;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.shrinkwrap.descriptor.api.Descriptors;
+import org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+
+@RunWith(Arquillian.class)
+public class InjectTest {
+
+    @ArquillianResource
+    private static URL indexUrl;
+
+    private static final String TEST_RESOURCES_ROOT_PATH = "src/test/resources/";
+    
+    private static final String METAINF_PATH = "src/main/resources/META-INF/";
+        		
+    /**
+     * Generate a web archive for arquillian
+     * @return a WebArchive object
+     */
+    @Deployment(testable = false)
+    public static WebArchive war() {
+    
+    	File indexPage = new File(toPath(Index.class.getName()));
+    	Package rootPackage = toPackage(indexPage.getParentFile().getParent());
+    	WebArchive war =  ShrinkWrap
+                .create(WebArchive.class, "inject.war")
+                .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
+                .addAsWebInfResource(
+                        new StringAsset(createWebXml()),
+                        "web.xml")
+                 // our test classes (src/test) = the webapp
+                .addPackages(true, rootPackage)
+                // tapestry dependencies, for real project put it in a helper
+                // class: new TapestryArchive(name)...
+                .addAsLibraries(JarLocation.jarLocation(HttpClient.class))
+                .addAsLibraries(JarLocation.jarLocation(Lexer.class))
+                .addAsLibraries(JarLocation.jarLocation(StringEncoder.class))
+                .addAsLibraries(JarLocation.jarLocation(IOCConstants.class))
+                .addAsLibraries(JarLocation.jarLocation(PlasticClass.class))
+                .addAsLibraries(JarLocation.jarLocation(JSONArray.class))
+                .addAsLibraries(JarLocation.jarLocation(InjectService.class))
+                .addAsLibraries(JarLocation.jarLocation(Mapper.class))
+                .addAsLibraries(JarLocation.jarLocation(TapestryModule.class))
+                // for jbossAS7 server
+                .addAsLibraries(JarLocation.jarLocation(org.jboss.shrinkwrap.api.asset.Asset.class))
+                // for Glassfish container
+                .addAsLibraries(JarLocation.jarLocation(org.slf4j.Logger.class));
+    			
+    			// our test resources (src/test) = the webapp
+    			// add template resources from package "pages"
+    			Package pagePackage = toPackage(indexPage.getParent());
+    	    	File pageDirectory = 
+		    			new File(TEST_RESOURCES_ROOT_PATH + toPath(pagePackage.getName()));
+		    	for (String template : pageDirectory.list()) {
+		    		war.addAsResource(pagePackage, template);
+				}
+
+    	    	// add template resources from package "components"
+    	    	Package componentPackage = DumbComponent.class.getPackage();    	    	
+    	    	File componentDirectory = 
+		    			new File(TEST_RESOURCES_ROOT_PATH + toPath(componentPackage.getName()));
+		    	for (String template : componentDirectory.list()) {
+		    		war.addAsResource(componentPackage, template);
+				}
+		    	
+		    	// add tapestry-cdi module to the archive
+		    	war.addAsLibraries(createJarArchive("tapestry-cdi.jar"));
+		    	war.addAsWebInfResource(new File(TEST_RESOURCES_ROOT_PATH + "log4j.xml"));
+    	return war;
+    }
+    
+    @Test
+    @InSequence(0)
+    public void checkApplicationScope() throws IOException {
+    	
+    	//get the index page (that increments an applicationScope counter)
+    	String output = getResponse(indexUrl);
+    	
+    	//check that the counter has been incremented
+        assertTrue("Injection of Application Scope Bean failed in page Index", output.contains("Counter : 1"));
+
+        //change the page
+        output = getResponse(new URL(indexUrl.toString() + "/"+  SomePage.class.getSimpleName()));
+        assertNotNull(output);
+
+        //get the index page (that increments an applicationScope counter)
+        output = getResponse(indexUrl);
+
+        //check that the counter has been incremented based on previous value (has not been re-initialized)
+        assertTrue("Injection of Application Scope Bean failed in page Index", output.contains("Counter : 2"));
+    }
+
+    @Test
+    @InSequence(1)
+    public void checkSessionScope() throws IOException {
+    	
+    	HttpClient client  = new HttpClient();
+    	
+    	String output = getResponse(new URL(indexUrl.toString() + "/"+  SessionScopePage.class.getSimpleName()), client );
+        assertTrue("Injection of SessionScope pojo failed in page Index 1", output.contains("session:true"));
+        
+    	output = getResponse(indexUrl, client);
+        assertTrue("Injection of SessionScope pojo failed in page Index 2", output.contains("session:true"));
+
+        output = getResponse(new URL(indexUrl.toString() + "/"+  InvalidateSessionPage.class.getSimpleName()), client);
+
+        assertNotNull(output);
+
+        output = getResponse(indexUrl, client);
+        assertTrue("Injection of SessionScope pojo failed in page Index 3", output.contains("session:false"));
+    }
+
+    @Test
+    @InSequence(2)
+    public void checkInjectionsPojoFromOutput() throws IOException {
+
+        String output = getResponse(indexUrl);
+        
+        assertTrue("Injection of Pojo failed in page index",
+                output.contains("injected pojo"));
+        assertTrue("Injection of NamedPojo failed in page index",
+                output.contains("injected named pojo"));
+        assertTrue("Injection of Pojo failed in component DumbComponent",
+                output.contains("I named pojo into component"));
+        assertTrue("Injection of NamedPojo failed in component DumbComponent",
+                output.contains("I pojo into component"));
+
+    }
+
+    @Test
+    @InSequence(3)
+    public void checkInjectionTapestryServices() throws IOException {
+        String output = getResponse(indexUrl);
+        assertTrue(
+                "Injection of Tapestry Service Messages by CDI annotation failed in page Index",
+                output.contains("message_cdi"));
+        assertTrue(
+                "Injection of Tapestry Service Messages by Tapestry annotation failed in page Index",
+                output.contains("message_tapestry"));
+
+    }
+
+    @Test
+    @InSequence(4)
+    public void checkInjectionSessionBeans() throws IOException {
+
+        String output = getResponse(indexUrl);
+        assertTrue("Injection of Stateless Session Bean failed in page Index", output.contains("Hello Stateless EJB"));
+
+        HttpClient client = new HttpClient();
+        output = getResponse(new URL(indexUrl.toString() + "/"+  StatefulPage.class.getSimpleName()), client);
+        assertTrue("Injection of Stateful Session Bean failed in page MyStateful\n" + output, output.contains("011stateful"));
+
+        output = getResponse(new URL(indexUrl.toString() + "/"+  StatefulPage.class.getSimpleName()), client);
+        assertTrue("Injection of Stateful Session Bean failed in page MyStateful\n" + output, output.contains("122stateful"));
+
+    }
+
+
+    @Test
+    @InSequence(5)
+    public void checkInjectionRequestScope() throws IOException {
+    	HttpClient client = new HttpClient();
+    	
+    	String output = getResponse(indexUrl, client);
+        assertTrue("Injection of RequestScope pojo failed in page Index", output.contains("request:true"));
+
+        output = getResponse(new URL(indexUrl.toString() + "/"+  RequestScopePage.class.getSimpleName()), client);
+        assertTrue("Injection of RequestScope pojo failed in page Index", output.contains("request:false"));
+
+    }
+
+
+   /**
+     * Todo - Add tests for session state. How  notify cdi about changes in session state objects ?
+     *
+     */
+
+    @Test
+    @InSequence(6)
+    public void checkQualifierBasic() throws IOException {
+
+        String output = getResponse(new URL(indexUrl.toString() + "/"+  DessertPage.class.getSimpleName()));
+        assertTrue("Injection of pojo with qualifier failed in page Dessert", output.contains("dessert1:true"));
+        assertTrue("Injection of pojo with qualifier failed in page Dessert", output.contains("dessert2:true"));
+        assertTrue("Injection of pojo with qualifier and produces method failed in page Dessert", output.contains("dessert3:true"));
+        assertTrue("Injection of pojo with qualifier and produces method + @new failed in page Dessert", output.contains("dessert4:true"));
+
+        /**
+         Todo - Add support to @Inject method | uncomment the line below to test it
+         */
+        //assertTrue("Injection of pojo with qualifier and inject method in page Dessert",output.contains("dessert5:true"));
+
+
+    }
+
+    @Test
+    @InSequence(7)
+    public void checkConversationScope() throws IOException {
+
+        String output = getResponse(new URL(indexUrl.toString() + "/"+  VegetablePage.class.getSimpleName()));
+        /**
+         Todo - Create a test with drone to play with the conversation scope
+         */
+
+    }
+
+    @Test
+    @InSequence(8)
+    public void checkEventBasic() throws IOException {
+        /**
+         Todo - find a usecase... issues while fire event in page/ cannot observes in page either
+         */
+        
+    }
+
+    @Test
+    @InSequence(9)
+    public void checkBindingType() throws IOException {
+        /**
+         Todo - Use Produces method with parameter to present a great use case
+         */
+
+
+    }
+
+    @Test
+    @InSequence(10)
+    public void checkWebService() throws IOException {
+    	 String output = getResponse(new URL(indexUrl.toString() + "/"+ WSPage.class.getSimpleName()));
+    	 assertNotNull(output);
+    	 assertTrue("Injection of webservice failed in page WSPage", output.contains("Hello John"));
+    }
+    
+    @Test
+    @InSequence(11)
+    public void checkStereotype() throws IOException {
+    	
+    	HttpClient client  = new HttpClient();
+    	
+    	//Check if injection of specific stereotyped bean is ok 
+    	   
+    	String output = getResponse(new URL(indexUrl.toString() + "/"+ StereotypePage.class.getSimpleName()), client);
+    	assertNotNull(output);
+    	assertTrue("Injection of stereotyped bean failed in page StereotypePage", output.contains("Stereotype bean:true"));
+    	assertTrue("Stereotype Bean not SessionScoped as expected in page StereotypePage", output.contains("Same instance:true"));
+    	
+    	//Check if the bean is really SessionScoped as its Stereotype says
+
+    	output = getResponse(indexUrl, client);
+    	/** 
+    	 * TODO : uncomment the following assertion 
+    	 * An issue occurs randomly only with TomEE : the bean is not SessionScoped as expected
+    	 * Works perfectly with glassfish and jbossAS7
+    	 * */
+    	// assertTrue("Stereotype Bean not SessionScoped as expected in page StereotypePage \n"+output, output.contains("stereotype:true")); 
+    	 
+    	output = getResponse(new URL(indexUrl.toString() + "/"+  InvalidateSessionPage.class.getSimpleName()), client);
+    	assertNotNull(output);
+    	output = getResponse(indexUrl, client);
+    	assertTrue("Stereotype Bean not SessionScoped as expected in page StereotypePage", output.contains("stereotype:false"));
+    }
+    
+    /**
+     * Create a jar archive for tapestry-cdi
+     * @param archiveName the archive name
+     * @return a JarArchive object
+     */
+     private static JavaArchive createJarArchive(String archiveName){
+    	JavaArchive jar =  ShrinkWrap
+    			// our module (src/main), as we are in the same project building
+                // the jar on the fly
+                .create(JavaArchive.class,
+                		archiveName)
+                .addPackages(true,
+                        CDIInjectModule.class.getPackage()
+                                .getName())
+                // do not include test package
+                .deletePackages(true,
+                        InjectTest.class.getPackage()
+                                .getName())
+                .addAsManifestResource(
+                        new StringAsset(BeanManagerHolder.class
+                                .getName()),
+                        "services/" + Extension.class.getName());
+
+    	jar.addAsManifestResource(
+                    new StringAsset(TapestryExtension.class.getName()),
+                    "services/" + Extension.class.getName());
+    	jar.addAsManifestResource(
+    			new File(METAINF_PATH + "services/" + Extension.class.getName()),
+                "services/" + Extension.class.getName());
+    	jar.addAsManifestResource(
+    			new File(METAINF_PATH + "beans.xml"),
+                "beans.xml");
+    	jar.addAsManifestResource(
+    			new File(METAINF_PATH + "MANIFEST.MF"),
+                "MANIFEST.MF");
+    	return jar;
+    }
+    
+    
+    /**
+     * Create a web.xml file and return its content as a String
+     * @return a String
+     */
+    private static String createWebXml(){
+    	return Descriptors
+                .create(WebAppDescriptor.class).version("3.0")
+                .createContextParam()
+                .paramName("tapestry.app-package")
+                .paramValue(InjectTest.class.getPackage().getName())
+                .up().createContextParam()
+                .paramName("tapestry.production-mode")
+                .paramValue("false").up().createFilter()
+                .filterName("pojo")
+                .filterClass(TapestryFilter.class.getName())
+                .up().createFilterMapping().filterName("pojo")
+                .urlPattern("/*").up()
+                .exportAsString();
+    }
+    
+    /**
+     * Convert a package name to a path
+     * @param packageName the package name
+     * @return a String
+     */
+    private static String toPath(String packageName) {
+		return packageName.replace(".", File.separator);
+	}
+
+    /**
+     * Convert a file path to a Package
+     * @param path the file path
+     * @return a Package
+     */
+    private static Package toPackage(String path) {
+		return Package.getPackage(path.replace(File.separator, "."));
+	}
+
+    /**
+     * Connect to an url and return the response content as a String 
+     * @param url an url to connect to
+     * @return the response as a String
+     */
+    private String getResponse(URL url) {
+    	return getResponse(url, null);
+    }
+    
+    /**
+     * Connect to an url thanks to an HttpClient if provided and return the response content as a String 
+     * Use same HttpClient to keep same HttpSession through multiple getResponse method calls  
+     * @param url an url to connect to
+     * @param client an HTTPClient to use to serve the url
+     * @return the response as a String
+     */
+    private String getResponse(URL url, HttpClient client) {
+    	HttpClient newClient = client==null ? new HttpClient() : client;
+        HttpMethod get = new GetMethod(url.toString());
+        String output = null;
+        int out = 200;
+    	 try {
+             out = newClient.executeMethod(get);
+             if (out != 200) {
+                 throw new RuntimeException("get " + get.getURI() + " returned " + out);
+             }
+             output = get.getResponseBodyAsString();
+             
+         } catch (HttpException e) {
+        	 e.printStackTrace();
+        	 throw new RuntimeException("get " + url + " returned " + out);
+		} catch (IOException e) {
+			e.printStackTrace();
+			throw new RuntimeException("get " + url + " returned " + out);
+		} finally {
+             get.releaseConnection();
+         }
+         return output;
+    }
+
+}
+

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/Choco.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/Choco.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/Choco.java
new file mode 100755
index 0000000..59102e2
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/Choco.java
@@ -0,0 +1,29 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.annotation;
+
+import javax.inject.Qualifier;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Qualifier
+@Retention(RUNTIME)
+@Target({TYPE,METHOD,FIELD,PARAMETER})
+public @interface Choco {
+
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/CustomDessert.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/CustomDessert.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/CustomDessert.java
new file mode 100755
index 0000000..1d5a567
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/CustomDessert.java
@@ -0,0 +1,29 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.annotation;
+
+import javax.inject.Qualifier;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Qualifier
+@Retention(RUNTIME)
+@Target({TYPE,METHOD,FIELD,PARAMETER})
+public @interface CustomDessert {
+
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/DessertTime.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/DessertTime.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/DessertTime.java
new file mode 100755
index 0000000..b9e785d
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/DessertTime.java
@@ -0,0 +1,29 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.annotation;
+
+import javax.inject.Qualifier;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Qualifier
+@Retention(RUNTIME)
+@Target({TYPE,METHOD,FIELD,PARAMETER})
+public @interface DessertTime {
+
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/Iced.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/Iced.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/Iced.java
new file mode 100755
index 0000000..3c43b3e
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/Iced.java
@@ -0,0 +1,32 @@
+/**
+ * Copyright 2013 GOT5
+ *
+ * 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.apache.tapestry5.cdi.test.annotation;
+
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+import javax.inject.Qualifier;
+
+@Qualifier
+@Retention(RUNTIME)
+@Target({TYPE,METHOD,FIELD,PARAMETER})
+public @interface Iced{
+
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/MyStereotype.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/MyStereotype.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/MyStereotype.java
new file mode 100755
index 0000000..757bc09
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/annotation/MyStereotype.java
@@ -0,0 +1,33 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.annotation;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.inject.Stereotype;
+import javax.inject.Named;
+
+@Stereotype
+@SessionScoped
+@Named
+@Retention(RUNTIME)
+@Target(TYPE)
+public @interface MyStereotype{
+
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/BrownieImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/BrownieImpl.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/BrownieImpl.java
new file mode 100755
index 0000000..859c66e
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/BrownieImpl.java
@@ -0,0 +1,50 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.beans;
+
+import org.apache.tapestry5.cdi.test.annotation.Choco;
+import org.apache.tapestry5.cdi.test.annotation.Iced;
+
+import javax.enterprise.context.SessionScoped;
+
+@Choco
+@SessionScoped
+public class BrownieImpl implements Dessert{
+
+    private String name = "Baked Brownie";
+
+    private String secondName = "Chewy Brownies";
+
+
+    public String getName(){
+        return name;
+    }
+
+    public String getOtherName(){
+        return secondName;
+    }
+
+    public void setName(String name){
+        this.name = name;
+    }
+
+    public void changeName(){
+        name = secondName;
+    }
+
+    public boolean getCheckName(){
+        return name.equals(secondName);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Counter.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Counter.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Counter.java
new file mode 100755
index 0000000..aeffda4
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Counter.java
@@ -0,0 +1,34 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.beans;
+
+import java.io.Serializable;
+import java.util.concurrent.atomic.AtomicInteger;
+
+public abstract class Counter implements Serializable
+{
+	private static final long serialVersionUID = 1L;
+	private AtomicInteger counter = new AtomicInteger();
+
+	public int getCount()
+	{
+		return counter.get();
+	}
+
+	public void increment()
+	{
+		counter.incrementAndGet();
+	}
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/CounterService.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/CounterService.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/CounterService.java
new file mode 100755
index 0000000..7482abb
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/CounterService.java
@@ -0,0 +1,31 @@
+/**
+ * Copyright 2013 GOT5
+ *
+ * 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.apache.tapestry5.cdi.test.beans;
+
+import javax.enterprise.context.ApplicationScoped;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@ApplicationScoped
+public class CounterService extends Counter{
+	
+	private static final long serialVersionUID = 1L;
+	
+	private static final Logger logger = LoggerFactory.getLogger(CounterService.class);
+
+}
+

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Dessert.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Dessert.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Dessert.java
new file mode 100755
index 0000000..a16452e
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Dessert.java
@@ -0,0 +1,30 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.beans;
+
+import java.io.Serializable;
+
+public interface Dessert extends Serializable {
+
+    public String getName();
+
+    public String getOtherName();
+
+    public void setName(String name);
+
+    public void changeName();
+
+    public boolean getCheckName();
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/DessertFactory.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/DessertFactory.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/DessertFactory.java
new file mode 100755
index 0000000..3d9774d
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/DessertFactory.java
@@ -0,0 +1,51 @@
+/**
+ * Copyright 2013 GOT5
+ *
+ * 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.apache.tapestry5.cdi.test.beans;
+
+import org.apache.tapestry5.cdi.test.annotation.CustomDessert;
+import org.apache.tapestry5.cdi.test.annotation.DessertTime;
+
+import javax.enterprise.inject.New;
+import javax.enterprise.inject.Produces;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+
+public class DessertFactory {
+
+    @Produces
+    @CustomDessert
+    public Dessert getCustomDessert(){
+        Dessert d = new IceCreamImpl();
+        d.changeName();
+        return d;
+    }
+
+    @Produces
+    @DessertTime
+    public Dessert getGoodDessert(@New DessertImpl dImpl,@New BrownieImpl brownie,@New IceCreamImpl iceCream){
+        Calendar today = new GregorianCalendar();
+        int hourOfDay = today.get(Calendar.HOUR_OF_DAY);
+        if(hourOfDay < 12){
+            return dImpl;
+        }if(hourOfDay == 12){
+            return iceCream;
+        }else{
+            return brownie;
+        }
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/DessertImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/DessertImpl.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/DessertImpl.java
new file mode 100755
index 0000000..3526cb0
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/DessertImpl.java
@@ -0,0 +1,47 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.beans;
+
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.inject.Default;
+
+
+@SessionScoped
+@Default
+public class DessertImpl implements Dessert{
+    private String name = "Ice Cream Sandwich";
+
+    private String secondName = "Jelly Bean";
+
+    public String getName(){
+        return name;
+    }
+
+    public String getOtherName(){
+        return secondName;
+    }
+
+    public void setName(String name){
+        this.name = name;
+    }
+
+    public void changeName(){
+        name = secondName;
+    }
+
+    public boolean getCheckName(){
+        return name.equals(secondName);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/IceCreamImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/IceCreamImpl.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/IceCreamImpl.java
new file mode 100755
index 0000000..1a29ae1
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/IceCreamImpl.java
@@ -0,0 +1,50 @@
+/**
+ * Copyright 2013 GOT5
+ *
+ * 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.apache.tapestry5.cdi.test.beans;
+
+import org.apache.tapestry5.cdi.test.annotation.Iced;
+
+import javax.enterprise.context.SessionScoped;
+
+@Iced
+@SessionScoped
+public class IceCreamImpl implements Dessert{
+
+    private String name = "Sorbet";
+
+    private String secondName = "Snow Cones";
+
+
+    public String getName(){
+        return name;
+    }
+
+    public String getOtherName(){
+        return secondName;
+    }
+
+    public void setName(String name){
+        this.name = name;
+    }
+
+    public void changeName(){
+        name = secondName;
+    }
+
+    public boolean getCheckName(){
+        return name.equals(secondName);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Menu.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Menu.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Menu.java
new file mode 100755
index 0000000..a42cdbb
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Menu.java
@@ -0,0 +1,40 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.beans;
+
+import javax.inject.Inject;
+
+import org.apache.tapestry5.cdi.test.annotation.Iced;
+
+public class Menu {
+
+    private Dessert dessert;
+
+    @Inject
+    void initQuery(@Iced Dessert dessert){
+
+            this.dessert = dessert;
+
+    }
+
+    public String getDessert(){
+        if(dessert !=null){
+            return dessert.getName();
+        }else{
+            return "no dessert";
+        }
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/NamedPojo.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/NamedPojo.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/NamedPojo.java
new file mode 100755
index 0000000..f54934e
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/NamedPojo.java
@@ -0,0 +1,29 @@
+/**
+ * Copyright 2013 GOT5
+ *
+ * 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.apache.tapestry5.cdi.test.beans;
+
+import javax.inject.Named;
+
+@Named("named")
+public class NamedPojo {
+    public String getName() {
+        return "injected named pojo";
+    }
+    
+    public String getNameForComponent(){
+    	return "I named pojo into component";
+    }
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Pojo.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Pojo.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Pojo.java
new file mode 100755
index 0000000..96dafc1
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Pojo.java
@@ -0,0 +1,26 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.beans;
+
+
+public class Pojo {
+    public String getName() {
+        return "injected pojo";
+    }
+    
+    public String getNameForComponent(){
+    	return "I pojo into component";
+    }
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Soup.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Soup.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Soup.java
new file mode 100755
index 0000000..1b81d11
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Soup.java
@@ -0,0 +1,42 @@
+/**
+ * Copyright 2013 GOT5
+ *
+ * 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.apache.tapestry5.cdi.test.beans;
+
+import javax.enterprise.context.RequestScoped;
+
+@RequestScoped
+public class Soup {
+
+	private String name = "Soup of the day";
+	private String secondName = "Soup of Tomorrow";
+
+	public String getName() {
+		return name;
+
+	}
+
+	public void changeName(){
+		name = secondName;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public boolean getCheckNames(){
+		return name.equals(secondName);
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/StatefulEJBBean.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/StatefulEJBBean.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/StatefulEJBBean.java
new file mode 100755
index 0000000..3f48a21
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/StatefulEJBBean.java
@@ -0,0 +1,28 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.beans;
+
+import javax.ejb.Local;
+
+@Local
+public interface StatefulEJBBean {
+	
+	int num();
+	
+	int inc();
+	
+	int reset();
+
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/StatefulEJBBeanImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/StatefulEJBBeanImpl.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/StatefulEJBBeanImpl.java
new file mode 100755
index 0000000..61a4074
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/StatefulEJBBeanImpl.java
@@ -0,0 +1,41 @@
+/**
+ * Copyright 2013 GOT5
+ *
+ * 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.apache.tapestry5.cdi.test.beans;
+
+import javax.ejb.Stateful;
+
+@Stateful
+public class StatefulEJBBeanImpl implements StatefulEJBBean{
+	
+	private int num = 0;
+
+	@Override
+	public int num() {
+		return num;
+	}
+	@Override
+	public int inc(){
+		return ++num;
+	}
+	
+	@Override
+	public int reset(){
+		return (num = 0);
+	}
+	
+	
+	
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/StatelessEJBBean.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/StatelessEJBBean.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/StatelessEJBBean.java
new file mode 100755
index 0000000..f1509b4
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/StatelessEJBBean.java
@@ -0,0 +1,25 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.beans;
+
+import javax.ejb.Local;
+
+@Local
+public interface StatelessEJBBean {
+	
+	String helloStatelessEJB();
+	
+
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/StatelessEJBBeanImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/StatelessEJBBeanImpl.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/StatelessEJBBeanImpl.java
new file mode 100755
index 0000000..a816344
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/StatelessEJBBeanImpl.java
@@ -0,0 +1,29 @@
+/**
+ * Copyright 2013 GOT5
+ *
+ * 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.apache.tapestry5.cdi.test.beans;
+
+import javax.ejb.Stateless;
+
+@Stateless
+public class StatelessEJBBeanImpl implements StatelessEJBBean{
+
+	@Override
+	public String helloStatelessEJB() {
+		return "Hello Stateless EJB";
+	}
+
+	
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Stereotyped.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Stereotyped.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Stereotyped.java
new file mode 100755
index 0000000..63067b6
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Stereotyped.java
@@ -0,0 +1,47 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.beans;
+
+import java.io.Serializable;
+
+import org.apache.tapestry5.cdi.test.annotation.MyStereotype;
+
+@SuppressWarnings("serial")
+@MyStereotype
+public class Stereotyped implements Serializable {
+
+	private String name = "Stereotyped";
+
+	private String secondName = "Stereotyped name changed";
+
+    public String getName(){
+        return name;
+    }
+
+    public String getOtherName(){
+        return secondName;
+    }
+
+    public void setName(String name){
+        this.name = name;
+    }
+
+    public void changeName(){
+        name = secondName;
+    }
+
+    public boolean getCheckName(){
+        return name.equals(secondName);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Vegetable.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Vegetable.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Vegetable.java
new file mode 100755
index 0000000..16709a2
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/Vegetable.java
@@ -0,0 +1,62 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.beans;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.ConversationScoped;
+import javax.inject.Inject;
+import java.io.Serializable;
+
+@ConversationScoped
+public class Vegetable implements Serializable{
+    private String name = "salad";
+    private String secondName = "tomato";
+
+    @Inject
+    private
+    javax.enterprise.context.Conversation conversation;
+
+    @PostConstruct
+    public void init(){
+        if(conversation.isTransient()){
+            conversation.begin();
+        }
+        throw new IllegalStateException();
+    }
+
+
+    public String getName(){
+        return name;
+    }
+
+
+    public void changeName(){
+        name = secondName;
+    }
+
+    public void getEndConversation(){
+        if(!conversation.isTransient()){
+            conversation.end();
+        }
+        throw new IllegalStateException();
+    }
+
+    public boolean getCheckName(){
+        return name.equals(secondName);
+    }
+    public String getSecondName(){
+        return secondName;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/ws/HelloWorldService.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/ws/HelloWorldService.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/ws/HelloWorldService.java
new file mode 100755
index 0000000..11597f9
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/ws/HelloWorldService.java
@@ -0,0 +1,37 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.beans.ws;
+
+import javax.ejb.Local;
+import javax.jws.WebService;
+
+@WebService(targetNamespace = "https://github.com/got5/tapestry-cdi/beans/ws/HelloWorld")
+@Local
+public interface HelloWorldService {
+
+    /**
+     * Say hello as a response
+     * 
+     * @return A simple hello world message
+     */
+    public String sayHello();
+
+    /**
+     * Say hello to someone 
+     * 
+     * @param name The name of the person to say hello to
+     */
+    public String sayHelloToName(String name);
+}
+

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/ws/HelloWorldServiceImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/ws/HelloWorldServiceImpl.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/ws/HelloWorldServiceImpl.java
new file mode 100755
index 0000000..f6eb643
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/beans/ws/HelloWorldServiceImpl.java
@@ -0,0 +1,38 @@
+/**
+ * Copyright 2013 GOT5
+ *
+ * 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.apache.tapestry5.cdi.test.beans.ws;
+
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+
+@Stateless
+@WebService(
+		serviceName = "HelloWorldService", 
+		portName = "HelloWorldPort", 
+		endpointInterface = "org.apache.tapestry5.cdi.test.beans.ws.HelloWorldService", 
+		targetNamespace = "https://github.com/got5/tapestry-cdi/beans/ws/HelloWorld")
+public class HelloWorldServiceImpl implements HelloWorldService {
+
+    @Override
+    public String sayHello() {
+        return "Hello World!";
+    }
+
+    @Override
+    public String sayHelloToName(final String name) {
+          return "Hello "+name;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/components/DumbComponent.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/components/DumbComponent.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/components/DumbComponent.java
new file mode 100755
index 0000000..021cf38
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/components/DumbComponent.java
@@ -0,0 +1,33 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.components;
+
+import javax.inject.Inject;
+
+import org.apache.tapestry5.annotations.Property;
+import org.apache.tapestry5.cdi.test.beans.NamedPojo;
+import org.apache.tapestry5.cdi.test.beans.Pojo;
+
+public class DumbComponent {
+
+	@Inject
+	@Property
+	private Pojo pojo;
+	
+	@Inject
+	@Property
+	private NamedPojo namedPojo;
+	
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/DessertPage.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/DessertPage.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/DessertPage.java
new file mode 100755
index 0000000..53ed6e5
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/DessertPage.java
@@ -0,0 +1,95 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.pages;
+
+import org.apache.tapestry5.cdi.test.annotation.Choco;
+import org.apache.tapestry5.cdi.test.annotation.CustomDessert;
+import org.apache.tapestry5.cdi.test.annotation.DessertTime;
+import org.apache.tapestry5.cdi.test.annotation.Iced;
+import org.apache.tapestry5.cdi.test.beans.*;
+
+import javax.inject.Inject;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+
+public class DessertPage {
+
+    @Inject
+    @Iced
+    private Dessert dessert1;
+
+    @Choco
+    @Inject
+    private Dessert dessert2;
+
+    @CustomDessert
+    @Inject
+    private Dessert dessert3;
+
+    @DessertTime
+    @Inject
+    private Dessert dessert4;
+
+    @Inject
+    private Menu menu;
+
+
+    public String getQualifier1() {
+        if (dessert1 != null) {
+            return "dessert1:" + dessert1.getName().equals(new IceCreamImpl().getName());
+        } else {
+            return "";
+        }
+    }
+
+    public String getQualifier2() {
+        if (dessert1 != null) {
+            return "dessert2:" + dessert2.getName().equals(new BrownieImpl().getName());
+        } else {
+            return "";
+        }
+    }
+
+    public String getQualifier3() {
+        if (dessert3 != null) {
+            return "dessert3:" + dessert3.getName().equals(new IceCreamImpl().getOtherName());
+        } else {
+            return "";
+        }
+    }
+
+    public String getQualifier4() {
+        Calendar today = new GregorianCalendar();
+        int hourOfDay = today.get(Calendar.HOUR_OF_DAY);
+        if (dessert4 != null) {
+            if (hourOfDay < 12) {
+                return "dessert4:" + dessert4.getName().equals(new DessertImpl().getName());
+
+            }
+            if (hourOfDay == 12) {
+                return "dessert4:" + dessert4.getName().equals(new IceCreamImpl().getName());
+            } else {
+                return "dessert4:" + dessert4.getName().equals(new BrownieImpl().getName());
+            }
+        }else{
+            return "";
+        }
+    }
+
+    public String getQualifier5(){
+       return "dessert5:" + menu.getDessert().equals(new IceCreamImpl().getName());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/Index.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/Index.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/Index.java
new file mode 100755
index 0000000..bd7b835
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/Index.java
@@ -0,0 +1,122 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.pages;
+
+import javax.inject.Named;
+
+import org.apache.tapestry5.ComponentResources;
+import org.apache.tapestry5.SymbolConstants;
+import org.apache.tapestry5.annotations.Property;
+import org.apache.tapestry5.cdi.test.beans.CounterService;
+import org.apache.tapestry5.cdi.test.beans.Dessert;
+import org.apache.tapestry5.cdi.test.beans.NamedPojo;
+import org.apache.tapestry5.cdi.test.beans.Pojo;
+import org.apache.tapestry5.cdi.test.beans.Soup;
+import org.apache.tapestry5.cdi.test.beans.StatelessEJBBean;
+import org.apache.tapestry5.cdi.test.beans.Stereotyped;
+import org.apache.tapestry5.ioc.Messages;
+import org.apache.tapestry5.ioc.annotations.Symbol;
+
+
+public class Index {
+    @javax.inject.Inject
+    private Pojo pojo;
+
+    @javax.inject.Inject
+    @Named("named")
+    private NamedPojo namedPojo;
+    
+
+    @javax.inject.Inject
+    @Property
+    private CounterService counterService;
+    
+
+    @javax.inject.Inject
+    private Messages messageCDI;
+    
+    @org.apache.tapestry5.ioc.annotations.Inject
+    private Messages messageTapestry;
+    
+    @javax.inject.Inject
+    private ComponentResources resources;
+    
+    @javax.inject.Inject
+    @Symbol(value=SymbolConstants.PRODUCTION_MODE)
+    private boolean production_mode;
+    
+    @javax.inject.Inject
+    private StatelessEJBBean statelessBean;
+
+    
+    @javax.inject.Inject
+    private Soup soup1;
+    
+    @javax.inject.Inject
+    private Soup soup2;
+
+    @javax.inject.Inject
+    private Dessert dessert;
+
+    @javax.inject.Inject
+    private Stereotyped stereotyped;
+
+        
+   
+    public String getPojo() {
+        return pojo.getName();
+    }
+    public String getNamedPojo() {
+        return namedPojo.getName();
+    }
+    
+    public String getMessageCDI(){
+    	return messageCDI.get("messagecdi");
+    }
+    
+    public String getMessageTapestry(){
+    	return messageTapestry.get("messagetapestry");
+    }
+    public String getStatelessEJB(){
+    	return statelessBean.helloStatelessEJB();
+    }
+
+    public String getRequestScopePojo(){
+    	if(soup1 !=null){
+    		soup1.changeName();
+    		return "request:"+soup1.getName().equals(soup2.getName());
+    	}
+    	return "";
+    }
+
+    public String getSessionScopePojo(){
+        if(dessert != null){
+            return "session:"+dessert.getName().equals(dessert.getOtherName());
+        }
+         return "";
+     }
+
+    public String getStereotype(){
+        if(stereotyped != null){
+            return "stereotype:"+stereotyped.getCheckName();
+        }
+         return "";
+     }
+
+
+    public void onActivate(){
+    	counterService.increment();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/InvalidateSessionPage.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/InvalidateSessionPage.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/InvalidateSessionPage.java
new file mode 100755
index 0000000..b76d3be
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/InvalidateSessionPage.java
@@ -0,0 +1,30 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.pages;
+
+
+import javax.inject.Inject;
+
+public class InvalidateSessionPage {
+
+
+    @Inject
+    private org.apache.tapestry5.services.Request request;
+
+
+    public void onActivate(){
+    	request.getSession(true).invalidate();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/RequestScopePage.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/RequestScopePage.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/RequestScopePage.java
new file mode 100755
index 0000000..e073d26
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/RequestScopePage.java
@@ -0,0 +1,38 @@
+/**
+ * Copyright 2013 GOT5
+ *
+ * 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.apache.tapestry5.cdi.test.pages;
+
+import javax.inject.Inject;
+
+import org.apache.tapestry5.cdi.test.beans.Soup;
+
+public class RequestScopePage {
+
+	@Inject
+	private Soup soup1;
+	
+	@Inject
+	private Soup soup2;
+	
+	 public String getRequestScopePojo(){
+	    	
+	    	if(soup1 !=null){
+	    		return "request:" + soup1.getCheckNames();
+	    	}
+	    	return "";
+	    		
+	    }
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/SessionScopePage.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/SessionScopePage.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/SessionScopePage.java
new file mode 100755
index 0000000..dfaa296
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/SessionScopePage.java
@@ -0,0 +1,39 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.pages;
+
+import javax.inject.Inject;
+
+import org.apache.tapestry5.cdi.test.beans.Dessert;
+
+public class SessionScopePage {
+
+   @Inject
+   private Dessert dessert1;
+
+   @Inject
+   private Dessert dessert2;
+
+   public String getSessionScopePojo(){
+
+    	if(dessert1!=null && dessert1.getName().equals(dessert2.getName())){
+    		dessert1.changeName();
+        	return "session:" + dessert1.getName().equals(dessert2.getName());
+        }else{
+            return "";
+        }
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/SomePage.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/SomePage.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/SomePage.java
new file mode 100755
index 0000000..2c1b5be
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/SomePage.java
@@ -0,0 +1,20 @@
+/**
+ * Copyright 2013 GOT5
+ *
+ * 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.apache.tapestry5.cdi.test.pages;
+
+public class SomePage {
+
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/StatefulPage.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/StatefulPage.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/StatefulPage.java
new file mode 100755
index 0000000..1530627
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/StatefulPage.java
@@ -0,0 +1,42 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.pages;
+
+import javax.inject.Inject;
+
+import org.apache.tapestry5.MarkupWriter;
+import org.apache.tapestry5.annotations.BeginRender;
+import org.apache.tapestry5.annotations.CleanupRender;
+import org.apache.tapestry5.cdi.test.beans.StatefulEJBBean;
+
+public class StatefulPage {
+
+	@Inject
+	private StatefulEJBBean statefulBean;
+
+	@BeginRender
+	public void rend(MarkupWriter mw) {
+		
+		mw.writeRaw(String.valueOf(statefulBean.num()) + String.valueOf(statefulBean.inc())
+				+ String.valueOf(statefulBean.num())+"stateful");//prepend XXXstateful at the root of the page
+
+	}
+
+	@CleanupRender
+	public void clean() {
+		
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/StereotypePage.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/StereotypePage.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/StereotypePage.java
new file mode 100755
index 0000000..a28487e
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/StereotypePage.java
@@ -0,0 +1,43 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.pages;
+
+import javax.inject.Inject;
+
+import org.apache.tapestry5.cdi.test.beans.Stereotyped;
+
+public class StereotypePage {
+
+	@Inject
+	private Stereotyped stereotype1;
+	
+	@Inject
+	private Stereotyped stereotype2;
+	
+	public String getStereotypeBeanInfo(){
+		
+		if(stereotype1!=null && stereotype1.getName().equals(stereotype2.getName())){
+			stereotype1.changeName();
+        	return "Stereotype bean:true";
+        }else{
+            return "";
+        }
+	}
+
+	public String getSameInstanceInfo(){
+		return "Same instance:"+(stereotype1 == stereotype2);
+	}
+	
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/VegetablePage.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/VegetablePage.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/VegetablePage.java
new file mode 100755
index 0000000..0503ba9
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/VegetablePage.java
@@ -0,0 +1,39 @@
+/**
+ * Copyright 2013 GOT5
+ *
+ * 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.apache.tapestry5.cdi.test.pages;
+
+import javax.inject.Inject;
+
+import org.apache.tapestry5.cdi.test.beans.Vegetable;
+
+public class VegetablePage {
+
+    @Inject
+    private Vegetable vegetable;
+
+
+
+    public String getVegetable(){
+        if(vegetable != null){
+            return "vegetable:" + vegetable.getName().equals(vegetable.getSecondName());
+        }
+        else
+            return "";
+    }
+
+
+
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/WSPage.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/WSPage.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/WSPage.java
new file mode 100755
index 0000000..4e3c550
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/pages/WSPage.java
@@ -0,0 +1,35 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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.apache.tapestry5.cdi.test.pages;
+
+import javax.inject.Inject;
+
+import org.apache.tapestry5.annotations.Property;
+import org.apache.tapestry5.cdi.test.beans.ws.HelloWorldService;
+
+public class WSPage {
+
+	@Inject
+	private HelloWorldService client;
+	
+	@SuppressWarnings("unused")
+	@Property
+	private String message;
+
+	public void onActivate(){
+		message = client.sayHelloToName("John");
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/services/ClasspathURLConverterJBoss7Dot1.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/services/ClasspathURLConverterJBoss7Dot1.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/services/ClasspathURLConverterJBoss7Dot1.java
new file mode 100755
index 0000000..336a66f
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/services/ClasspathURLConverterJBoss7Dot1.java
@@ -0,0 +1,99 @@
+package org.apache.tapestry5.cdi.test.services;
+
+import java.io.File;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLConnection;
+
+import org.apache.tapestry5.ioc.services.ClasspathURLConverter;
+
+public class ClasspathURLConverterJBoss7Dot1 implements ClasspathURLConverter
+{
+    
+    public URL convert(URL url)
+    {
+        // If the URL is a "vfs" URL (JBoss 7.1 uses a Virtual File System)...
+
+        if (url != null && url.getProtocol().startsWith("vfs"))
+        {
+            // Ask the VFS what the physical URL is...
+
+            try
+            {
+                String urlString = url.toString();
+                        
+                // If the virtual URL involves a JAR file, 
+                // we have to figure out its physical URL ourselves because
+                // in JBoss 7.1 the JAR files exploded into the VFS are empty 
+                // (see https://issues.jboss.org/browse/JBAS-8786).
+                // Our workaround is that they are available, unexploded, 
+                // within the otherwise exploded WAR file.
+
+                if (urlString.contains(".jar")) {
+                                        
+                    // An example URL: "vfs:/devel/jboss-7.1.0.Final/server/default/deploy/myapp.ear/myapp.war/WEB-INF/lib/tapestry-core-5.3.3.jar/org/apache/tapestry5/corelib/components/"
+                    // Break the URL into its WAR part, the JAR part, 
+                    // and the Java package part.
+                                        
+                    int warPartEnd = urlString.indexOf(".war") + 4;
+                    String warPart = urlString.substring(0, warPartEnd);
+                    int jarPartEnd = urlString.indexOf(".jar") + 4;
+                    String jarPart = urlString.substring(warPartEnd, jarPartEnd);
+                    String packagePart = urlString.substring(jarPartEnd);
+
+                    // Ask the VFS where the exploded WAR is.
+
+                    URL warURL = new URL(warPart);
+                    URLConnection warConnection = warURL.openConnection();
+                    Object jBossVirtualWarDir = warConnection.getContent();
+                    // Use reflection so that we don't need JBoss in the classpath at compile time.
+                    File physicalWarDir = (File) invokerGetter(jBossVirtualWarDir, "getPhysicalFile");
+                    String physicalWarDirStr = physicalWarDir.toURI().toString();
+
+                    // Return a "jar:" URL constructed from the parts
+                    // eg. "jar:file:/devel/jboss-7.1.0.Final/server/default/tmp/vfs/automount40a6ed1db5eabeab/myapp.war-43e2c3dfa858f4d2//WEB-INF/lib/tapestry-core-5.3.3.jar!/org/apache/tapestry5/corelib/components/".
+
+                    String actualJarPath = "jar:" + physicalWarDirStr + jarPart + "!" + packagePart;
+                    return new URL(actualJarPath);
+                }
+                                
+                // Otherwise, ask the VFS what the physical URL is...
+                                
+                else {
+
+                    URLConnection connection = url.openConnection();
+                    Object jBossVirtualFile = connection.getContent();
+                    // Use reflection so that we don't need JBoss in the classpath at compile time.
+                    File physicalFile = (File) invokerGetter(jBossVirtualFile, "getPhysicalFile");
+                    URL physicalFileURL = physicalFile.toURI().toURL();
+                    return physicalFileURL;
+                }
+
+            }
+            catch (Exception e)
+            {
+                e.printStackTrace();
+            }
+        }
+
+        return url;
+    }
+
+    private Object invokerGetter(Object target, String getter) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException
+    {
+        Class<?> type = target.getClass();
+        Method method;
+        try
+        {
+            method = type.getMethod(getter);
+        }
+        catch (NoSuchMethodException e)
+        {
+            method = type.getDeclaredMethod(getter);
+            method.setAccessible(true);
+        }
+        return method.invoke(target);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db68d5b9/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/services/PojoModule.java
----------------------------------------------------------------------
diff --git a/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/services/PojoModule.java b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/services/PojoModule.java
new file mode 100755
index 0000000..f6c7056
--- /dev/null
+++ b/tapestry-cdi/src/test/java/org/apache/tapestry5/cdi/test/services/PojoModule.java
@@ -0,0 +1,32 @@
+/**
+ * Copyright 2013 GOT5
+ *
+ * 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.apache.tapestry5.cdi.test.services;
+
+
+import org.apache.tapestry5.cdi.CDIInjectModule;
+import org.apache.tapestry5.ioc.MappedConfiguration;
+import org.apache.tapestry5.ioc.annotations.SubModule;
+import org.apache.tapestry5.ioc.services.ClasspathURLConverter;
+
+@SubModule({
+    CDIInjectModule.class
+})
+public final class PojoModule {
+	public static void contributeServiceOverride(MappedConfiguration<Class,Object> configuration)
+	{
+		configuration.add(ClasspathURLConverter.class, new ClasspathURLConverterJBoss7Dot1());
+	}  
+}


Re: [1/3] TAP5-2260: Add support for CDI

Posted by Kalle Korhonen <ka...@gmail.com>.
Super!
On Dec 30, 2013 8:30 AM, "François Facon" <fr...@atos.net> wrote:

> Hi Kalle.
>
> I added the sources as zip JIRA, as you suggested.
>
> All contributors have signed the ICLA. I received an acknowledgment of
> receipt by the Secretary for the update on Corporate CLA and the software
> grant from Worldline.
>
> If no objection, I will committer this module next year.
>
>
> 2013/12/29 Kalle Korhonen <ka...@gmail.com>
>
> > Hey François, what happened to this effort?
> >
> > Kalle
> >
> >
> > On Tue, Dec 17, 2013 at 1:06 PM, Ulrich Stärk <ul...@spielviel.de> wrote:
> >
> > > In this case we need a software grant from Atos detailing the software
> > > they want to donate to us. The form for this can be found at
> > > http://www.apache.org/licenses/software-grant.txt
> > >
> > > Exhibit A should be a list of the source files covered by the grant
> > ('find
> > > . -type f' should be sufficient). This needs to be printed, signed, and
> > > emailed to secretary@apache.org or sent by fax.
> > >
> > > Contact me if you need further assistance.
> > >
> > > Cheers,
> > >
> > > Uli
> > >
> > > Am 2013-12-17 um 18:52 schrieb Facon François <
> > > Francois.Facon@worldline.com>:
> > >
> > > > I should have check this before.
> > > > Currently the copyright belong to Atos Worldline and we have already
> > > sign the Corporate CLA.
> > > > I am missing one ICLA.
> > > >
> > > > I am sorry for the delay.
> > > > François
> > > >
> > > > -----Message d'origine-----
> > > > De : Howard Lewis Ship [mailto:hlship@gmail.com]
> > > > Envoyé : mardi 17 décembre 2013 18:06
> > > > À : Tapestry development
> > > > Objet : Re: [1/3] TAP5-2260: Add support for CDI
> > > >
> > > > I think I will hold off one generating a beta-1 release until this is
> > > resolved.
> > > >
> > > >
> > > > On Fri, Dec 13, 2013 at 10:00 PM, François Facon <
> > > francois.facon@atos.net>wrote:
> > > >
> > > >> Thank you, Kalle, for the clarification.
> > > >> I will check this point.
> > > >>
> > > >> François
> > > >>
> > > >>
> > > >>
> > > >>
> > > >>
> > > >> 2013/12/13 Kalle Korhonen <ka...@gmail.com>
> > > >>
> > > >>> Actually best to use the JIRA. Even though you committed it, you
> > > >>> should probably zip up the source, attach it to the issue and leave
> > > >>> a comment explaining the origin, authors and that you are donating
> > > >>> the codebase to ASF.
> > > >>>
> > > >>> Kalle
> > > >>>
> > > >>>
> > > >>> On Fri, Dec 13, 2013 at 11:13 AM, Kalle Korhonen <
> > > >>> kalle.o.korhonen@gmail.com
> > > >>>> wrote:
> > > >>>
> > > >>>> François, you need to inform the rest of us who owns the
> > > >>>> copyrights to
> > > >>> the
> > > >>>> code. If you are the only author, then it's pretty simple. At
> > > >>>> least to
> > > >>> me,
> > > >>>> it suffices that you state so here and that you are donating this
> > > >>> codebase
> > > >>>> to Apache. If there are multiple authors, you need to obtain
> > > >>> authorization
> > > >>>> from each individual and it might be best to get this on paper
> (e.g.
> > > >>>> http://www.apache.org/licenses/software-grant.txt) and send it to
> > > ASF.
> > > >>>>
> > > >>>> Kalle
> > > >>>>
> > > >>>>
> > > >>>> On Fri, Dec 13, 2013 at 5:18 AM, François Facon <
> > > >> francois.facon@atos.net
> > > >>>> wrote:
> > > >>>>
> > > >>>>> Hello Uli,
> > > >>>>>
> > > >>>>> Got5 is link to my eMail.
> > > >>>>> This account as been created to share our contribution to
> > Tapestry5.
> > > >>>>> How can I give you a code grant for this module?
> > > >>>>>
> > > >>>>> Regards
> > > >>>>> François
> > > >>>>>
> > > >>>>>
> > > >>>>>
> > > >>>>>
> > > >>>>>
> > > >>>>>
> > > >>>>>
> > > >>>>>
> > > >>>>>
> > > >>>>>
> > > >>>>>
> > > >>>>>
> > > >>>>> 2013/12/13 Ulrich Stärk <ul...@spielviel.de>
> > > >>>>>
> > > >>>>>> Not only that.
> > > >>>>>>
> > > >>>>>> In light of the extent of the contribution we need to get a
> > > >>>>>> code
> > > >> grant
> > > >>>>>> from the current copyright holder.
> > > >>>>>>
> > > >>>>>> Until then I'm -1 on the code change.
> > > >>>>>>
> > > >>>>>> Uli
> > > >>>>>>
> > > >>>>>> Am 2013-12-13 um 12:10 schrieb Andreas Andreou
> > > >>>>>> <andreoua@gmail.com
> > > >>> :
> > > >>>>>>
> > > >>>>>>> I see some source files contain lines with "copyright GOT5"
> > > >>>>>>>
> > > >>>>>>> That needs to change, right?
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>
> > > >>
> ---------------------------------------------------------------------
> > > >>>>>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> > > >>>>>> For additional commands, e-mail: dev-help@tapestry.apache.org
> > > >>>>>>
> > > >>>>>>
> > > >>>>>
> > > >>>>
> > > >>>>
> > > >>>
> > > >>
> > > >
> > > >
> > > >
> > > > --
> > > > Howard M. Lewis Ship
> > > >
> > > > Creator of Apache Tapestry
> > > >
> > > > The source for Tapestry training, mentoring and support. Contact me
> to
> > > learn how I can get you up and productive in Tapestry fast!
> > > >
> > > > (971) 678-5210
> > > > http://howardlewisship.com
> > > >
> > > >
> > > > Ce message et les pièces jointes sont confidentiels et réservés à
> > > l'usage exclusif de ses destinataires. Il peut également être protégé
> par
> > > le secret professionnel. Si vous recevez ce message par erreur, merci
> > d'en
> > > avertir immédiatement l'expéditeur et de le détruire. L'intégrité du
> > > message ne pouvant être assurée sur Internet, la responsabilité de
> > > Worldline ne pourra être recherchée quant au contenu de ce message.
> Bien
> > > que les meilleurs efforts soient faits pour maintenir cette
> transmission
> > > exempte de tout virus, l'expéditeur ne donne aucune garantie à cet
> égard
> > et
> > > sa responsabilité ne saurait être recherchée pour tout dommage
> résultant
> > > d'un virus transmis.
> > > >
> > > > This e-mail and the documents attached are confidential and intended
> > > solely for the addressee; it may also be privileged. If you receive
> this
> > > e-mail in error, please notify the sender immediately and destroy it.
> As
> > > its integrity cannot be secured on the Internet, the Worldline
> liability
> > > cannot be triggered for the message content. Although the sender
> > endeavours
> > > to maintain a computer virus-free network, the sender does not warrant
> > that
> > > this transmission is virus-free and will not be liable for any damages
> > > resulting from any virus transmitted.
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> > > > For additional commands, e-mail: dev-help@tapestry.apache.org
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: dev-help@tapestry.apache.org
> > >
> > >
> >
>

Re: [1/3] TAP5-2260: Add support for CDI

Posted by François Facon <fr...@atos.net>.
Hi Kalle.

I added the sources as zip JIRA, as you suggested.

All contributors have signed the ICLA. I received an acknowledgment of
receipt by the Secretary for the update on Corporate CLA and the software
grant from Worldline.

If no objection, I will committer this module next year.


2013/12/29 Kalle Korhonen <ka...@gmail.com>

> Hey François, what happened to this effort?
>
> Kalle
>
>
> On Tue, Dec 17, 2013 at 1:06 PM, Ulrich Stärk <ul...@spielviel.de> wrote:
>
> > In this case we need a software grant from Atos detailing the software
> > they want to donate to us. The form for this can be found at
> > http://www.apache.org/licenses/software-grant.txt
> >
> > Exhibit A should be a list of the source files covered by the grant
> ('find
> > . -type f' should be sufficient). This needs to be printed, signed, and
> > emailed to secretary@apache.org or sent by fax.
> >
> > Contact me if you need further assistance.
> >
> > Cheers,
> >
> > Uli
> >
> > Am 2013-12-17 um 18:52 schrieb Facon François <
> > Francois.Facon@worldline.com>:
> >
> > > I should have check this before.
> > > Currently the copyright belong to Atos Worldline and we have already
> > sign the Corporate CLA.
> > > I am missing one ICLA.
> > >
> > > I am sorry for the delay.
> > > François
> > >
> > > -----Message d'origine-----
> > > De : Howard Lewis Ship [mailto:hlship@gmail.com]
> > > Envoyé : mardi 17 décembre 2013 18:06
> > > À : Tapestry development
> > > Objet : Re: [1/3] TAP5-2260: Add support for CDI
> > >
> > > I think I will hold off one generating a beta-1 release until this is
> > resolved.
> > >
> > >
> > > On Fri, Dec 13, 2013 at 10:00 PM, François Facon <
> > francois.facon@atos.net>wrote:
> > >
> > >> Thank you, Kalle, for the clarification.
> > >> I will check this point.
> > >>
> > >> François
> > >>
> > >>
> > >>
> > >>
> > >>
> > >> 2013/12/13 Kalle Korhonen <ka...@gmail.com>
> > >>
> > >>> Actually best to use the JIRA. Even though you committed it, you
> > >>> should probably zip up the source, attach it to the issue and leave
> > >>> a comment explaining the origin, authors and that you are donating
> > >>> the codebase to ASF.
> > >>>
> > >>> Kalle
> > >>>
> > >>>
> > >>> On Fri, Dec 13, 2013 at 11:13 AM, Kalle Korhonen <
> > >>> kalle.o.korhonen@gmail.com
> > >>>> wrote:
> > >>>
> > >>>> François, you need to inform the rest of us who owns the
> > >>>> copyrights to
> > >>> the
> > >>>> code. If you are the only author, then it's pretty simple. At
> > >>>> least to
> > >>> me,
> > >>>> it suffices that you state so here and that you are donating this
> > >>> codebase
> > >>>> to Apache. If there are multiple authors, you need to obtain
> > >>> authorization
> > >>>> from each individual and it might be best to get this on paper (e.g.
> > >>>> http://www.apache.org/licenses/software-grant.txt) and send it to
> > ASF.
> > >>>>
> > >>>> Kalle
> > >>>>
> > >>>>
> > >>>> On Fri, Dec 13, 2013 at 5:18 AM, François Facon <
> > >> francois.facon@atos.net
> > >>>> wrote:
> > >>>>
> > >>>>> Hello Uli,
> > >>>>>
> > >>>>> Got5 is link to my eMail.
> > >>>>> This account as been created to share our contribution to
> Tapestry5.
> > >>>>> How can I give you a code grant for this module?
> > >>>>>
> > >>>>> Regards
> > >>>>> François
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>> 2013/12/13 Ulrich Stärk <ul...@spielviel.de>
> > >>>>>
> > >>>>>> Not only that.
> > >>>>>>
> > >>>>>> In light of the extent of the contribution we need to get a
> > >>>>>> code
> > >> grant
> > >>>>>> from the current copyright holder.
> > >>>>>>
> > >>>>>> Until then I'm -1 on the code change.
> > >>>>>>
> > >>>>>> Uli
> > >>>>>>
> > >>>>>> Am 2013-12-13 um 12:10 schrieb Andreas Andreou
> > >>>>>> <andreoua@gmail.com
> > >>> :
> > >>>>>>
> > >>>>>>> I see some source files contain lines with "copyright GOT5"
> > >>>>>>>
> > >>>>>>> That needs to change, right?
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >> ---------------------------------------------------------------------
> > >>>>>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> > >>>>>> For additional commands, e-mail: dev-help@tapestry.apache.org
> > >>>>>>
> > >>>>>>
> > >>>>>
> > >>>>
> > >>>>
> > >>>
> > >>
> > >
> > >
> > >
> > > --
> > > Howard M. Lewis Ship
> > >
> > > Creator of Apache Tapestry
> > >
> > > The source for Tapestry training, mentoring and support. Contact me to
> > learn how I can get you up and productive in Tapestry fast!
> > >
> > > (971) 678-5210
> > > http://howardlewisship.com
> > >
> > >
> > > Ce message et les pièces jointes sont confidentiels et réservés à
> > l'usage exclusif de ses destinataires. Il peut également être protégé par
> > le secret professionnel. Si vous recevez ce message par erreur, merci
> d'en
> > avertir immédiatement l'expéditeur et de le détruire. L'intégrité du
> > message ne pouvant être assurée sur Internet, la responsabilité de
> > Worldline ne pourra être recherchée quant au contenu de ce message. Bien
> > que les meilleurs efforts soient faits pour maintenir cette transmission
> > exempte de tout virus, l'expéditeur ne donne aucune garantie à cet égard
> et
> > sa responsabilité ne saurait être recherchée pour tout dommage résultant
> > d'un virus transmis.
> > >
> > > This e-mail and the documents attached are confidential and intended
> > solely for the addressee; it may also be privileged. If you receive this
> > e-mail in error, please notify the sender immediately and destroy it. As
> > its integrity cannot be secured on the Internet, the Worldline liability
> > cannot be triggered for the message content. Although the sender
> endeavours
> > to maintain a computer virus-free network, the sender does not warrant
> that
> > this transmission is virus-free and will not be liable for any damages
> > resulting from any virus transmitted.
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: dev-help@tapestry.apache.org
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: dev-help@tapestry.apache.org
> >
> >
>

Re: [1/3] TAP5-2260: Add support for CDI

Posted by Kalle Korhonen <ka...@gmail.com>.
Hey François, what happened to this effort?

Kalle


On Tue, Dec 17, 2013 at 1:06 PM, Ulrich Stärk <ul...@spielviel.de> wrote:

> In this case we need a software grant from Atos detailing the software
> they want to donate to us. The form for this can be found at
> http://www.apache.org/licenses/software-grant.txt
>
> Exhibit A should be a list of the source files covered by the grant ('find
> . -type f' should be sufficient). This needs to be printed, signed, and
> emailed to secretary@apache.org or sent by fax.
>
> Contact me if you need further assistance.
>
> Cheers,
>
> Uli
>
> Am 2013-12-17 um 18:52 schrieb Facon François <
> Francois.Facon@worldline.com>:
>
> > I should have check this before.
> > Currently the copyright belong to Atos Worldline and we have already
> sign the Corporate CLA.
> > I am missing one ICLA.
> >
> > I am sorry for the delay.
> > François
> >
> > -----Message d'origine-----
> > De : Howard Lewis Ship [mailto:hlship@gmail.com]
> > Envoyé : mardi 17 décembre 2013 18:06
> > À : Tapestry development
> > Objet : Re: [1/3] TAP5-2260: Add support for CDI
> >
> > I think I will hold off one generating a beta-1 release until this is
> resolved.
> >
> >
> > On Fri, Dec 13, 2013 at 10:00 PM, François Facon <
> francois.facon@atos.net>wrote:
> >
> >> Thank you, Kalle, for the clarification.
> >> I will check this point.
> >>
> >> François
> >>
> >>
> >>
> >>
> >>
> >> 2013/12/13 Kalle Korhonen <ka...@gmail.com>
> >>
> >>> Actually best to use the JIRA. Even though you committed it, you
> >>> should probably zip up the source, attach it to the issue and leave
> >>> a comment explaining the origin, authors and that you are donating
> >>> the codebase to ASF.
> >>>
> >>> Kalle
> >>>
> >>>
> >>> On Fri, Dec 13, 2013 at 11:13 AM, Kalle Korhonen <
> >>> kalle.o.korhonen@gmail.com
> >>>> wrote:
> >>>
> >>>> François, you need to inform the rest of us who owns the
> >>>> copyrights to
> >>> the
> >>>> code. If you are the only author, then it's pretty simple. At
> >>>> least to
> >>> me,
> >>>> it suffices that you state so here and that you are donating this
> >>> codebase
> >>>> to Apache. If there are multiple authors, you need to obtain
> >>> authorization
> >>>> from each individual and it might be best to get this on paper (e.g.
> >>>> http://www.apache.org/licenses/software-grant.txt) and send it to
> ASF.
> >>>>
> >>>> Kalle
> >>>>
> >>>>
> >>>> On Fri, Dec 13, 2013 at 5:18 AM, François Facon <
> >> francois.facon@atos.net
> >>>> wrote:
> >>>>
> >>>>> Hello Uli,
> >>>>>
> >>>>> Got5 is link to my eMail.
> >>>>> This account as been created to share our contribution to Tapestry5.
> >>>>> How can I give you a code grant for this module?
> >>>>>
> >>>>> Regards
> >>>>> François
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>> 2013/12/13 Ulrich Stärk <ul...@spielviel.de>
> >>>>>
> >>>>>> Not only that.
> >>>>>>
> >>>>>> In light of the extent of the contribution we need to get a
> >>>>>> code
> >> grant
> >>>>>> from the current copyright holder.
> >>>>>>
> >>>>>> Until then I'm -1 on the code change.
> >>>>>>
> >>>>>> Uli
> >>>>>>
> >>>>>> Am 2013-12-13 um 12:10 schrieb Andreas Andreou
> >>>>>> <andreoua@gmail.com
> >>> :
> >>>>>>
> >>>>>>> I see some source files contain lines with "copyright GOT5"
> >>>>>>>
> >>>>>>> That needs to change, right?
> >>>>>>
> >>>>>>
> >>>>>>
> >> ---------------------------------------------------------------------
> >>>>>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> >>>>>> For additional commands, e-mail: dev-help@tapestry.apache.org
> >>>>>>
> >>>>>>
> >>>>>
> >>>>
> >>>>
> >>>
> >>
> >
> >
> >
> > --
> > Howard M. Lewis Ship
> >
> > Creator of Apache Tapestry
> >
> > The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
> >
> > (971) 678-5210
> > http://howardlewisship.com
> >
> >
> > Ce message et les pièces jointes sont confidentiels et réservés à
> l'usage exclusif de ses destinataires. Il peut également être protégé par
> le secret professionnel. Si vous recevez ce message par erreur, merci d'en
> avertir immédiatement l'expéditeur et de le détruire. L'intégrité du
> message ne pouvant être assurée sur Internet, la responsabilité de
> Worldline ne pourra être recherchée quant au contenu de ce message. Bien
> que les meilleurs efforts soient faits pour maintenir cette transmission
> exempte de tout virus, l'expéditeur ne donne aucune garantie à cet égard et
> sa responsabilité ne saurait être recherchée pour tout dommage résultant
> d'un virus transmis.
> >
> > This e-mail and the documents attached are confidential and intended
> solely for the addressee; it may also be privileged. If you receive this
> e-mail in error, please notify the sender immediately and destroy it. As
> its integrity cannot be secured on the Internet, the Worldline liability
> cannot be triggered for the message content. Although the sender endeavours
> to maintain a computer virus-free network, the sender does not warrant that
> this transmission is virus-free and will not be liable for any damages
> resulting from any virus transmitted.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: dev-help@tapestry.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>

Re: [1/3] TAP5-2260: Add support for CDI

Posted by Ulrich Stärk <ul...@spielviel.de>.
In this case we need a software grant from Atos detailing the software they want to donate to us. The form for this can be found at http://www.apache.org/licenses/software-grant.txt

Exhibit A should be a list of the source files covered by the grant ('find . -type f' should be sufficient). This needs to be printed, signed, and emailed to secretary@apache.org or sent by fax.

Contact me if you need further assistance.

Cheers,

Uli

Am 2013-12-17 um 18:52 schrieb Facon François <Fr...@worldline.com>:

> I should have check this before.
> Currently the copyright belong to Atos Worldline and we have already sign the Corporate CLA.
> I am missing one ICLA.
> 
> I am sorry for the delay.
> François
> 
> -----Message d'origine-----
> De : Howard Lewis Ship [mailto:hlship@gmail.com]
> Envoyé : mardi 17 décembre 2013 18:06
> À : Tapestry development
> Objet : Re: [1/3] TAP5-2260: Add support for CDI
> 
> I think I will hold off one generating a beta-1 release until this is resolved.
> 
> 
> On Fri, Dec 13, 2013 at 10:00 PM, François Facon <fr...@atos.net>wrote:
> 
>> Thank you, Kalle, for the clarification.
>> I will check this point.
>> 
>> François
>> 
>> 
>> 
>> 
>> 
>> 2013/12/13 Kalle Korhonen <ka...@gmail.com>
>> 
>>> Actually best to use the JIRA. Even though you committed it, you
>>> should probably zip up the source, attach it to the issue and leave
>>> a comment explaining the origin, authors and that you are donating
>>> the codebase to ASF.
>>> 
>>> Kalle
>>> 
>>> 
>>> On Fri, Dec 13, 2013 at 11:13 AM, Kalle Korhonen <
>>> kalle.o.korhonen@gmail.com
>>>> wrote:
>>> 
>>>> François, you need to inform the rest of us who owns the
>>>> copyrights to
>>> the
>>>> code. If you are the only author, then it's pretty simple. At
>>>> least to
>>> me,
>>>> it suffices that you state so here and that you are donating this
>>> codebase
>>>> to Apache. If there are multiple authors, you need to obtain
>>> authorization
>>>> from each individual and it might be best to get this on paper (e.g.
>>>> http://www.apache.org/licenses/software-grant.txt) and send it to ASF.
>>>> 
>>>> Kalle
>>>> 
>>>> 
>>>> On Fri, Dec 13, 2013 at 5:18 AM, François Facon <
>> francois.facon@atos.net
>>>> wrote:
>>>> 
>>>>> Hello Uli,
>>>>> 
>>>>> Got5 is link to my eMail.
>>>>> This account as been created to share our contribution to Tapestry5.
>>>>> How can I give you a code grant for this module?
>>>>> 
>>>>> Regards
>>>>> François
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 2013/12/13 Ulrich Stärk <ul...@spielviel.de>
>>>>> 
>>>>>> Not only that.
>>>>>> 
>>>>>> In light of the extent of the contribution we need to get a
>>>>>> code
>> grant
>>>>>> from the current copyright holder.
>>>>>> 
>>>>>> Until then I'm -1 on the code change.
>>>>>> 
>>>>>> Uli
>>>>>> 
>>>>>> Am 2013-12-13 um 12:10 schrieb Andreas Andreou
>>>>>> <andreoua@gmail.com
>>> :
>>>>>> 
>>>>>>> I see some source files contain lines with "copyright GOT5"
>>>>>>> 
>>>>>>> That needs to change, right?
>>>>>> 
>>>>>> 
>>>>>> 
>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
>>>>>> For additional commands, e-mail: dev-help@tapestry.apache.org
>>>>>> 
>>>>>> 
>>>>> 
>>>> 
>>>> 
>>> 
>> 
> 
> 
> 
> --
> Howard M. Lewis Ship
> 
> Creator of Apache Tapestry
> 
> The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast!
> 
> (971) 678-5210
> http://howardlewisship.com
> 
> 
> Ce message et les pièces jointes sont confidentiels et réservés à l'usage exclusif de ses destinataires. Il peut également être protégé par le secret professionnel. Si vous recevez ce message par erreur, merci d'en avertir immédiatement l'expéditeur et de le détruire. L'intégrité du message ne pouvant être assurée sur Internet, la responsabilité de Worldline ne pourra être recherchée quant au contenu de ce message. Bien que les meilleurs efforts soient faits pour maintenir cette transmission exempte de tout virus, l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne saurait être recherchée pour tout dommage résultant d'un virus transmis.
> 
> This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Worldline liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


RE: [1/3] TAP5-2260: Add support for CDI

Posted by Facon François <Fr...@worldline.com>.
I should have check this before.
Currently the copyright belong to Atos Worldline and we have already sign the Corporate CLA.
I am missing one ICLA.

I am sorry for the delay.
François

-----Message d'origine-----
De : Howard Lewis Ship [mailto:hlship@gmail.com]
Envoyé : mardi 17 décembre 2013 18:06
À : Tapestry development
Objet : Re: [1/3] TAP5-2260: Add support for CDI

I think I will hold off one generating a beta-1 release until this is resolved.


On Fri, Dec 13, 2013 at 10:00 PM, François Facon <fr...@atos.net>wrote:

> Thank you, Kalle, for the clarification.
> I will check this point.
>
> François
>
>
>
>
>
> 2013/12/13 Kalle Korhonen <ka...@gmail.com>
>
> > Actually best to use the JIRA. Even though you committed it, you
> > should probably zip up the source, attach it to the issue and leave
> > a comment explaining the origin, authors and that you are donating
> > the codebase to ASF.
> >
> > Kalle
> >
> >
> > On Fri, Dec 13, 2013 at 11:13 AM, Kalle Korhonen <
> > kalle.o.korhonen@gmail.com
> > > wrote:
> >
> > > François, you need to inform the rest of us who owns the
> > > copyrights to
> > the
> > > code. If you are the only author, then it's pretty simple. At
> > > least to
> > me,
> > > it suffices that you state so here and that you are donating this
> > codebase
> > > to Apache. If there are multiple authors, you need to obtain
> > authorization
> > > from each individual and it might be best to get this on paper (e.g.
> > > http://www.apache.org/licenses/software-grant.txt) and send it to ASF.
> > >
> > > Kalle
> > >
> > >
> > > On Fri, Dec 13, 2013 at 5:18 AM, François Facon <
> francois.facon@atos.net
> > >wrote:
> > >
> > >> Hello Uli,
> > >>
> > >> Got5 is link to my eMail.
> > >> This account as been created to share our contribution to Tapestry5.
> > >> How can I give you a code grant for this module?
> > >>
> > >> Regards
> > >> François
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >> 2013/12/13 Ulrich Stärk <ul...@spielviel.de>
> > >>
> > >> > Not only that.
> > >> >
> > >> > In light of the extent of the contribution we need to get a
> > >> > code
> grant
> > >> > from the current copyright holder.
> > >> >
> > >> > Until then I'm -1 on the code change.
> > >> >
> > >> > Uli
> > >> >
> > >> > Am 2013-12-13 um 12:10 schrieb Andreas Andreou
> > >> > <andreoua@gmail.com
> >:
> > >> >
> > >> > > I see some source files contain lines with "copyright GOT5"
> > >> > >
> > >> > > That needs to change, right?
> > >> >
> > >> >
> > >> >
> ---------------------------------------------------------------------
> > >> > To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> > >> > For additional commands, e-mail: dev-help@tapestry.apache.org
> > >> >
> > >> >
> > >>
> > >
> > >
> >
>



--
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com


Ce message et les pièces jointes sont confidentiels et réservés à l'usage exclusif de ses destinataires. Il peut également être protégé par le secret professionnel. Si vous recevez ce message par erreur, merci d'en avertir immédiatement l'expéditeur et de le détruire. L'intégrité du message ne pouvant être assurée sur Internet, la responsabilité de Worldline ne pourra être recherchée quant au contenu de ce message. Bien que les meilleurs efforts soient faits pour maintenir cette transmission exempte de tout virus, l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne saurait être recherchée pour tout dommage résultant d'un virus transmis.

This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Worldline liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Re: [1/3] TAP5-2260: Add support for CDI

Posted by Howard Lewis Ship <hl...@gmail.com>.
I think I will hold off one generating a beta-1 release until this is
resolved.


On Fri, Dec 13, 2013 at 10:00 PM, François Facon <fr...@atos.net>wrote:

> Thank you, Kalle, for the clarification.
> I will check this point.
>
> François
>
>
>
>
>
> 2013/12/13 Kalle Korhonen <ka...@gmail.com>
>
> > Actually best to use the JIRA. Even though you committed it, you should
> > probably zip up the source, attach it to the issue and leave a comment
> > explaining the origin, authors and that you are donating the codebase to
> > ASF.
> >
> > Kalle
> >
> >
> > On Fri, Dec 13, 2013 at 11:13 AM, Kalle Korhonen <
> > kalle.o.korhonen@gmail.com
> > > wrote:
> >
> > > François, you need to inform the rest of us who owns the copyrights to
> > the
> > > code. If you are the only author, then it's pretty simple. At least to
> > me,
> > > it suffices that you state so here and that you are donating this
> > codebase
> > > to Apache. If there are multiple authors, you need to obtain
> > authorization
> > > from each individual and it might be best to get this on paper (e.g.
> > > http://www.apache.org/licenses/software-grant.txt) and send it to ASF.
> > >
> > > Kalle
> > >
> > >
> > > On Fri, Dec 13, 2013 at 5:18 AM, François Facon <
> francois.facon@atos.net
> > >wrote:
> > >
> > >> Hello Uli,
> > >>
> > >> Got5 is link to my eMail.
> > >> This account as been created to share our contribution to Tapestry5.
> > >> How can I give you a code grant for this module?
> > >>
> > >> Regards
> > >> François
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >> 2013/12/13 Ulrich Stärk <ul...@spielviel.de>
> > >>
> > >> > Not only that.
> > >> >
> > >> > In light of the extent of the contribution we need to get a code
> grant
> > >> > from the current copyright holder.
> > >> >
> > >> > Until then I’m -1 on the code change.
> > >> >
> > >> > Uli
> > >> >
> > >> > Am 2013-12-13 um 12:10 schrieb Andreas Andreou <andreoua@gmail.com
> >:
> > >> >
> > >> > > I see some source files contain lines with
> > >> > > "copyright GOT5"
> > >> > >
> > >> > > That needs to change, right?
> > >> >
> > >> >
> > >> >
> ---------------------------------------------------------------------
> > >> > To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> > >> > For additional commands, e-mail: dev-help@tapestry.apache.org
> > >> >
> > >> >
> > >>
> > >
> > >
> >
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

Re: [1/3] TAP5-2260: Add support for CDI

Posted by François Facon <fr...@atos.net>.
Thank you, Kalle, for the clarification.
I will check this point.

François





2013/12/13 Kalle Korhonen <ka...@gmail.com>

> Actually best to use the JIRA. Even though you committed it, you should
> probably zip up the source, attach it to the issue and leave a comment
> explaining the origin, authors and that you are donating the codebase to
> ASF.
>
> Kalle
>
>
> On Fri, Dec 13, 2013 at 11:13 AM, Kalle Korhonen <
> kalle.o.korhonen@gmail.com
> > wrote:
>
> > François, you need to inform the rest of us who owns the copyrights to
> the
> > code. If you are the only author, then it's pretty simple. At least to
> me,
> > it suffices that you state so here and that you are donating this
> codebase
> > to Apache. If there are multiple authors, you need to obtain
> authorization
> > from each individual and it might be best to get this on paper (e.g.
> > http://www.apache.org/licenses/software-grant.txt) and send it to ASF.
> >
> > Kalle
> >
> >
> > On Fri, Dec 13, 2013 at 5:18 AM, François Facon <francois.facon@atos.net
> >wrote:
> >
> >> Hello Uli,
> >>
> >> Got5 is link to my eMail.
> >> This account as been created to share our contribution to Tapestry5.
> >> How can I give you a code grant for this module?
> >>
> >> Regards
> >> François
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> 2013/12/13 Ulrich Stärk <ul...@spielviel.de>
> >>
> >> > Not only that.
> >> >
> >> > In light of the extent of the contribution we need to get a code grant
> >> > from the current copyright holder.
> >> >
> >> > Until then I’m -1 on the code change.
> >> >
> >> > Uli
> >> >
> >> > Am 2013-12-13 um 12:10 schrieb Andreas Andreou <an...@gmail.com>:
> >> >
> >> > > I see some source files contain lines with
> >> > > "copyright GOT5"
> >> > >
> >> > > That needs to change, right?
> >> >
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> >> > For additional commands, e-mail: dev-help@tapestry.apache.org
> >> >
> >> >
> >>
> >
> >
>

Re: [1/3] TAP5-2260: Add support for CDI

Posted by Kalle Korhonen <ka...@gmail.com>.
Actually best to use the JIRA. Even though you committed it, you should
probably zip up the source, attach it to the issue and leave a comment
explaining the origin, authors and that you are donating the codebase to
ASF.

Kalle


On Fri, Dec 13, 2013 at 11:13 AM, Kalle Korhonen <kalle.o.korhonen@gmail.com
> wrote:

> François, you need to inform the rest of us who owns the copyrights to the
> code. If you are the only author, then it's pretty simple. At least to me,
> it suffices that you state so here and that you are donating this codebase
> to Apache. If there are multiple authors, you need to obtain authorization
> from each individual and it might be best to get this on paper (e.g.
> http://www.apache.org/licenses/software-grant.txt) and send it to ASF.
>
> Kalle
>
>
> On Fri, Dec 13, 2013 at 5:18 AM, François Facon <fr...@atos.net>wrote:
>
>> Hello Uli,
>>
>> Got5 is link to my eMail.
>> This account as been created to share our contribution to Tapestry5.
>> How can I give you a code grant for this module?
>>
>> Regards
>> François
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> 2013/12/13 Ulrich Stärk <ul...@spielviel.de>
>>
>> > Not only that.
>> >
>> > In light of the extent of the contribution we need to get a code grant
>> > from the current copyright holder.
>> >
>> > Until then I’m -1 on the code change.
>> >
>> > Uli
>> >
>> > Am 2013-12-13 um 12:10 schrieb Andreas Andreou <an...@gmail.com>:
>> >
>> > > I see some source files contain lines with
>> > > "copyright GOT5"
>> > >
>> > > That needs to change, right?
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
>> > For additional commands, e-mail: dev-help@tapestry.apache.org
>> >
>> >
>>
>
>

Re: [1/3] TAP5-2260: Add support for CDI

Posted by Kalle Korhonen <ka...@gmail.com>.
François, you need to inform the rest of us who owns the copyrights to the
code. If you are the only author, then it's pretty simple. At least to me,
it suffices that you state so here and that you are donating this codebase
to Apache. If there are multiple authors, you need to obtain authorization
from each individual and it might be best to get this on paper (e.g.
http://www.apache.org/licenses/software-grant.txt) and send it to ASF.

Kalle


On Fri, Dec 13, 2013 at 5:18 AM, François Facon <fr...@atos.net>wrote:

> Hello Uli,
>
> Got5 is link to my eMail.
> This account as been created to share our contribution to Tapestry5.
> How can I give you a code grant for this module?
>
> Regards
> François
>
>
>
>
>
>
>
>
>
>
>
>
> 2013/12/13 Ulrich Stärk <ul...@spielviel.de>
>
> > Not only that.
> >
> > In light of the extent of the contribution we need to get a code grant
> > from the current copyright holder.
> >
> > Until then I’m -1 on the code change.
> >
> > Uli
> >
> > Am 2013-12-13 um 12:10 schrieb Andreas Andreou <an...@gmail.com>:
> >
> > > I see some source files contain lines with
> > > "copyright GOT5"
> > >
> > > That needs to change, right?
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: dev-help@tapestry.apache.org
> >
> >
>

Re: [1/3] TAP5-2260: Add support for CDI

Posted by François Facon <fr...@atos.net>.
Hello Uli,

Got5 is link to my eMail.
This account as been created to share our contribution to Tapestry5.
How can I give you a code grant for this module?

Regards
François












2013/12/13 Ulrich Stärk <ul...@spielviel.de>

> Not only that.
>
> In light of the extent of the contribution we need to get a code grant
> from the current copyright holder.
>
> Until then I’m -1 on the code change.
>
> Uli
>
> Am 2013-12-13 um 12:10 schrieb Andreas Andreou <an...@gmail.com>:
>
> > I see some source files contain lines with
> > "copyright GOT5"
> >
> > That needs to change, right?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>

Re: [1/3] TAP5-2260: Add support for CDI

Posted by Ulrich Stärk <ul...@spielviel.de>.
Not only that.

In light of the extent of the contribution we need to get a code grant from the current copyright holder.

Until then I’m -1 on the code change.

Uli

Am 2013-12-13 um 12:10 schrieb Andreas Andreou <an...@gmail.com>:

> I see some source files contain lines with
> "copyright GOT5"
> 
> That needs to change, right?


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Re: [1/3] TAP5-2260: Add support for CDI

Posted by Andreas Andreou <an...@gmail.com>.
I see some source files contain lines with
"copyright GOT5"

That needs to change, right?