[seam-commits] Seam SVN: r12311 - in modules/faces/trunk/src: main/resources/META-INF and 2 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Mon Mar 29 12:26:08 EDT 2010


Author: lincolnthree
Date: 2010-03-29 12:26:07 -0400 (Mon, 29 Mar 2010)
New Revision: 12311

Added:
   modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/conversation/ConversationAnnotationExtension.java
Modified:
   modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/conversation/BeginConversationInterceptor.java
   modules/faces/trunk/src/main/resources/META-INF/beans.xml
   modules/faces/trunk/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
   modules/faces/trunk/src/test/resources/org/jboss/seam/faces/context/conversation/BeginConversationInterceptorTest-beans.xml
Log:


Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/conversation/BeginConversationInterceptor.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/conversation/BeginConversationInterceptor.java	2010-03-29 11:42:49 UTC (rev 12310)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/conversation/BeginConversationInterceptor.java	2010-03-29 16:26:07 UTC (rev 12311)
@@ -23,6 +23,8 @@
  */
 @Begin
 @Interceptor
+// TODO try having @Begin and @End extend @ConversationAnno.. to converge into a
+// single interceptor
 public class BeginConversationInterceptor implements Serializable
 {
    @Inject

Added: modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/conversation/ConversationAnnotationExtension.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/conversation/ConversationAnnotationExtension.java	                        (rev 0)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/conversation/ConversationAnnotationExtension.java	2010-03-29 16:26:07 UTC (rev 12311)
@@ -0,0 +1,34 @@
+/**
+ * 
+ */
+package org.jboss.seam.faces.context.conversation;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.BeforeBeanDiscovery;
+import javax.enterprise.inject.spi.Extension;
+
+import org.jboss.weld.manager.BeanManagerImpl;
+
+/**
+ * @author <a href="mailto:lincolnbaxter at gmail.com">Lincoln Baxter, III</a>
+ * 
+ */
+public class ConversationAnnotationExtension implements Extension
+{
+   public void beforeBeanDiscovery(@Observes final BeforeBeanDiscovery event, final BeanManager manager)
+   {
+      if (manager instanceof BeanManagerImpl)
+      {
+         BeanManagerImpl impl = (BeanManagerImpl) manager;
+
+         List<Class<?>> list = new ArrayList<Class<?>>();
+         list.addAll(impl.getEnabledInterceptorClasses());
+         list.add(BeginConversationInterceptor.class);
+         impl.setEnabledInterceptorClasses(list);
+      }
+   }
+}

Modified: modules/faces/trunk/src/main/resources/META-INF/beans.xml
===================================================================
--- modules/faces/trunk/src/main/resources/META-INF/beans.xml	2010-03-29 11:42:49 UTC (rev 12310)
+++ modules/faces/trunk/src/main/resources/META-INF/beans.xml	2010-03-29 16:26:07 UTC (rev 12311)
@@ -2,9 +2,5 @@
 	xsi:schemaLocation="
       http://java.sun.com/xml/ns/javaee
       http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
-
-	<interceptors>
-		<class>org.jboss.seam.faces.context.conversation.BeginConversationInterceptor</class>
-	</interceptors>
-
+	
 </beans>
\ No newline at end of file

Modified: modules/faces/trunk/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
===================================================================
--- modules/faces/trunk/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension	2010-03-29 11:42:49 UTC (rev 12310)
+++ modules/faces/trunk/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension	2010-03-29 16:26:07 UTC (rev 12311)
@@ -1,2 +1,3 @@
 org.jboss.seam.faces.context.ViewScopedExtension
-org.jboss.seam.faces.context.FlashScopedExtension
\ No newline at end of file
+org.jboss.seam.faces.context.FlashScopedExtension
+org.jboss.seam.faces.context.conversation.ConversationAnnotationExtension
\ No newline at end of file

Modified: modules/faces/trunk/src/test/resources/org/jboss/seam/faces/context/conversation/BeginConversationInterceptorTest-beans.xml
===================================================================
--- modules/faces/trunk/src/test/resources/org/jboss/seam/faces/context/conversation/BeginConversationInterceptorTest-beans.xml	2010-03-29 11:42:49 UTC (rev 12310)
+++ modules/faces/trunk/src/test/resources/org/jboss/seam/faces/context/conversation/BeginConversationInterceptorTest-beans.xml	2010-03-29 16:26:07 UTC (rev 12311)
@@ -3,8 +3,10 @@
       http://java.sun.com/xml/ns/javaee
       http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
 
+<!-- 
 	<interceptors>
 		<class>org.jboss.seam.faces.context.conversation.BeginConversationInterceptor</class>
 	</interceptors>
+ -->
 
 </beans>
\ No newline at end of file



More information about the seam-commits mailing list