Seam SVN: r12254 - modules/xml/trunk/core.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-03-23 18:21:04 -0400 (Tue, 23 Mar 2010)
New Revision: 12254
Modified:
modules/xml/trunk/core/pom.xml
Log:
changed scope of dependencies
Modified: modules/xml/trunk/core/pom.xml
===================================================================
--- modules/xml/trunk/core/pom.xml 2010-03-23 15:03:47 UTC (rev 12253)
+++ modules/xml/trunk/core/pom.xml 2010-03-23 22:21:04 UTC (rev 12254)
@@ -35,11 +35,13 @@
<artifactId>cdi-api</artifactId>
<version>1.0-SP1</version>
</dependency>
+
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core</artifactId>
<version>1.0.1-Final</version>
- </dependency>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>org.jboss.weld</groupId>
@@ -47,6 +49,7 @@
<version>1.0.1-Final</version>
<scope>test</scope>
</dependency>
+
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
14 years, 9 months
Seam SVN: r12253 - tags.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-03-23 11:03:47 -0400 (Tue, 23 Mar 2010)
New Revision: 12253
Added:
tags/JBPAPP_5_0_1-CR2/
Log:
tagged Seam for EAP 5.0.1.CR2
Copied: tags/JBPAPP_5_0_1-CR2 (from rev 12252, branches/enterprise/JBPAPP_5_0)
14 years, 9 months
Seam SVN: r12252 - branches/enterprise/JBPAPP_5_0/build.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-03-23 10:53:52 -0400 (Tue, 23 Mar 2010)
New Revision: 12252
Modified:
branches/enterprise/JBPAPP_5_0/build/root.pom.xml
Log:
downgraded commons-logging to 1.1.0.jboss - JBPAPP-3332
Modified: branches/enterprise/JBPAPP_5_0/build/root.pom.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/build/root.pom.xml 2010-03-23 12:59:30 UTC (rev 12251)
+++ branches/enterprise/JBPAPP_5_0/build/root.pom.xml 2010-03-23 14:53:52 UTC (rev 12252)
@@ -530,7 +530,7 @@
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
- <version>1.1.1</version>
+ <version>1.1.0.jboss</version>
</dependency>
<dependency>
14 years, 9 months
Seam SVN: r12251 - modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event.
by seam-commits@lists.jboss.org
Author: nickarls
Date: 2010-03-23 08:59:30 -0400 (Tue, 23 Mar 2010)
New Revision: 12251
Added:
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/ServletEventListener.java
Removed:
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/ServletListener.java
Log:
rename to match seam-faces conventions
Copied: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/ServletEventListener.java (from rev 12249, modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/ServletListener.java)
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/ServletEventListener.java (rev 0)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/ServletEventListener.java 2010-03-23 12:59:30 UTC (rev 12251)
@@ -0,0 +1,322 @@
+package org.jboss.seam.servlet.event;
+
+import java.io.IOException;
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.util.AnnotationLiteral;
+import javax.inject.Inject;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.servlet.AsyncEvent;
+import javax.servlet.AsyncListener;
+import javax.servlet.ServletContextAttributeEvent;
+import javax.servlet.ServletContextAttributeListener;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+import javax.servlet.ServletRequestAttributeEvent;
+import javax.servlet.ServletRequestAttributeListener;
+import javax.servlet.ServletRequestEvent;
+import javax.servlet.ServletRequestListener;
+import javax.servlet.annotation.WebListener;
+import javax.servlet.http.HttpSessionActivationListener;
+import javax.servlet.http.HttpSessionAttributeListener;
+import javax.servlet.http.HttpSessionBindingEvent;
+import javax.servlet.http.HttpSessionBindingListener;
+import javax.servlet.http.HttpSessionEvent;
+import javax.servlet.http.HttpSessionListener;
+
+import org.jboss.seam.servlet.event.qualifier.AttributeAdded;
+import org.jboss.seam.servlet.event.qualifier.AttributeRemoved;
+import org.jboss.seam.servlet.event.qualifier.AttributeReplaced;
+import org.jboss.seam.servlet.event.qualifier.Complete;
+import org.jboss.seam.servlet.event.qualifier.Created;
+import org.jboss.seam.servlet.event.qualifier.Destroyed;
+import org.jboss.seam.servlet.event.qualifier.DidActivate;
+import org.jboss.seam.servlet.event.qualifier.Error;
+import org.jboss.seam.servlet.event.qualifier.Initialized;
+import org.jboss.seam.servlet.event.qualifier.StartAsync;
+import org.jboss.seam.servlet.event.qualifier.Timeout;
+import org.jboss.seam.servlet.event.qualifier.ValueBound;
+import org.jboss.seam.servlet.event.qualifier.ValueUnbound;
+import org.jboss.seam.servlet.event.qualifier.WillPassivate;
+import org.slf4j.Logger;
+
+/**
+ * A self-registering web-listener that propagates the events to the current CDI
+ * Bean Manager event queue
+ *
+ * @author Nicklas Karlsson
+ *
+ */
+@WebListener
+public class ServletEventListener implements HttpSessionActivationListener, HttpSessionAttributeListener, HttpSessionBindingListener, HttpSessionListener, ServletContextListener, ServletContextAttributeListener, ServletRequestListener, ServletRequestAttributeListener, AsyncListener
+{
+ @Inject
+ private BeanManager beanManager;
+
+ @Inject
+ private Logger log;
+
+ // FIXME: hack to work around invalid binding in JBoss AS 6 M2
+ private static final List<String> beanManagerLocations = new ArrayList<String>()
+ {
+ private static final long serialVersionUID = 1L;
+ {
+ add("java:comp/BeanManager");
+ add("java:app/BeanManager");
+ }
+ };
+
+ public ServletEventListener()
+ {
+ if (beanManager == null)
+ {
+ beanManager = lookupBeanManager();
+ }
+ }
+
+ private BeanManager lookupBeanManager()
+ {
+ for (String location : beanManagerLocations)
+ {
+ try
+ {
+ log.trace("Looking for Bean Manager at JNDI location #0", location);
+ return (BeanManager) new InitialContext().lookup(location);
+ }
+ catch (NamingException e)
+ {
+ // No panic, keep trying
+ log.debug("Bean Manager not found at JNDI location #0", location);
+ }
+ }
+ // OK, panic
+ throw new IllegalArgumentException("Could not find BeanManager in " + beanManagerLocations);
+ }
+
+ private void fireEvent(Object payload, Annotation... qualifiers)
+ {
+ log.trace("Firing event #0 with qualifiers #1", payload, qualifiers);
+ beanManager.fireEvent(payload, qualifiers);
+ }
+
+ /**
+ * Session activated / passivated events
+ */
+
+ public void sessionDidActivate(HttpSessionEvent e)
+ {
+ fireEvent(e, new AnnotationLiteral<DidActivate>()
+ {
+ private static final long serialVersionUID = 1L;
+ });
+ }
+
+ public void sessionWillPassivate(HttpSessionEvent e)
+ {
+ fireEvent(e, new AnnotationLiteral<WillPassivate>()
+ {
+ private static final long serialVersionUID = 1L;
+ });
+ }
+
+ /**
+ * Session attribute events
+ */
+
+ public void attributeAdded(HttpSessionBindingEvent e)
+ {
+ fireEvent(e, new AnnotationLiteral<AttributeAdded>()
+ {
+ private static final long serialVersionUID = 1L;
+ });
+ }
+
+ public void attributeRemoved(HttpSessionBindingEvent e)
+ {
+ fireEvent(e, new AnnotationLiteral<AttributeRemoved>()
+ {
+ private static final long serialVersionUID = 1L;
+ });
+ }
+
+ public void attributeReplaced(HttpSessionBindingEvent e)
+ {
+ fireEvent(e, new AnnotationLiteral<AttributeReplaced>()
+ {
+ private static final long serialVersionUID = 1L;
+ });
+ }
+
+ public void valueBound(HttpSessionBindingEvent e)
+ {
+ fireEvent(e, new AnnotationLiteral<ValueBound>()
+ {
+ private static final long serialVersionUID = 1L;
+ });
+ }
+
+ public void valueUnbound(HttpSessionBindingEvent e)
+ {
+ fireEvent(e, new AnnotationLiteral<ValueUnbound>()
+ {
+ private static final long serialVersionUID = 1L;
+ });
+ }
+
+ /**
+ * Session created / destroyed events
+ */
+
+ public void sessionCreated(HttpSessionEvent e)
+ {
+ fireEvent(e, new AnnotationLiteral<Created>()
+ {
+ private static final long serialVersionUID = 1L;
+ });
+ }
+
+ public void sessionDestroyed(HttpSessionEvent e)
+ {
+ fireEvent(e, new AnnotationLiteral<Destroyed>()
+ {
+ private static final long serialVersionUID = 1L;
+ });
+ }
+
+ /**
+ * Servlet context initialized / destroyed events
+ */
+
+ public void contextDestroyed(ServletContextEvent e)
+ {
+ fireEvent(e, new AnnotationLiteral<Destroyed>()
+ {
+ private static final long serialVersionUID = 1L;
+ });
+ }
+
+ public void contextInitialized(ServletContextEvent e)
+ {
+ fireEvent(e, new AnnotationLiteral<Initialized>()
+ {
+ private static final long serialVersionUID = 1L;
+ });
+ }
+
+ /**
+ * Servlet context attribute events
+ */
+
+ public void attributeAdded(ServletContextAttributeEvent e)
+ {
+ fireEvent(e, new AnnotationLiteral<AttributeAdded>()
+ {
+ private static final long serialVersionUID = 1L;
+ });
+ }
+
+ public void attributeRemoved(ServletContextAttributeEvent e)
+ {
+ fireEvent(e, new AnnotationLiteral<AttributeRemoved>()
+ {
+ private static final long serialVersionUID = 1L;
+ });
+ }
+
+ public void attributeReplaced(ServletContextAttributeEvent e)
+ {
+ fireEvent(e, new AnnotationLiteral<AttributeReplaced>()
+ {
+ private static final long serialVersionUID = 1L;
+ });
+ }
+
+ /**
+ * Request created / destroyed events
+ */
+
+ public void requestDestroyed(ServletRequestEvent e)
+ {
+ fireEvent(e, new AnnotationLiteral<Destroyed>()
+ {
+ private static final long serialVersionUID = 1L;
+ });
+ }
+
+ public void requestInitialized(ServletRequestEvent e)
+ {
+ fireEvent(e, new AnnotationLiteral<Initialized>()
+ {
+ private static final long serialVersionUID = 1L;
+ });
+ }
+
+ /**
+ * Servlet request attribute events
+ */
+
+ public void attributeAdded(ServletRequestAttributeEvent e)
+ {
+ fireEvent(e, new AnnotationLiteral<AttributeAdded>()
+ {
+ private static final long serialVersionUID = 1L;
+ });
+ }
+
+ public void attributeRemoved(ServletRequestAttributeEvent e)
+ {
+ fireEvent(e, new AnnotationLiteral<AttributeRemoved>()
+ {
+ private static final long serialVersionUID = 1L;
+ });
+ }
+
+ public void attributeReplaced(ServletRequestAttributeEvent e)
+ {
+ fireEvent(e, new AnnotationLiteral<AttributeReplaced>()
+ {
+ private static final long serialVersionUID = 1L;
+ });
+ }
+
+ /**
+ * Asynchronous events
+ */
+
+ public void onComplete(AsyncEvent e) throws IOException
+ {
+ fireEvent(e, new AnnotationLiteral<Complete>()
+ {
+ private static final long serialVersionUID = 1L;
+ });
+ }
+
+ public void onError(AsyncEvent e) throws IOException
+ {
+ fireEvent(e, new AnnotationLiteral<Error>()
+ {
+ private static final long serialVersionUID = 1L;
+ });
+ }
+
+ public void onStartAsync(AsyncEvent e) throws IOException
+ {
+ fireEvent(e, new AnnotationLiteral<StartAsync>()
+ {
+ private static final long serialVersionUID = 1L;
+ });
+ }
+
+ public void onTimeout(AsyncEvent e) throws IOException
+ {
+ fireEvent(e, new AnnotationLiteral<Timeout>()
+ {
+ private static final long serialVersionUID = 1L;
+ });
+ }
+
+}
Deleted: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/ServletListener.java
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/ServletListener.java 2010-03-23 12:56:37 UTC (rev 12250)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/ServletListener.java 2010-03-23 12:59:30 UTC (rev 12251)
@@ -1,322 +0,0 @@
-package org.jboss.seam.servlet.event;
-
-import java.io.IOException;
-import java.lang.annotation.Annotation;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.enterprise.inject.spi.BeanManager;
-import javax.enterprise.util.AnnotationLiteral;
-import javax.inject.Inject;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.servlet.AsyncEvent;
-import javax.servlet.AsyncListener;
-import javax.servlet.ServletContextAttributeEvent;
-import javax.servlet.ServletContextAttributeListener;
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
-import javax.servlet.ServletRequestAttributeEvent;
-import javax.servlet.ServletRequestAttributeListener;
-import javax.servlet.ServletRequestEvent;
-import javax.servlet.ServletRequestListener;
-import javax.servlet.annotation.WebListener;
-import javax.servlet.http.HttpSessionActivationListener;
-import javax.servlet.http.HttpSessionAttributeListener;
-import javax.servlet.http.HttpSessionBindingEvent;
-import javax.servlet.http.HttpSessionBindingListener;
-import javax.servlet.http.HttpSessionEvent;
-import javax.servlet.http.HttpSessionListener;
-
-import org.jboss.seam.servlet.event.qualifier.AttributeAdded;
-import org.jboss.seam.servlet.event.qualifier.AttributeRemoved;
-import org.jboss.seam.servlet.event.qualifier.AttributeReplaced;
-import org.jboss.seam.servlet.event.qualifier.Complete;
-import org.jboss.seam.servlet.event.qualifier.Created;
-import org.jboss.seam.servlet.event.qualifier.Destroyed;
-import org.jboss.seam.servlet.event.qualifier.DidActivate;
-import org.jboss.seam.servlet.event.qualifier.Error;
-import org.jboss.seam.servlet.event.qualifier.Initialized;
-import org.jboss.seam.servlet.event.qualifier.StartAsync;
-import org.jboss.seam.servlet.event.qualifier.Timeout;
-import org.jboss.seam.servlet.event.qualifier.ValueBound;
-import org.jboss.seam.servlet.event.qualifier.ValueUnbound;
-import org.jboss.seam.servlet.event.qualifier.WillPassivate;
-import org.slf4j.Logger;
-
-/**
- * A self-registering web-listener that propagates the events to the current CDI
- * Bean Manager event queue
- *
- * @author Nicklas Karlsson
- *
- */
-@WebListener
-public class ServletListener implements HttpSessionActivationListener, HttpSessionAttributeListener, HttpSessionBindingListener, HttpSessionListener, ServletContextListener, ServletContextAttributeListener, ServletRequestListener, ServletRequestAttributeListener, AsyncListener
-{
- @Inject
- private BeanManager beanManager;
-
- @Inject
- private Logger log;
-
- // FIXME: hack to work around invalid binding in JBoss AS 6 M2
- private static final List<String> beanManagerLocations = new ArrayList<String>()
- {
- private static final long serialVersionUID = 1L;
- {
- add("java:comp/BeanManager");
- add("java:app/BeanManager");
- }
- };
-
- public ServletListener()
- {
- if (beanManager == null)
- {
- beanManager = lookupBeanManager();
- }
- }
-
- private BeanManager lookupBeanManager()
- {
- for (String location : beanManagerLocations)
- {
- try
- {
- log.trace("Looking for Bean Manager at JNDI location #0", location);
- return (BeanManager) new InitialContext().lookup(location);
- }
- catch (NamingException e)
- {
- // No panic, keep trying
- log.debug("Bean Manager not found at JNDI location #0", location);
- }
- }
- // OK, panic
- throw new IllegalArgumentException("Could not find BeanManager in " + beanManagerLocations);
- }
-
- private void fireEvent(Object payload, Annotation... qualifiers)
- {
- log.trace("Firing event #0 with qualifiers #1", payload, qualifiers);
- beanManager.fireEvent(payload, qualifiers);
- }
-
- /**
- * Session activated / passivated events
- */
-
- public void sessionDidActivate(HttpSessionEvent e)
- {
- fireEvent(e, new AnnotationLiteral<DidActivate>()
- {
- private static final long serialVersionUID = 1L;
- });
- }
-
- public void sessionWillPassivate(HttpSessionEvent e)
- {
- fireEvent(e, new AnnotationLiteral<WillPassivate>()
- {
- private static final long serialVersionUID = 1L;
- });
- }
-
- /**
- * Session attribute events
- */
-
- public void attributeAdded(HttpSessionBindingEvent e)
- {
- fireEvent(e, new AnnotationLiteral<AttributeAdded>()
- {
- private static final long serialVersionUID = 1L;
- });
- }
-
- public void attributeRemoved(HttpSessionBindingEvent e)
- {
- fireEvent(e, new AnnotationLiteral<AttributeRemoved>()
- {
- private static final long serialVersionUID = 1L;
- });
- }
-
- public void attributeReplaced(HttpSessionBindingEvent e)
- {
- fireEvent(e, new AnnotationLiteral<AttributeReplaced>()
- {
- private static final long serialVersionUID = 1L;
- });
- }
-
- public void valueBound(HttpSessionBindingEvent e)
- {
- fireEvent(e, new AnnotationLiteral<ValueBound>()
- {
- private static final long serialVersionUID = 1L;
- });
- }
-
- public void valueUnbound(HttpSessionBindingEvent e)
- {
- fireEvent(e, new AnnotationLiteral<ValueUnbound>()
- {
- private static final long serialVersionUID = 1L;
- });
- }
-
- /**
- * Session created / destroyed events
- */
-
- public void sessionCreated(HttpSessionEvent e)
- {
- fireEvent(e, new AnnotationLiteral<Created>()
- {
- private static final long serialVersionUID = 1L;
- });
- }
-
- public void sessionDestroyed(HttpSessionEvent e)
- {
- fireEvent(e, new AnnotationLiteral<Destroyed>()
- {
- private static final long serialVersionUID = 1L;
- });
- }
-
- /**
- * Servlet context initialized / destroyed events
- */
-
- public void contextDestroyed(ServletContextEvent e)
- {
- fireEvent(e, new AnnotationLiteral<Destroyed>()
- {
- private static final long serialVersionUID = 1L;
- });
- }
-
- public void contextInitialized(ServletContextEvent e)
- {
- fireEvent(e, new AnnotationLiteral<Initialized>()
- {
- private static final long serialVersionUID = 1L;
- });
- }
-
- /**
- * Servlet context attribute events
- */
-
- public void attributeAdded(ServletContextAttributeEvent e)
- {
- fireEvent(e, new AnnotationLiteral<AttributeAdded>()
- {
- private static final long serialVersionUID = 1L;
- });
- }
-
- public void attributeRemoved(ServletContextAttributeEvent e)
- {
- fireEvent(e, new AnnotationLiteral<AttributeRemoved>()
- {
- private static final long serialVersionUID = 1L;
- });
- }
-
- public void attributeReplaced(ServletContextAttributeEvent e)
- {
- fireEvent(e, new AnnotationLiteral<AttributeReplaced>()
- {
- private static final long serialVersionUID = 1L;
- });
- }
-
- /**
- * Request created / destroyed events
- */
-
- public void requestDestroyed(ServletRequestEvent e)
- {
- fireEvent(e, new AnnotationLiteral<Destroyed>()
- {
- private static final long serialVersionUID = 1L;
- });
- }
-
- public void requestInitialized(ServletRequestEvent e)
- {
- fireEvent(e, new AnnotationLiteral<Initialized>()
- {
- private static final long serialVersionUID = 1L;
- });
- }
-
- /**
- * Servlet request attribute events
- */
-
- public void attributeAdded(ServletRequestAttributeEvent e)
- {
- fireEvent(e, new AnnotationLiteral<AttributeAdded>()
- {
- private static final long serialVersionUID = 1L;
- });
- }
-
- public void attributeRemoved(ServletRequestAttributeEvent e)
- {
- fireEvent(e, new AnnotationLiteral<AttributeRemoved>()
- {
- private static final long serialVersionUID = 1L;
- });
- }
-
- public void attributeReplaced(ServletRequestAttributeEvent e)
- {
- fireEvent(e, new AnnotationLiteral<AttributeReplaced>()
- {
- private static final long serialVersionUID = 1L;
- });
- }
-
- /**
- * Asynchronous events
- */
-
- public void onComplete(AsyncEvent e) throws IOException
- {
- fireEvent(e, new AnnotationLiteral<Complete>()
- {
- private static final long serialVersionUID = 1L;
- });
- }
-
- public void onError(AsyncEvent e) throws IOException
- {
- fireEvent(e, new AnnotationLiteral<Error>()
- {
- private static final long serialVersionUID = 1L;
- });
- }
-
- public void onStartAsync(AsyncEvent e) throws IOException
- {
- fireEvent(e, new AnnotationLiteral<StartAsync>()
- {
- private static final long serialVersionUID = 1L;
- });
- }
-
- public void onTimeout(AsyncEvent e) throws IOException
- {
- fireEvent(e, new AnnotationLiteral<Timeout>()
- {
- private static final long serialVersionUID = 1L;
- });
- }
-
-}
14 years, 9 months
Seam SVN: r12250 - in modules/servlet/trunk/src/main: resources and 1 other directories.
by seam-commits@lists.jboss.org
Author: nickarls
Date: 2010-03-23 08:56:37 -0400 (Tue, 23 Mar 2010)
New Revision: 12250
Added:
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/HttpParam.java
modules/servlet/trunk/src/main/resources/META-INF/
modules/servlet/trunk/src/main/resources/META-INF/beans.xml
Modified:
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/HttpManager.java
Log:
HttpManager + HttpParam concept testing
Modified: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/HttpManager.java
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/HttpManager.java 2010-03-23 09:10:17 UTC (rev 12249)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/HttpManager.java 2010-03-23 12:56:37 UTC (rev 12250)
@@ -1,8 +1,10 @@
package org.jboss.seam.servlet.event;
-import javax.enterprise.context.SessionScoped;
+import javax.enterprise.context.RequestScoped;
import javax.enterprise.event.Observes;
+import javax.enterprise.inject.Produces;
import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.InjectionPoint;
import javax.inject.Inject;
import javax.servlet.ServletContextAttributeEvent;
import javax.servlet.ServletRequestEvent;
@@ -24,16 +26,18 @@
* @author Nicklas Karlsson
*
*/
-@SessionScoped
+@RequestScoped
public class HttpManager
{
+ private static final long serialVersionUID = 5191073522575178427L;
+
private HttpSession session;
private HttpServletRequest request;
private BeanManager beanManager;
@Inject
private Logger log;
-
+
protected void requestInitialized(@Observes @Initialized ServletRequestEvent e)
{
log.trace("Servlet request initialized with event #0", e);
@@ -130,4 +134,11 @@
return beanManager;
}
+ @Produces
+ @HttpParam("")
+ String getParamValue(InjectionPoint ip)
+ {
+ return getRequest().getParameter(ip.getAnnotated().getAnnotation(HttpParam.class).value());
+ }
+
}
Added: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/HttpParam.java
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/HttpParam.java (rev 0)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/HttpParam.java 2010-03-23 12:56:37 UTC (rev 12250)
@@ -0,0 +1,27 @@
+package org.jboss.seam.servlet.event;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.Nonbinding;
+import javax.inject.Qualifier;
+
+/**
+ * Qualifies injection points that should have their values fetched from a HTTP request attribute
+ *
+ * @author Nicklas Karlsson
+ *
+ */
+@Qualifier
+@Retention(RUNTIME)
+@Target( { FIELD, PARAMETER, METHOD })
+public @interface HttpParam
+{
+ @Nonbinding
+ public String value();
+}
\ No newline at end of file
Added: modules/servlet/trunk/src/main/resources/META-INF/beans.xml
===================================================================
14 years, 9 months
Seam SVN: r12249 - modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event.
by seam-commits@lists.jboss.org
Author: nickarls
Date: 2010-03-23 05:10:17 -0400 (Tue, 23 Mar 2010)
New Revision: 12249
Modified:
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/HttpManager.java
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/ServletListener.java
Log:
some logging
Modified: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/HttpManager.java
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/HttpManager.java 2010-03-23 09:03:33 UTC (rev 12248)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/HttpManager.java 2010-03-23 09:10:17 UTC (rev 12249)
@@ -3,6 +3,7 @@
import javax.enterprise.context.SessionScoped;
import javax.enterprise.event.Observes;
import javax.enterprise.inject.spi.BeanManager;
+import javax.inject.Inject;
import javax.servlet.ServletContextAttributeEvent;
import javax.servlet.ServletRequestEvent;
import javax.servlet.http.HttpServletRequest;
@@ -15,6 +16,7 @@
import org.jboss.seam.servlet.event.qualifier.Created;
import org.jboss.seam.servlet.event.qualifier.Destroyed;
import org.jboss.seam.servlet.event.qualifier.Initialized;
+import org.slf4j.Logger;
/**
* A manager for acquiring HTTP artifacts
@@ -29,13 +31,18 @@
private HttpServletRequest request;
private BeanManager beanManager;
+ @Inject
+ private Logger log;
+
protected void requestInitialized(@Observes @Initialized ServletRequestEvent e)
{
+ log.trace("Servlet request initialized with event #0", e);
request = (HttpServletRequest) e.getServletRequest();
}
protected void requestDestroyed(@Observes @Destroyed ServletRequestEvent e)
{
+ log.trace("Servlet request destroyed with event #0", e);
request = null;
}
@@ -43,6 +50,7 @@
{
if (BeanManager.class.getName().equals(e.getName()))
{
+ log.trace("Bean manager set in servlet context with event #0", e);
beanManager = (BeanManager) e.getValue();
}
}
@@ -51,6 +59,7 @@
{
if (BeanManager.class.getName().equals(e.getName()))
{
+ log.trace("Bean manager replaced in servlet context with event #0", e);
beanManager = (BeanManager) e.getValue();
}
}
@@ -59,17 +68,20 @@
{
if (BeanManager.class.getName().equals(e.getName()))
{
+ log.trace("Bean manager removed from servlet context with event #0", e);
beanManager = null;
}
}
protected void sessionInitialized(@Observes @Created HttpSessionEvent e)
{
+ log.trace("HTTP session initalized with event #0", e);
session = e.getSession();
}
protected void sessionDestroyed(@Observes @Destroyed HttpSessionEvent e)
{
+ log.trace("HTTP session destroyed with event #0", e);
session = null;
}
Modified: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/ServletListener.java
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/ServletListener.java 2010-03-23 09:03:33 UTC (rev 12248)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/ServletListener.java 2010-03-23 09:10:17 UTC (rev 12249)
@@ -42,6 +42,7 @@
import org.jboss.seam.servlet.event.qualifier.ValueBound;
import org.jboss.seam.servlet.event.qualifier.ValueUnbound;
import org.jboss.seam.servlet.event.qualifier.WillPassivate;
+import org.slf4j.Logger;
/**
* A self-registering web-listener that propagates the events to the current CDI
@@ -55,6 +56,9 @@
{
@Inject
private BeanManager beanManager;
+
+ @Inject
+ private Logger log;
// FIXME: hack to work around invalid binding in JBoss AS 6 M2
private static final List<String> beanManagerLocations = new ArrayList<String>()
@@ -80,11 +84,13 @@
{
try
{
+ log.trace("Looking for Bean Manager at JNDI location #0", location);
return (BeanManager) new InitialContext().lookup(location);
}
catch (NamingException e)
{
// No panic, keep trying
+ log.debug("Bean Manager not found at JNDI location #0", location);
}
}
// OK, panic
@@ -93,7 +99,7 @@
private void fireEvent(Object payload, Annotation... qualifiers)
{
- System.out.println("Fired event " + payload + " with " + qualifiers);
+ log.trace("Firing event #0 with qualifiers #1", payload, qualifiers);
beanManager.fireEvent(payload, qualifiers);
}
@@ -133,10 +139,6 @@
{
fireEvent(e, new AnnotationLiteral<AttributeRemoved>()
{
-
- /**
- *
- */
private static final long serialVersionUID = 1L;
});
}
14 years, 9 months
Seam SVN: r12248 - in modules: servlet/trunk/src/main/java/org/jboss/seam/servlet/event and 1 other directories.
by seam-commits@lists.jboss.org
Author: nickarls
Date: 2010-03-23 05:03:33 -0400 (Tue, 23 Mar 2010)
New Revision: 12248
Modified:
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/After.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/AnyPhase.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/ApplyRequestValues.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/Before.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/ComponentSystemEvent.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/ExceptionQueuedEvent.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/InvokeApplication.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/PostConstructApplicationEvent.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/PostConstructCustomScopeEvent.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/PreDestroyApplicationEvent.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/PreDestroyCustomScopeEvent.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/ProcessValidations.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/RenderResponse.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/RestoreView.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/UpdateModelValues.java
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/ServletListener.java
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/AttributeRemoved.java
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/AttributeReplaced.java
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Created.java
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Destroyed.java
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/DidActivate.java
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Error.java
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/StartAsync.java
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Timeout.java
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/ValueBound.java
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/ValueUnbound.java
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/WillPassivate.java
Log:
Minor WS fixes from Seam 3 formatter profile
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/After.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/After.java 2010-03-23 08:54:49 UTC (rev 12247)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/After.java 2010-03-23 09:03:33 UTC (rev 12248)
@@ -11,11 +11,13 @@
/**
* Qualifies observer method parameters to select events that occur in a "after"
- * phase in the JSF lifecycle
+ * phase in the JSF lifecycle
*
* @author Nicklas Karlsson
*/
@Qualifier
-@Target({FIELD, PARAMETER})
+@Target( { FIELD, PARAMETER })
@Retention(RUNTIME)
-public @interface After {}
\ No newline at end of file
+public @interface After
+{
+}
\ No newline at end of file
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/AnyPhase.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/AnyPhase.java 2010-03-23 08:54:49 UTC (rev 12247)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/AnyPhase.java 2010-03-23 09:03:33 UTC (rev 12248)
@@ -11,7 +11,7 @@
/**
* Qualifies observer method parameters to select events that occur in a any
- * phase in the JSF lifecycle
+ * phase in the JSF lifecycle
*
* @author <a href="mailto:lincolnbaxter@gmail.com>Lincoln Baxter, III</a>
*/
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/ApplyRequestValues.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/ApplyRequestValues.java 2010-03-23 08:54:49 UTC (rev 12247)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/ApplyRequestValues.java 2010-03-23 09:03:33 UTC (rev 12248)
@@ -11,14 +11,17 @@
import javax.inject.Qualifier;
/**
- * Qualifies observer method parameters to select events in one of the "apply request values"
- * phase in the JSF lifecycle. The selection can further be refined by combining it with the
- * qualifiers {@link @Before} or {@link @After}. The event parameter is a {@link PhaseEvent}.
+ * Qualifies observer method parameters to select events in one of the
+ * "apply request values" phase in the JSF lifecycle. The selection can further
+ * be refined by combining it with the qualifiers {@link @Before} or {@link
+ * @After}. The event parameter is a {@link PhaseEvent}.
*
* @author Nicklas Karlsson
* @see javax.faces.event.PhaseEvent
*/
@Qualifier
-@Target({FIELD, PARAMETER})
+@Target( { FIELD, PARAMETER })
@Retention(RUNTIME)
-public @interface ApplyRequestValues {}
\ No newline at end of file
+public @interface ApplyRequestValues
+{
+}
\ No newline at end of file
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/Before.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/Before.java 2010-03-23 08:54:49 UTC (rev 12247)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/Before.java 2010-03-23 09:03:33 UTC (rev 12248)
@@ -10,12 +10,14 @@
import javax.inject.Qualifier;
/**
- * Qualifies observer method parameters to select events that occur in a "before"
- * phase in the JSF lifecycle
+ * Qualifies observer method parameters to select events that occur in a
+ * "before" phase in the JSF lifecycle
*
* @author Nicklas Karlsson
*/
@Qualifier
-@Target({FIELD, PARAMETER})
+@Target( { FIELD, PARAMETER })
@Retention(RUNTIME)
-public @interface Before {}
\ No newline at end of file
+public @interface Before
+{
+}
\ No newline at end of file
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/ComponentSystemEvent.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/ComponentSystemEvent.java 2010-03-23 08:54:49 UTC (rev 12247)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/ComponentSystemEvent.java 2010-03-23 09:03:33 UTC (rev 12248)
@@ -11,11 +11,14 @@
/**
* Qualifies observer method parameters to select JSF component system events
- * The event parameter is a {@link javax.faces.event.ComponentSystemEvent.ComponentSystemEvent}.
+ * The event parameter is a
+ * {@link javax.faces.event.ComponentSystemEvent.ComponentSystemEvent}.
*
* @author Nicklas Karlsson
*/
@Qualifier
-@Target({FIELD, PARAMETER})
+@Target( { FIELD, PARAMETER })
@Retention(RUNTIME)
-public @interface ComponentSystemEvent {}
\ No newline at end of file
+public @interface ComponentSystemEvent
+{
+}
\ No newline at end of file
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/ExceptionQueuedEvent.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/ExceptionQueuedEvent.java 2010-03-23 08:54:49 UTC (rev 12247)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/ExceptionQueuedEvent.java 2010-03-23 09:03:33 UTC (rev 12248)
@@ -16,6 +16,8 @@
* @author Nicklas Karlsson
*/
@Qualifier
-@Target({FIELD, PARAMETER})
+@Target( { FIELD, PARAMETER })
@Retention(RUNTIME)
-public @interface ExceptionQueuedEvent {}
\ No newline at end of file
+public @interface ExceptionQueuedEvent
+{
+}
\ No newline at end of file
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/InvokeApplication.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/InvokeApplication.java 2010-03-23 08:54:49 UTC (rev 12247)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/InvokeApplication.java 2010-03-23 09:03:33 UTC (rev 12248)
@@ -11,13 +11,16 @@
import javax.inject.Qualifier;
/**
- * Qualifies observer method parameters to select events in one of the "invoke application"
- * phase in the JSF lifecycle. The selection can further be refined by combining it with the
- * qualifiers {@link @Before} or {@link @After}. The event parameter is a {@link PhaseEvent}.
+ * Qualifies observer method parameters to select events in one of the
+ * "invoke application" phase in the JSF lifecycle. The selection can further be
+ * refined by combining it with the qualifiers {@link @Before} or {@link @After}
+ * . The event parameter is a {@link PhaseEvent}.
*
* @author Nicklas Karlsson
*/
@Qualifier
-@Target({FIELD, PARAMETER})
+@Target( { FIELD, PARAMETER })
@Retention(RUNTIME)
-public @interface InvokeApplication {}
\ No newline at end of file
+public @interface InvokeApplication
+{
+}
\ No newline at end of file
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/PostConstructApplicationEvent.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/PostConstructApplicationEvent.java 2010-03-23 08:54:49 UTC (rev 12247)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/PostConstructApplicationEvent.java 2010-03-23 09:03:33 UTC (rev 12248)
@@ -10,12 +10,15 @@
import javax.inject.Qualifier;
/**
- * Qualifies observer method parameters to select JSF post-construct application events
- * The event parameter is a {@link javax.faces.event.PostConstructApplicationEvent}.
+ * Qualifies observer method parameters to select JSF post-construct application
+ * events The event parameter is a
+ * {@link javax.faces.event.PostConstructApplicationEvent}.
*
* @author Nicklas Karlsson
*/
@Qualifier
-@Target({FIELD, PARAMETER})
+@Target( { FIELD, PARAMETER })
@Retention(RUNTIME)
-public @interface PostConstructApplicationEvent {}
\ No newline at end of file
+public @interface PostConstructApplicationEvent
+{
+}
\ No newline at end of file
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/PostConstructCustomScopeEvent.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/PostConstructCustomScopeEvent.java 2010-03-23 08:54:49 UTC (rev 12247)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/PostConstructCustomScopeEvent.java 2010-03-23 09:03:33 UTC (rev 12248)
@@ -10,12 +10,15 @@
import javax.inject.Qualifier;
/**
- * Qualifies observer method parameters to select JSF post-construct custom scope events
- * The event parameter is a {@link javax.faces.event.javax.faces.event.PostConstructCustomScopeEvent}.
+ * Qualifies observer method parameters to select JSF post-construct custom
+ * scope events The event parameter is a
+ * {@link javax.faces.event.javax.faces.event.PostConstructCustomScopeEvent}.
*
* @author Nicklas Karlsson
*/
@Qualifier
-@Target({FIELD, PARAMETER})
+@Target( { FIELD, PARAMETER })
@Retention(RUNTIME)
-public @interface PostConstructCustomScopeEvent {}
\ No newline at end of file
+public @interface PostConstructCustomScopeEvent
+{
+}
\ No newline at end of file
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/PreDestroyApplicationEvent.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/PreDestroyApplicationEvent.java 2010-03-23 08:54:49 UTC (rev 12247)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/PreDestroyApplicationEvent.java 2010-03-23 09:03:33 UTC (rev 12248)
@@ -10,12 +10,15 @@
import javax.inject.Qualifier;
/**
- * Qualifies observer method parameters to select JSF pre-destroy application events
- * The event parameter is a {@link javax.faces.event.javax.faces.event.PreDestroyApplicationEvent}.
+ * Qualifies observer method parameters to select JSF pre-destroy application
+ * events The event parameter is a
+ * {@link javax.faces.event.javax.faces.event.PreDestroyApplicationEvent}.
*
* @author Nicklas Karlsson
*/
@Qualifier
-@Target({FIELD, PARAMETER})
+@Target( { FIELD, PARAMETER })
@Retention(RUNTIME)
-public @interface PreDestroyApplicationEvent {}
\ No newline at end of file
+public @interface PreDestroyApplicationEvent
+{
+}
\ No newline at end of file
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/PreDestroyCustomScopeEvent.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/PreDestroyCustomScopeEvent.java 2010-03-23 08:54:49 UTC (rev 12247)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/PreDestroyCustomScopeEvent.java 2010-03-23 09:03:33 UTC (rev 12248)
@@ -10,12 +10,15 @@
import javax.inject.Qualifier;
/**
- * Qualifies observer method parameters to select JSF pre-destroy custom scope events
- * The event parameter is a {@link javax.faces.event.javax.faces.event.PreDestroyCustomScopeEvent}.
+ * Qualifies observer method parameters to select JSF pre-destroy custom scope
+ * events The event parameter is a
+ * {@link javax.faces.event.javax.faces.event.PreDestroyCustomScopeEvent}.
*
* @author Nicklas Karlsson
*/
@Qualifier
-@Target({FIELD, PARAMETER})
+@Target( { FIELD, PARAMETER })
@Retention(RUNTIME)
-public @interface PreDestroyCustomScopeEvent {}
\ No newline at end of file
+public @interface PreDestroyCustomScopeEvent
+{
+}
\ No newline at end of file
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/ProcessValidations.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/ProcessValidations.java 2010-03-23 08:54:49 UTC (rev 12247)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/ProcessValidations.java 2010-03-23 09:03:33 UTC (rev 12248)
@@ -11,13 +11,16 @@
import javax.inject.Qualifier;
/**
- * Qualifies observer method parameters to select events in one of the "process validations"
- * phase in the JSF lifecycle. The selection can further be refined by combining it with the
- * qualifiers {@link @Before} or {@link @After}. The event parameter is a {@link PhaseEvent}.
+ * Qualifies observer method parameters to select events in one of the
+ * "process validations" phase in the JSF lifecycle. The selection can further
+ * be refined by combining it with the qualifiers {@link @Before} or {@link
+ * @After}. The event parameter is a {@link PhaseEvent}.
*
* @author Nicklas Karlsson
*/
@Qualifier
-@Target({FIELD, PARAMETER})
+@Target( { FIELD, PARAMETER })
@Retention(RUNTIME)
-public @interface ProcessValidations {}
\ No newline at end of file
+public @interface ProcessValidations
+{
+}
\ No newline at end of file
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/RenderResponse.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/RenderResponse.java 2010-03-23 08:54:49 UTC (rev 12247)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/RenderResponse.java 2010-03-23 09:03:33 UTC (rev 12248)
@@ -11,13 +11,16 @@
import javax.inject.Qualifier;
/**
- * Qualifies observer method parameters to select events in one of the "render response"
- * phase in the JSF lifecycle. The selection can further be refined by combining it with the
- * qualifiers {@link @Before} or {@link @After}. The event parameter is a {@link PhaseEvent}.
+ * Qualifies observer method parameters to select events in one of the
+ * "render response" phase in the JSF lifecycle. The selection can further be
+ * refined by combining it with the qualifiers {@link @Before} or {@link @After}
+ * . The event parameter is a {@link PhaseEvent}.
*
* @author Nicklas Karlsson
*/
@Qualifier
-@Target({FIELD, PARAMETER})
+@Target( { FIELD, PARAMETER })
@Retention(RUNTIME)
-public @interface RenderResponse {}
\ No newline at end of file
+public @interface RenderResponse
+{
+}
\ No newline at end of file
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/RestoreView.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/RestoreView.java 2010-03-23 08:54:49 UTC (rev 12247)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/RestoreView.java 2010-03-23 09:03:33 UTC (rev 12248)
@@ -11,13 +11,16 @@
import javax.inject.Qualifier;
/**
- * Qualifies observer method parameters to select events in one of the "restore view"
- * phase in the JSF lifecycle. The selection can further be refined by combining it with the
- * qualifiers {@link @Before} or {@link @After}. The event parameter is a {@link PhaseEvent}.
+ * Qualifies observer method parameters to select events in one of the
+ * "restore view" phase in the JSF lifecycle. The selection can further be
+ * refined by combining it with the qualifiers {@link @Before} or {@link @After}
+ * . The event parameter is a {@link PhaseEvent}.
*
* @author Nicklas Karlsson
*/
@Qualifier
-@Target({FIELD, PARAMETER})
+@Target( { FIELD, PARAMETER })
@Retention(RUNTIME)
-public @interface RestoreView {}
\ No newline at end of file
+public @interface RestoreView
+{
+}
\ No newline at end of file
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/UpdateModelValues.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/UpdateModelValues.java 2010-03-23 08:54:49 UTC (rev 12247)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/UpdateModelValues.java 2010-03-23 09:03:33 UTC (rev 12248)
@@ -11,13 +11,16 @@
import javax.inject.Qualifier;
/**
- * Qualifies observer method parameters to select events in one of the "update model values"
- * phase in the JSF lifecycle. The selection can further be refined by combining it with the
- * qualifiers {@link @Before} or {@link @After}. The event parameter is a {@link PhaseEvent}.
+ * Qualifies observer method parameters to select events in one of the
+ * "update model values" phase in the JSF lifecycle. The selection can further
+ * be refined by combining it with the qualifiers {@link @Before} or {@link
+ * @After}. The event parameter is a {@link PhaseEvent}.
*
* @author Nicklas Karlsson
*/
@Qualifier
-@Target({FIELD, PARAMETER})
+@Target( { FIELD, PARAMETER })
@Retention(RUNTIME)
-public @interface UpdateModelValues {}
\ No newline at end of file
+public @interface UpdateModelValues
+{
+}
\ No newline at end of file
Modified: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/ServletListener.java
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/ServletListener.java 2010-03-23 08:54:49 UTC (rev 12247)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/ServletListener.java 2010-03-23 09:03:33 UTC (rev 12248)
@@ -44,10 +44,11 @@
import org.jboss.seam.servlet.event.qualifier.WillPassivate;
/**
- * A self-registering web-listener that propagates the events to the current CDI Bean Manager event queue
+ * A self-registering web-listener that propagates the events to the current CDI
+ * Bean Manager event queue
*
* @author Nicklas Karlsson
- *
+ *
*/
@WebListener
public class ServletListener implements HttpSessionActivationListener, HttpSessionAttributeListener, HttpSessionBindingListener, HttpSessionListener, ServletContextListener, ServletContextAttributeListener, ServletRequestListener, ServletRequestAttributeListener, AsyncListener
Modified: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/AttributeRemoved.java
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/AttributeRemoved.java 2010-03-23 08:54:49 UTC (rev 12247)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/AttributeRemoved.java 2010-03-23 09:03:33 UTC (rev 12248)
@@ -22,6 +22,8 @@
* @author Nicklas Karlsson
*/
@Qualifier
-@Target({FIELD, PARAMETER})
+@Target( { FIELD, PARAMETER })
@Retention(RUNTIME)
-public @interface AttributeRemoved {}
\ No newline at end of file
+public @interface AttributeRemoved
+{
+}
\ No newline at end of file
Modified: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/AttributeReplaced.java
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/AttributeReplaced.java 2010-03-23 08:54:49 UTC (rev 12247)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/AttributeReplaced.java 2010-03-23 09:03:33 UTC (rev 12248)
@@ -22,6 +22,8 @@
* @author Nicklas Karlsson
*/
@Qualifier
-@Target({FIELD, PARAMETER})
+@Target( { FIELD, PARAMETER })
@Retention(RUNTIME)
-public @interface AttributeReplaced {}
\ No newline at end of file
+public @interface AttributeReplaced
+{
+}
\ No newline at end of file
Modified: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Created.java
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Created.java 2010-03-23 08:54:49 UTC (rev 12247)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Created.java 2010-03-23 09:03:33 UTC (rev 12248)
@@ -11,8 +11,8 @@
import javax.servlet.http.HttpSessionEvent;
/**
- * Qualifies observer method parameters to select events that fire when
- * HTTP sessions are created.
+ * Qualifies observer method parameters to select events that fire when HTTP
+ * sessions are created.
*
* The event parameter is an {@link HttpSessionEvent}
*
Modified: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Destroyed.java
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Destroyed.java 2010-03-23 08:54:49 UTC (rev 12247)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Destroyed.java 2010-03-23 09:03:33 UTC (rev 12248)
@@ -13,12 +13,11 @@
import javax.servlet.http.HttpSessionEvent;
/**
- * Qualifies observer method parameters to select events that fire when
- * HTTP artifacts are being destroyed.
+ * Qualifies observer method parameters to select events that fire when HTTP
+ * artifacts are being destroyed.
*
* The event parameter can be a {@link ServletContextEvent},
- * {@link ServletRequestEvent} or a
- * {@link HttpSessionEvent}.
+ * {@link ServletRequestEvent} or a {@link HttpSessionEvent}.
*
* @author Nicklas Karlsson
*/
Modified: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/DidActivate.java
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/DidActivate.java 2010-03-23 08:54:49 UTC (rev 12247)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/DidActivate.java 2010-03-23 09:03:33 UTC (rev 12248)
@@ -10,14 +10,16 @@
import javax.servlet.http.HttpSessionEvent;
/**
- * Qualifies observer method parameters to select events that fire when
- * HTTP sessions are activated.
+ * Qualifies observer method parameters to select events that fire when HTTP
+ * sessions are activated.
*
* The event parameter is an {@link HttpSessionEvent}
*
* @author Nicklas Karlsson
*/
@Qualifier
-@Target({FIELD, PARAMETER})
+@Target( { FIELD, PARAMETER })
@Retention(RUNTIME)
-public @interface DidActivate {}
\ No newline at end of file
+public @interface DidActivate
+{
+}
\ No newline at end of file
Modified: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Error.java
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Error.java 2010-03-23 08:54:49 UTC (rev 12247)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Error.java 2010-03-23 09:03:33 UTC (rev 12248)
@@ -19,6 +19,8 @@
* @author Nicklas Karlsson
*/
@Qualifier
-@Target({FIELD, PARAMETER})
+@Target( { FIELD, PARAMETER })
@Retention(RUNTIME)
-public @interface Error {}
\ No newline at end of file
+public @interface Error
+{
+}
\ No newline at end of file
Modified: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/StartAsync.java
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/StartAsync.java 2010-03-23 08:54:49 UTC (rev 12247)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/StartAsync.java 2010-03-23 09:03:33 UTC (rev 12248)
@@ -18,6 +18,8 @@
* @author Nicklas Karlsson
*/
@Qualifier
-@Target({FIELD, PARAMETER})
+@Target( { FIELD, PARAMETER })
@Retention(RUNTIME)
-public @interface StartAsync {}
\ No newline at end of file
+public @interface StartAsync
+{
+}
\ No newline at end of file
Modified: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Timeout.java
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Timeout.java 2010-03-23 08:54:49 UTC (rev 12247)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Timeout.java 2010-03-23 09:03:33 UTC (rev 12248)
@@ -18,6 +18,8 @@
* @author Nicklas Karlsson
*/
@Qualifier
-@Target({FIELD, PARAMETER})
+@Target( { FIELD, PARAMETER })
@Retention(RUNTIME)
-public @interface Timeout {}
\ No newline at end of file
+public @interface Timeout
+{
+}
\ No newline at end of file
Modified: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/ValueBound.java
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/ValueBound.java 2010-03-23 08:54:49 UTC (rev 12247)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/ValueBound.java 2010-03-23 09:03:33 UTC (rev 12248)
@@ -11,14 +11,16 @@
import javax.servlet.http.HttpSessionBindingEvent;
/**
- * Qualifies observer method parameters to select events that fire when
- * values are being bound to the HTTP session.
+ * Qualifies observer method parameters to select events that fire when values
+ * are being bound to the HTTP session.
*
* The event parameter is a {@link HttpSessionBindingEvent}
*
* @author Nicklas Karlsson
*/
@Qualifier
-@Target({FIELD, PARAMETER})
+@Target( { FIELD, PARAMETER })
@Retention(RUNTIME)
-public @interface ValueBound {}
\ No newline at end of file
+public @interface ValueBound
+{
+}
\ No newline at end of file
Modified: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/ValueUnbound.java
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/ValueUnbound.java 2010-03-23 08:54:49 UTC (rev 12247)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/ValueUnbound.java 2010-03-23 09:03:33 UTC (rev 12248)
@@ -10,14 +10,16 @@
import javax.servlet.http.HttpSessionBindingEvent;
/**
- * Qualifies observer method parameters to select events that fire when
- * values are being unbound from the HTTP session.
+ * Qualifies observer method parameters to select events that fire when values
+ * are being unbound from the HTTP session.
*
* The event parameter is a {@link HttpSessionBindingEvent}
*
* @author Nicklas Karlsson
*/
@Qualifier
-@Target({FIELD, PARAMETER})
+@Target( { FIELD, PARAMETER })
@Retention(RUNTIME)
-public @interface ValueUnbound {}
\ No newline at end of file
+public @interface ValueUnbound
+{
+}
\ No newline at end of file
Modified: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/WillPassivate.java
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/WillPassivate.java 2010-03-23 08:54:49 UTC (rev 12247)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/WillPassivate.java 2010-03-23 09:03:33 UTC (rev 12248)
@@ -10,14 +10,16 @@
import javax.servlet.http.HttpSessionEvent;
/**
- * Qualifies observer method parameters to select events that fire when
- * HTTP sessions are passivated.
+ * Qualifies observer method parameters to select events that fire when HTTP
+ * sessions are passivated.
*
* The event parameter is an {@link HttpSessionEvent}
*
* @author Nicklas Karlsson
*/
@Qualifier
-@Target({FIELD, PARAMETER})
+@Target( { FIELD, PARAMETER })
@Retention(RUNTIME)
-public @interface WillPassivate {}
\ No newline at end of file
+public @interface WillPassivate
+{
+}
\ No newline at end of file
14 years, 9 months
Seam SVN: r12247 - in modules/servlet/trunk/src: main/java/org/jboss/seam/servlet/event/qualifier and 1 other directories.
by seam-commits@lists.jboss.org
Author: nickarls
Date: 2010-03-23 04:54:49 -0400 (Tue, 23 Mar 2010)
New Revision: 12247
Removed:
modules/servlet/trunk/src/test/java/org/jboss/seam/faces/event/
Modified:
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/HttpManager.java
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/ServletListener.java
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/AttributeAdded.java
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/AttributeRemoved.java
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/AttributeReplaced.java
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Complete.java
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Created.java
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Destroyed.java
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/DidActivate.java
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Error.java
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Initialized.java
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/StartAsync.java
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Timeout.java
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/ValueBound.java
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/ValueUnbound.java
modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/WillPassivate.java
Log:
javadocs + comments
HttpManager tunings (under construction, no tests yet)
Modified: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/HttpManager.java
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/HttpManager.java 2010-03-23 07:59:23 UTC (rev 12246)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/HttpManager.java 2010-03-23 08:54:49 UTC (rev 12247)
@@ -1,40 +1,121 @@
package org.jboss.seam.servlet.event;
-import javax.enterprise.context.RequestScoped;
+import javax.enterprise.context.SessionScoped;
import javax.enterprise.event.Observes;
-import javax.servlet.ServletContext;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.servlet.ServletContextAttributeEvent;
import javax.servlet.ServletRequestEvent;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
+import javax.servlet.http.HttpSessionEvent;
+import org.jboss.seam.servlet.event.qualifier.AttributeAdded;
+import org.jboss.seam.servlet.event.qualifier.AttributeRemoved;
+import org.jboss.seam.servlet.event.qualifier.AttributeReplaced;
+import org.jboss.seam.servlet.event.qualifier.Created;
+import org.jboss.seam.servlet.event.qualifier.Destroyed;
import org.jboss.seam.servlet.event.qualifier.Initialized;
-@RequestScoped
+/**
+ * A manager for acquiring HTTP artifacts
+ *
+ * @author Nicklas Karlsson
+ *
+ */
+@SessionScoped
public class HttpManager
{
private HttpSession session;
private HttpServletRequest request;
- private ServletContext context;
+ private BeanManager beanManager;
- public void refresh(@Observes @Initialized ServletRequestEvent e)
+ protected void requestInitialized(@Observes @Initialized ServletRequestEvent e)
{
- this.request = (HttpServletRequest) e.getServletRequest();
- session = request.getSession();
- context = session.getServletContext();
+ request = (HttpServletRequest) e.getServletRequest();
}
+ protected void requestDestroyed(@Observes @Destroyed ServletRequestEvent e)
+ {
+ request = null;
+ }
+
+ protected void servletContextAttributeAdded(@Observes @AttributeAdded ServletContextAttributeEvent e)
+ {
+ if (BeanManager.class.getName().equals(e.getName()))
+ {
+ beanManager = (BeanManager) e.getValue();
+ }
+ }
+
+ protected void servletContextAttributeReplaced(@Observes @AttributeReplaced ServletContextAttributeEvent e)
+ {
+ if (BeanManager.class.getName().equals(e.getName()))
+ {
+ beanManager = (BeanManager) e.getValue();
+ }
+ }
+
+ protected void servletContextAttributeRemoved(@Observes @AttributeRemoved ServletContextAttributeEvent e)
+ {
+ if (BeanManager.class.getName().equals(e.getName()))
+ {
+ beanManager = null;
+ }
+ }
+
+ protected void sessionInitialized(@Observes @Created HttpSessionEvent e)
+ {
+ session = e.getSession();
+ }
+
+ protected void sessionDestroyed(@Observes @Destroyed HttpSessionEvent e)
+ {
+ session = null;
+ }
+
+ /**
+ * Returns the current HTTP session. Throws an {@link IllegalStateException}
+ * if the session is currently not set.
+ *
+ * @return The current HTTP session
+ */
public HttpSession getSession()
{
+ if (session == null)
+ {
+ throw new IllegalStateException("The HTTP session is currently not set");
+ }
return session;
}
+ /**
+ * Returns the current HTTP request. Throws an {@link IllegalStateException}
+ * if the request is currently not set.
+ *
+ * @return The current HTTP request
+ */
public HttpServletRequest getRequest()
{
+ if (request == null)
+ {
+ throw new IllegalStateException("The HTTP request is currently not set");
+ }
return request;
}
- public ServletContext getContext()
+ /**
+ * Returns the current CDI Bean Manager of the WAR. Throws an
+ * {@link IllegalStateException} if the manager is not set.
+ *
+ * @return The current HTTP request
+ */
+ public BeanManager getBeanManager()
{
- return context;
+ if (beanManager == null)
+ {
+ throw new IllegalStateException("The Bean Manager is currently not set");
+ }
+ return beanManager;
}
+
}
Modified: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/ServletListener.java
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/ServletListener.java 2010-03-23 07:59:23 UTC (rev 12246)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/ServletListener.java 2010-03-23 08:54:49 UTC (rev 12247)
@@ -43,7 +43,12 @@
import org.jboss.seam.servlet.event.qualifier.ValueUnbound;
import org.jboss.seam.servlet.event.qualifier.WillPassivate;
-@SuppressWarnings("serial")
+/**
+ * A self-registering web-listener that propagates the events to the current CDI Bean Manager event queue
+ *
+ * @author Nicklas Karlsson
+ *
+ */
@WebListener
public class ServletListener implements HttpSessionActivationListener, HttpSessionAttributeListener, HttpSessionBindingListener, HttpSessionListener, ServletContextListener, ServletContextAttributeListener, ServletRequestListener, ServletRequestAttributeListener, AsyncListener
{
@@ -53,6 +58,7 @@
// FIXME: hack to work around invalid binding in JBoss AS 6 M2
private static final List<String> beanManagerLocations = new ArrayList<String>()
{
+ private static final long serialVersionUID = 1L;
{
add("java:comp/BeanManager");
add("java:app/BeanManager");
@@ -90,10 +96,15 @@
beanManager.fireEvent(payload, qualifiers);
}
+ /**
+ * Session activated / passivated events
+ */
+
public void sessionDidActivate(HttpSessionEvent e)
{
fireEvent(e, new AnnotationLiteral<DidActivate>()
{
+ private static final long serialVersionUID = 1L;
});
}
@@ -101,13 +112,19 @@
{
fireEvent(e, new AnnotationLiteral<WillPassivate>()
{
+ private static final long serialVersionUID = 1L;
});
}
+ /**
+ * Session attribute events
+ */
+
public void attributeAdded(HttpSessionBindingEvent e)
{
fireEvent(e, new AnnotationLiteral<AttributeAdded>()
{
+ private static final long serialVersionUID = 1L;
});
}
@@ -115,6 +132,11 @@
{
fireEvent(e, new AnnotationLiteral<AttributeRemoved>()
{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
});
}
@@ -122,6 +144,7 @@
{
fireEvent(e, new AnnotationLiteral<AttributeReplaced>()
{
+ private static final long serialVersionUID = 1L;
});
}
@@ -129,6 +152,7 @@
{
fireEvent(e, new AnnotationLiteral<ValueBound>()
{
+ private static final long serialVersionUID = 1L;
});
}
@@ -136,13 +160,19 @@
{
fireEvent(e, new AnnotationLiteral<ValueUnbound>()
{
+ private static final long serialVersionUID = 1L;
});
}
+ /**
+ * Session created / destroyed events
+ */
+
public void sessionCreated(HttpSessionEvent e)
{
fireEvent(e, new AnnotationLiteral<Created>()
{
+ private static final long serialVersionUID = 1L;
});
}
@@ -150,13 +180,19 @@
{
fireEvent(e, new AnnotationLiteral<Destroyed>()
{
+ private static final long serialVersionUID = 1L;
});
}
+ /**
+ * Servlet context initialized / destroyed events
+ */
+
public void contextDestroyed(ServletContextEvent e)
{
fireEvent(e, new AnnotationLiteral<Destroyed>()
{
+ private static final long serialVersionUID = 1L;
});
}
@@ -164,13 +200,19 @@
{
fireEvent(e, new AnnotationLiteral<Initialized>()
{
+ private static final long serialVersionUID = 1L;
});
}
+ /**
+ * Servlet context attribute events
+ */
+
public void attributeAdded(ServletContextAttributeEvent e)
{
fireEvent(e, new AnnotationLiteral<AttributeAdded>()
{
+ private static final long serialVersionUID = 1L;
});
}
@@ -178,6 +220,7 @@
{
fireEvent(e, new AnnotationLiteral<AttributeRemoved>()
{
+ private static final long serialVersionUID = 1L;
});
}
@@ -185,13 +228,19 @@
{
fireEvent(e, new AnnotationLiteral<AttributeReplaced>()
{
+ private static final long serialVersionUID = 1L;
});
}
+ /**
+ * Request created / destroyed events
+ */
+
public void requestDestroyed(ServletRequestEvent e)
{
fireEvent(e, new AnnotationLiteral<Destroyed>()
{
+ private static final long serialVersionUID = 1L;
});
}
@@ -199,13 +248,19 @@
{
fireEvent(e, new AnnotationLiteral<Initialized>()
{
+ private static final long serialVersionUID = 1L;
});
}
+ /**
+ * Servlet request attribute events
+ */
+
public void attributeAdded(ServletRequestAttributeEvent e)
{
fireEvent(e, new AnnotationLiteral<AttributeAdded>()
{
+ private static final long serialVersionUID = 1L;
});
}
@@ -213,6 +268,7 @@
{
fireEvent(e, new AnnotationLiteral<AttributeRemoved>()
{
+ private static final long serialVersionUID = 1L;
});
}
@@ -220,13 +276,19 @@
{
fireEvent(e, new AnnotationLiteral<AttributeReplaced>()
{
+ private static final long serialVersionUID = 1L;
});
}
+ /**
+ * Asynchronous events
+ */
+
public void onComplete(AsyncEvent e) throws IOException
{
fireEvent(e, new AnnotationLiteral<Complete>()
{
+ private static final long serialVersionUID = 1L;
});
}
@@ -234,6 +296,7 @@
{
fireEvent(e, new AnnotationLiteral<Error>()
{
+ private static final long serialVersionUID = 1L;
});
}
@@ -241,6 +304,7 @@
{
fireEvent(e, new AnnotationLiteral<StartAsync>()
{
+ private static final long serialVersionUID = 1L;
});
}
@@ -248,6 +312,7 @@
{
fireEvent(e, new AnnotationLiteral<Timeout>()
{
+ private static final long serialVersionUID = 1L;
});
}
Modified: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/AttributeAdded.java
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/AttributeAdded.java 2010-03-23 07:59:23 UTC (rev 12246)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/AttributeAdded.java 2010-03-23 08:54:49 UTC (rev 12247)
@@ -1,14 +1,30 @@
package org.jboss.seam.servlet.event.qualifier;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
import javax.inject.Qualifier;
+import javax.servlet.ServletContextAttributeEvent;
+import javax.servlet.ServletRequestAttributeEvent;
+import javax.servlet.http.HttpSessionBindingEvent;
+/**
+ * Qualifies observer method parameters to select events that fire when
+ * attributes being added.
+ *
+ * The event parameter can be a {@link HttpSessionBindingEvent},
+ * {@link ServletContextAttributeEvent} or a
+ * {@link ServletRequestAttributeEvent}.
+ *
+ * @author Nicklas Karlsson
+ */
@Qualifier
-@Target({FIELD, PARAMETER})
+@Target( { FIELD, PARAMETER })
@Retention(RUNTIME)
-public @interface AttributeAdded {}
\ No newline at end of file
+public @interface AttributeAdded
+{
+}
\ No newline at end of file
Modified: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/AttributeRemoved.java
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/AttributeRemoved.java 2010-03-23 07:59:23 UTC (rev 12246)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/AttributeRemoved.java 2010-03-23 08:54:49 UTC (rev 12247)
@@ -7,7 +7,20 @@
import static java.lang.annotation.ElementType.PARAMETER;
import javax.inject.Qualifier;
+import javax.servlet.ServletContextAttributeEvent;
+import javax.servlet.ServletRequestAttributeEvent;
+import javax.servlet.http.HttpSessionBindingEvent;
+/**
+ * Qualifies observer method parameters to select events that fire when
+ * attributes being removed.
+ *
+ * The event parameter can be a {@link HttpSessionBindingEvent},
+ * {@link ServletContextAttributeEvent} or a
+ * {@link ServletRequestAttributeEvent}.
+ *
+ * @author Nicklas Karlsson
+ */
@Qualifier
@Target({FIELD, PARAMETER})
@Retention(RUNTIME)
Modified: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/AttributeReplaced.java
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/AttributeReplaced.java 2010-03-23 07:59:23 UTC (rev 12246)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/AttributeReplaced.java 2010-03-23 08:54:49 UTC (rev 12247)
@@ -7,7 +7,20 @@
import static java.lang.annotation.ElementType.PARAMETER;
import javax.inject.Qualifier;
+import javax.servlet.ServletContextAttributeEvent;
+import javax.servlet.ServletRequestAttributeEvent;
+import javax.servlet.http.HttpSessionBindingEvent;
+/**
+ * Qualifies observer method parameters to select events that fire when
+ * attributes being replaced.
+ *
+ * The event parameter can be a {@link HttpSessionBindingEvent},
+ * {@link ServletContextAttributeEvent} or a
+ * {@link ServletRequestAttributeEvent}.
+ *
+ * @author Nicklas Karlsson
+ */
@Qualifier
@Target({FIELD, PARAMETER})
@Retention(RUNTIME)
Modified: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Complete.java
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Complete.java 2010-03-23 07:59:23 UTC (rev 12246)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Complete.java 2010-03-23 08:54:49 UTC (rev 12247)
@@ -1,14 +1,26 @@
package org.jboss.seam.servlet.event.qualifier;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
import javax.inject.Qualifier;
+import javax.servlet.AsyncEvent;
+/**
+ * Qualifies observer method parameters to select events that fire when
+ * asynchronous request are completed.
+ *
+ * The event parameter is an {@link AsyncEvent}
+ *
+ * @author Nicklas Karlsson
+ */
@Qualifier
-@Target({FIELD, PARAMETER})
+@Target( { FIELD, PARAMETER })
@Retention(RUNTIME)
-public @interface Complete {}
\ No newline at end of file
+public @interface Complete
+{
+}
\ No newline at end of file
Modified: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Created.java
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Created.java 2010-03-23 07:59:23 UTC (rev 12246)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Created.java 2010-03-23 08:54:49 UTC (rev 12247)
@@ -1,13 +1,23 @@
package org.jboss.seam.servlet.event.qualifier;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
import javax.inject.Qualifier;
+import javax.servlet.http.HttpSessionEvent;
+/**
+ * Qualifies observer method parameters to select events that fire when
+ * HTTP sessions are created.
+ *
+ * The event parameter is an {@link HttpSessionEvent}
+ *
+ * @author Nicklas Karlsson
+ */
@Qualifier
@Target({FIELD, PARAMETER})
@Retention(RUNTIME)
Modified: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Destroyed.java
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Destroyed.java 2010-03-23 07:59:23 UTC (rev 12246)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Destroyed.java 2010-03-23 08:54:49 UTC (rev 12247)
@@ -1,13 +1,27 @@
package org.jboss.seam.servlet.event.qualifier;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
import javax.inject.Qualifier;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletRequestEvent;
+import javax.servlet.http.HttpSessionEvent;
+/**
+ * Qualifies observer method parameters to select events that fire when
+ * HTTP artifacts are being destroyed.
+ *
+ * The event parameter can be a {@link ServletContextEvent},
+ * {@link ServletRequestEvent} or a
+ * {@link HttpSessionEvent}.
+ *
+ * @author Nicklas Karlsson
+ */
@Qualifier
@Target({FIELD, PARAMETER})
@Retention(RUNTIME)
Modified: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/DidActivate.java
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/DidActivate.java 2010-03-23 07:59:23 UTC (rev 12246)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/DidActivate.java 2010-03-23 08:54:49 UTC (rev 12247)
@@ -7,7 +7,16 @@
import static java.lang.annotation.ElementType.PARAMETER;
import javax.inject.Qualifier;
+import javax.servlet.http.HttpSessionEvent;
+/**
+ * Qualifies observer method parameters to select events that fire when
+ * HTTP sessions are activated.
+ *
+ * The event parameter is an {@link HttpSessionEvent}
+ *
+ * @author Nicklas Karlsson
+ */
@Qualifier
@Target({FIELD, PARAMETER})
@Retention(RUNTIME)
Modified: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Error.java
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Error.java 2010-03-23 07:59:23 UTC (rev 12246)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Error.java 2010-03-23 08:54:49 UTC (rev 12247)
@@ -8,7 +8,16 @@
import java.lang.annotation.Target;
import javax.inject.Qualifier;
+import javax.servlet.AsyncEvent;
+/**
+ * Qualifies observer method parameters to select events that involve
+ * asynchronous request failing.
+ *
+ * The event parameter is an {@link AsyncEvent},
+ *
+ * @author Nicklas Karlsson
+ */
@Qualifier
@Target({FIELD, PARAMETER})
@Retention(RUNTIME)
Modified: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Initialized.java
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Initialized.java 2010-03-23 07:59:23 UTC (rev 12246)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Initialized.java 2010-03-23 08:54:49 UTC (rev 12247)
@@ -1,14 +1,28 @@
package org.jboss.seam.servlet.event.qualifier;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
import javax.inject.Qualifier;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletRequestEvent;
+/**
+ * Qualifies observer method parameters to select events that fire when HTTP
+ * artifacts are being initialized.
+ *
+ * The event parameter can be a {@link ServletContextEvent} or a
+ * {@link ServletRequestEvent}.
+ *
+ * @author Nicklas Karlsson
+ */
@Qualifier
-@Target({FIELD, PARAMETER})
+@Target( { FIELD, PARAMETER })
@Retention(RUNTIME)
-public @interface Initialized {}
\ No newline at end of file
+public @interface Initialized
+{
+}
\ No newline at end of file
Modified: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/StartAsync.java
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/StartAsync.java 2010-03-23 07:59:23 UTC (rev 12246)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/StartAsync.java 2010-03-23 08:54:49 UTC (rev 12247)
@@ -7,7 +7,16 @@
import static java.lang.annotation.ElementType.PARAMETER;
import javax.inject.Qualifier;
+import javax.servlet.AsyncEvent;
+/**
+ * Qualifies observer method parameters to select events that involve
+ * asynchronous request starting.
+ *
+ * The event parameter is an {@link AsyncEvent},
+ *
+ * @author Nicklas Karlsson
+ */
@Qualifier
@Target({FIELD, PARAMETER})
@Retention(RUNTIME)
Modified: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Timeout.java
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Timeout.java 2010-03-23 07:59:23 UTC (rev 12246)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Timeout.java 2010-03-23 08:54:49 UTC (rev 12247)
@@ -7,7 +7,16 @@
import static java.lang.annotation.ElementType.PARAMETER;
import javax.inject.Qualifier;
+import javax.servlet.AsyncEvent;
+/**
+ * Qualifies observer method parameters to select events that involve
+ * asynchronous request timing out.
+ *
+ * The event parameter is an {@link AsyncEvent},
+ *
+ * @author Nicklas Karlsson
+ */
@Qualifier
@Target({FIELD, PARAMETER})
@Retention(RUNTIME)
Modified: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/ValueBound.java
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/ValueBound.java 2010-03-23 07:59:23 UTC (rev 12246)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/ValueBound.java 2010-03-23 08:54:49 UTC (rev 12247)
@@ -1,13 +1,23 @@
package org.jboss.seam.servlet.event.qualifier;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
import javax.inject.Qualifier;
+import javax.servlet.http.HttpSessionBindingEvent;
+/**
+ * Qualifies observer method parameters to select events that fire when
+ * values are being bound to the HTTP session.
+ *
+ * The event parameter is a {@link HttpSessionBindingEvent}
+ *
+ * @author Nicklas Karlsson
+ */
@Qualifier
@Target({FIELD, PARAMETER})
@Retention(RUNTIME)
Modified: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/ValueUnbound.java
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/ValueUnbound.java 2010-03-23 07:59:23 UTC (rev 12246)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/ValueUnbound.java 2010-03-23 08:54:49 UTC (rev 12247)
@@ -7,7 +7,16 @@
import static java.lang.annotation.ElementType.PARAMETER;
import javax.inject.Qualifier;
+import javax.servlet.http.HttpSessionBindingEvent;
+/**
+ * Qualifies observer method parameters to select events that fire when
+ * values are being unbound from the HTTP session.
+ *
+ * The event parameter is a {@link HttpSessionBindingEvent}
+ *
+ * @author Nicklas Karlsson
+ */
@Qualifier
@Target({FIELD, PARAMETER})
@Retention(RUNTIME)
Modified: modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/WillPassivate.java
===================================================================
--- modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/WillPassivate.java 2010-03-23 07:59:23 UTC (rev 12246)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/WillPassivate.java 2010-03-23 08:54:49 UTC (rev 12247)
@@ -7,7 +7,16 @@
import static java.lang.annotation.ElementType.PARAMETER;
import javax.inject.Qualifier;
+import javax.servlet.http.HttpSessionEvent;
+/**
+ * Qualifies observer method parameters to select events that fire when
+ * HTTP sessions are passivated.
+ *
+ * The event parameter is an {@link HttpSessionEvent}
+ *
+ * @author Nicklas Karlsson
+ */
@Qualifier
@Target({FIELD, PARAMETER})
@Retention(RUNTIME)
14 years, 9 months
Seam SVN: r12246 - in modules/faces/trunk/src: main/java/org/jboss/seam/faces/event/qualifier and 2 other directories.
by seam-commits@lists.jboss.org
Author: nickarls
Date: 2010-03-23 03:59:23 -0400 (Tue, 23 Mar 2010)
New Revision: 12246
Added:
modules/faces/trunk/src/main/resources/META-INF/.faces-config.xml.jsfdia
Modified:
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/PhaseEventBridge.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/SystemEventBridge.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/After.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/AnyPhase.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/ApplyRequestValues.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/Before.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/ComponentSystemEvent.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/ExceptionQueuedEvent.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/InvokeApplication.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/PostConstructApplicationEvent.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/PostConstructCustomScopeEvent.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/PreDestroyApplicationEvent.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/PreDestroyCustomScopeEvent.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/ProcessValidations.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/RenderResponse.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/RestoreView.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/UpdateModelValues.java
modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/PhaseEventObserver.java
Log:
javadocs + cleanup
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/PhaseEventBridge.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/PhaseEventBridge.java 2010-03-23 01:52:45 UTC (rev 12245)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/PhaseEventBridge.java 2010-03-23 07:59:23 UTC (rev 12246)
@@ -93,8 +93,10 @@
/*
* This propagates the event to CDI
*/
- getBeanManager().fireEvent(event, new Annotation[] { whenQualifier, phaseQualifier });
- getBeanManager().fireEvent(event, new Annotation[] { whenQualifier, PhaseEventBridge.ANY_PHASE });
+ Annotation[] qualifiers = new Annotation[] { whenQualifier, phaseQualifier };
+ log.debug("Fired event #0 with qualifiers #1", event, qualifiers);
+ getBeanManager().fireEvent(event, qualifiers);
+ getBeanManager().fireEvent(event, new Annotation[] { whenQualifier, ANY_PHASE });
}
public void afterPhase(final PhaseEvent e)
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/SystemEventBridge.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/SystemEventBridge.java 2010-03-23 01:52:45 UTC (rev 12245)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/SystemEventBridge.java 2010-03-23 07:59:23 UTC (rev 12246)
@@ -39,6 +39,7 @@
* }
* </code>
*
+ * @author Nicklas Karlsson
*/
@ApplicationScoped
public class SystemEventBridge extends BeanManagerAware implements SystemEventListener
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/After.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/After.java 2010-03-23 01:52:45 UTC (rev 12245)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/After.java 2010-03-23 07:59:23 UTC (rev 12246)
@@ -9,6 +9,12 @@
import javax.inject.Qualifier;
+/**
+ * Qualifies observer method parameters to select events that occur in a "after"
+ * phase in the JSF lifecycle
+ *
+ * @author Nicklas Karlsson
+ */
@Qualifier
@Target({FIELD, PARAMETER})
@Retention(RUNTIME)
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/AnyPhase.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/AnyPhase.java 2010-03-23 01:52:45 UTC (rev 12245)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/AnyPhase.java 2010-03-23 07:59:23 UTC (rev 12246)
@@ -10,6 +10,9 @@
import javax.inject.Qualifier;
/**
+ * Qualifies observer method parameters to select events that occur in a any
+ * phase in the JSF lifecycle
+ *
* @author <a href="mailto:lincolnbaxter@gmail.com>Lincoln Baxter, III</a>
*/
@Qualifier
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/ApplyRequestValues.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/ApplyRequestValues.java 2010-03-23 01:52:45 UTC (rev 12245)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/ApplyRequestValues.java 2010-03-23 07:59:23 UTC (rev 12246)
@@ -7,8 +7,17 @@
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
+import javax.faces.event.PhaseEvent;
import javax.inject.Qualifier;
+/**
+ * Qualifies observer method parameters to select events in one of the "apply request values"
+ * phase in the JSF lifecycle. The selection can further be refined by combining it with the
+ * qualifiers {@link @Before} or {@link @After}. The event parameter is a {@link PhaseEvent}.
+ *
+ * @author Nicklas Karlsson
+ * @see javax.faces.event.PhaseEvent
+ */
@Qualifier
@Target({FIELD, PARAMETER})
@Retention(RUNTIME)
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/Before.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/Before.java 2010-03-23 01:52:45 UTC (rev 12245)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/Before.java 2010-03-23 07:59:23 UTC (rev 12246)
@@ -9,6 +9,12 @@
import javax.inject.Qualifier;
+/**
+ * Qualifies observer method parameters to select events that occur in a "before"
+ * phase in the JSF lifecycle
+ *
+ * @author Nicklas Karlsson
+ */
@Qualifier
@Target({FIELD, PARAMETER})
@Retention(RUNTIME)
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/ComponentSystemEvent.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/ComponentSystemEvent.java 2010-03-23 01:52:45 UTC (rev 12245)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/ComponentSystemEvent.java 2010-03-23 07:59:23 UTC (rev 12246)
@@ -9,6 +9,12 @@
import javax.inject.Qualifier;
+/**
+ * Qualifies observer method parameters to select JSF component system events
+ * The event parameter is a {@link javax.faces.event.ComponentSystemEvent.ComponentSystemEvent}.
+ *
+ * @author Nicklas Karlsson
+ */
@Qualifier
@Target({FIELD, PARAMETER})
@Retention(RUNTIME)
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/ExceptionQueuedEvent.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/ExceptionQueuedEvent.java 2010-03-23 01:52:45 UTC (rev 12245)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/ExceptionQueuedEvent.java 2010-03-23 07:59:23 UTC (rev 12246)
@@ -9,6 +9,12 @@
import javax.inject.Qualifier;
+/**
+ * Qualifies observer method parameters to select JSF exception queued events
+ * The event parameter is a {@link javax.faces.event.ExceptionQueuedEvent}.
+ *
+ * @author Nicklas Karlsson
+ */
@Qualifier
@Target({FIELD, PARAMETER})
@Retention(RUNTIME)
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/InvokeApplication.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/InvokeApplication.java 2010-03-23 01:52:45 UTC (rev 12245)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/InvokeApplication.java 2010-03-23 07:59:23 UTC (rev 12246)
@@ -7,8 +7,16 @@
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
+import javax.faces.event.PhaseEvent;
import javax.inject.Qualifier;
+/**
+ * Qualifies observer method parameters to select events in one of the "invoke application"
+ * phase in the JSF lifecycle. The selection can further be refined by combining it with the
+ * qualifiers {@link @Before} or {@link @After}. The event parameter is a {@link PhaseEvent}.
+ *
+ * @author Nicklas Karlsson
+ */
@Qualifier
@Target({FIELD, PARAMETER})
@Retention(RUNTIME)
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/PostConstructApplicationEvent.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/PostConstructApplicationEvent.java 2010-03-23 01:52:45 UTC (rev 12245)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/PostConstructApplicationEvent.java 2010-03-23 07:59:23 UTC (rev 12246)
@@ -9,6 +9,12 @@
import javax.inject.Qualifier;
+/**
+ * Qualifies observer method parameters to select JSF post-construct application events
+ * The event parameter is a {@link javax.faces.event.PostConstructApplicationEvent}.
+ *
+ * @author Nicklas Karlsson
+ */
@Qualifier
@Target({FIELD, PARAMETER})
@Retention(RUNTIME)
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/PostConstructCustomScopeEvent.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/PostConstructCustomScopeEvent.java 2010-03-23 01:52:45 UTC (rev 12245)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/PostConstructCustomScopeEvent.java 2010-03-23 07:59:23 UTC (rev 12246)
@@ -9,6 +9,12 @@
import javax.inject.Qualifier;
+/**
+ * Qualifies observer method parameters to select JSF post-construct custom scope events
+ * The event parameter is a {@link javax.faces.event.javax.faces.event.PostConstructCustomScopeEvent}.
+ *
+ * @author Nicklas Karlsson
+ */
@Qualifier
@Target({FIELD, PARAMETER})
@Retention(RUNTIME)
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/PreDestroyApplicationEvent.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/PreDestroyApplicationEvent.java 2010-03-23 01:52:45 UTC (rev 12245)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/PreDestroyApplicationEvent.java 2010-03-23 07:59:23 UTC (rev 12246)
@@ -9,6 +9,12 @@
import javax.inject.Qualifier;
+/**
+ * Qualifies observer method parameters to select JSF pre-destroy application events
+ * The event parameter is a {@link javax.faces.event.javax.faces.event.PreDestroyApplicationEvent}.
+ *
+ * @author Nicklas Karlsson
+ */
@Qualifier
@Target({FIELD, PARAMETER})
@Retention(RUNTIME)
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/PreDestroyCustomScopeEvent.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/PreDestroyCustomScopeEvent.java 2010-03-23 01:52:45 UTC (rev 12245)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/PreDestroyCustomScopeEvent.java 2010-03-23 07:59:23 UTC (rev 12246)
@@ -9,6 +9,12 @@
import javax.inject.Qualifier;
+/**
+ * Qualifies observer method parameters to select JSF pre-destroy custom scope events
+ * The event parameter is a {@link javax.faces.event.javax.faces.event.PreDestroyCustomScopeEvent}.
+ *
+ * @author Nicklas Karlsson
+ */
@Qualifier
@Target({FIELD, PARAMETER})
@Retention(RUNTIME)
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/ProcessValidations.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/ProcessValidations.java 2010-03-23 01:52:45 UTC (rev 12245)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/ProcessValidations.java 2010-03-23 07:59:23 UTC (rev 12246)
@@ -7,8 +7,16 @@
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
+import javax.faces.event.PhaseEvent;
import javax.inject.Qualifier;
+/**
+ * Qualifies observer method parameters to select events in one of the "process validations"
+ * phase in the JSF lifecycle. The selection can further be refined by combining it with the
+ * qualifiers {@link @Before} or {@link @After}. The event parameter is a {@link PhaseEvent}.
+ *
+ * @author Nicklas Karlsson
+ */
@Qualifier
@Target({FIELD, PARAMETER})
@Retention(RUNTIME)
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/RenderResponse.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/RenderResponse.java 2010-03-23 01:52:45 UTC (rev 12245)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/RenderResponse.java 2010-03-23 07:59:23 UTC (rev 12246)
@@ -7,8 +7,16 @@
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
+import javax.faces.event.PhaseEvent;
import javax.inject.Qualifier;
+/**
+ * Qualifies observer method parameters to select events in one of the "render response"
+ * phase in the JSF lifecycle. The selection can further be refined by combining it with the
+ * qualifiers {@link @Before} or {@link @After}. The event parameter is a {@link PhaseEvent}.
+ *
+ * @author Nicklas Karlsson
+ */
@Qualifier
@Target({FIELD, PARAMETER})
@Retention(RUNTIME)
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/RestoreView.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/RestoreView.java 2010-03-23 01:52:45 UTC (rev 12245)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/RestoreView.java 2010-03-23 07:59:23 UTC (rev 12246)
@@ -7,8 +7,16 @@
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
+import javax.faces.event.PhaseEvent;
import javax.inject.Qualifier;
+/**
+ * Qualifies observer method parameters to select events in one of the "restore view"
+ * phase in the JSF lifecycle. The selection can further be refined by combining it with the
+ * qualifiers {@link @Before} or {@link @After}. The event parameter is a {@link PhaseEvent}.
+ *
+ * @author Nicklas Karlsson
+ */
@Qualifier
@Target({FIELD, PARAMETER})
@Retention(RUNTIME)
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/UpdateModelValues.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/UpdateModelValues.java 2010-03-23 01:52:45 UTC (rev 12245)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/UpdateModelValues.java 2010-03-23 07:59:23 UTC (rev 12246)
@@ -7,8 +7,16 @@
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
+import javax.faces.event.PhaseEvent;
import javax.inject.Qualifier;
+/**
+ * Qualifies observer method parameters to select events in one of the "update model values"
+ * phase in the JSF lifecycle. The selection can further be refined by combining it with the
+ * qualifiers {@link @Before} or {@link @After}. The event parameter is a {@link PhaseEvent}.
+ *
+ * @author Nicklas Karlsson
+ */
@Qualifier
@Target({FIELD, PARAMETER})
@Retention(RUNTIME)
Added: modules/faces/trunk/src/main/resources/META-INF/.faces-config.xml.jsfdia
===================================================================
--- modules/faces/trunk/src/main/resources/META-INF/.faces-config.xml.jsfdia (rev 0)
+++ modules/faces/trunk/src/main/resources/META-INF/.faces-config.xml.jsfdia 2010-03-23 07:59:23 UTC (rev 12246)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<PROCESS model-entity="JSFProcess"/>
Modified: modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/PhaseEventObserver.java
===================================================================
--- modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/PhaseEventObserver.java 2010-03-23 01:52:45 UTC (rev 12245)
+++ modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/PhaseEventObserver.java 2010-03-23 07:59:23 UTC (rev 12246)
@@ -44,62 +44,62 @@
public void observeBeforeRenderResponse(@Observes @Before @RenderResponse final PhaseEvent e)
{
- PhaseEventObserver.observeBeforeRenderResponse = true;
+ observeBeforeRenderResponse = true;
}
public void observeAfterRenderResponse(@Observes @After @RenderResponse final PhaseEvent e)
{
- PhaseEventObserver.observeAfterRenderResponse = true;
+ observeAfterRenderResponse = true;
}
public void observeBeforeApplyRequestValues(@Observes @Before @ApplyRequestValues final PhaseEvent e)
{
- PhaseEventObserver.observeBeforeApplyRequestValues = true;
+ observeBeforeApplyRequestValues = true;
}
public void observeAfterApplyRequestValues(@Observes @After @ApplyRequestValues final PhaseEvent e)
{
- PhaseEventObserver.observeAfterApplyRequestValues = true;
+ observeAfterApplyRequestValues = true;
}
public void observeBeforeInvokeApplication(@Observes @Before @InvokeApplication final PhaseEvent e)
{
- PhaseEventObserver.observeBeforeInvokeApplication = true;
+ observeBeforeInvokeApplication = true;
}
public void observeAfterInvokeApplication(@Observes @After @InvokeApplication final PhaseEvent e)
{
- PhaseEventObserver.observeAfterInvokeApplication = true;
+ observeAfterInvokeApplication = true;
}
public void observeBeforeProcessValidations(@Observes @Before @ProcessValidations final PhaseEvent e)
{
- PhaseEventObserver.observeBeforeProcessValidations = true;
+ observeBeforeProcessValidations = true;
}
public void observeAfterProcessValidations(@Observes @After @ProcessValidations final PhaseEvent e)
{
- PhaseEventObserver.observeAfterProcessValidations = true;
+ observeAfterProcessValidations = true;
}
public void observeBeforeRestoreView(@Observes @Before @RestoreView final PhaseEvent e)
{
- PhaseEventObserver.observeBeforeRestoreView = true;
+ observeBeforeRestoreView = true;
}
public void observeAfterRestoreView(@Observes @After @RestoreView final PhaseEvent e)
{
- PhaseEventObserver.observeAfterRestoreView = true;
+ observeAfterRestoreView = true;
}
public void observeBeforeUpdateModelValues(@Observes @Before @UpdateModelValues final PhaseEvent e)
{
- PhaseEventObserver.observeBeforeUpdateModelValues = true;
+ observeBeforeUpdateModelValues = true;
}
public void observeAfterUpdateModelValues(@Observes @After @UpdateModelValues final PhaseEvent e)
{
- PhaseEventObserver.observeAfterUpdateModelValues = true;
+ observeAfterUpdateModelValues = true;
}
}
14 years, 9 months
Seam SVN: r12245 - in modules/faces/trunk: src/main/java/org/jboss/seam/faces and 7 other directories.
by seam-commits@lists.jboss.org
Author: lincolnthree
Date: 2010-03-22 21:52:45 -0400 (Mon, 22 Mar 2010)
New Revision: 12245
Added:
modules/faces/trunk/src/main/java/org/jboss/seam/faces/cdi/
modules/faces/trunk/src/main/java/org/jboss/seam/faces/cdi/BeanManagerAware.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/DelegatingPhaseListener.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/DelegatingSystemEventListener.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/PhaseEventBridge.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/SystemEventBridge.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/AnyPhase.java
modules/faces/trunk/src/test/java/org/jboss/seam/faces/MockLogger.java
modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/PhaseEventBridgeTest.java
modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/PhaseEventObserver.java
modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/SystemEventBridgeTest.java
Removed:
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/GenericEventListener.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/PhaseEventListener.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/SystemEventListener.java
modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/PhaseListenerObserver.java
modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/PhaseListenerTests.java
modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/SystemEventListenerTests.java
Modified:
modules/faces/trunk/pom.xml
modules/faces/trunk/src/main/java/org/jboss/seam/faces/component/MethodBindingMethodExpressionAdapter.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/component/UIViewAction.java
modules/faces/trunk/src/main/resources/META-INF/faces-config.xml
Log:
Refactored and documented the PhaseEventBridge, SystemEventBridge. Added unit tests.
Added the @AnyPhase annotation to allow a PhaseEvent observer to observe all phase events throughout thet lifecycle.
Modified: modules/faces/trunk/pom.xml
===================================================================
--- modules/faces/trunk/pom.xml 2010-03-23 01:15:48 UTC (rev 12244)
+++ modules/faces/trunk/pom.xml 2010-03-23 01:52:45 UTC (rev 12245)
@@ -2,17 +2,41 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
- <artifactId>seam-faces</artifactId>
- <version>3.0.0-SNAPSHOT</version>
- <packaging>jar</packaging>
- <name>Seam Faces Module</name>
-
<parent>
<artifactId>seam-parent</artifactId>
<groupId>org.jboss.seam</groupId>
<version>3.0.0-SNAPSHOT</version>
</parent>
+ <artifactId>seam-faces</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+
+ <packaging>jar</packaging>
+ <name>Seam Faces Module</name>
+
+ <developers>
+ <developer>
+ <name>Lincoln Baxter, III</name>
+ <email>lincolnbaxter(a)gmail.com</email>
+ <url>http://ocpsoft.com</url>
+ <organization>JBoss, by Red Hat</organization>
+ <organizationUrl>http://jboss.org</organizationUrl>
+ <timezone>EST</timezone>
+ <roles>
+ <role>Project Lead</role>
+ </roles>
+ </developer>
+ <developer>
+ <name>Dan J. Allen</name>
+ <organization>JBoss, by Red Hat</organization>
+ <organizationUrl>http://jboss.org</organizationUrl>
+ <timezone>EST</timezone>
+ <roles>
+ <role>Project Lead</role>
+ </roles>
+ </developer>
+ </developers>
+
<properties>
<arquillian.version>1.0.0.Alpha1</arquillian.version>
<jsfmock.version>1.0.0</jsfmock.version>
@@ -23,7 +47,8 @@
<repository>
<id>oss.sonatype.org/jboss-snapshots</id>
<name>JBoss (Nexus) Snapshots Repository</name>
- <url>http://oss.sonatype.org/content/repositories/jboss-snapshots</url>
+ <url>http://oss.sonatype.org/content/repositories/jboss-snapshots
+ </url>
<releases>
<enabled>false</enabled>
</releases>
@@ -32,18 +57,6 @@
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
- <repository>
- <id>snapshots.jboss.org</id>
- <name>JBoss Snapshots Repository</name>
- <url>http://snapshots.jboss.org/maven2</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- </repository>
<repository>
<id>Java.NET</id>
@@ -54,6 +67,7 @@
<dependencies>
+ <!-- Environment Dependencies -->
<dependency>
<!-- This is necessary until a new JSF-API is published to central -->
<groupId>com.sun.faces</groupId>
@@ -71,41 +85,43 @@
<artifactId>jsr250-api</artifactId>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-extensions</artifactId>
+ <version>1.0.0.Alpha1</version>
+ </dependency>
+ <!-- Test Dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>4.6</version>
+ <version>4.8.1</version>
<scope>test</scope>
</dependency>
-
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-junit</artifactId>
<version>${arquillian.version}</version>
<scope>test</scope>
</dependency>
-
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-weld-embedded</artifactId>
<version>${arquillian.version}</version>
</dependency>
-
<dependency>
+ <groupId>org.jboss.jsfunit</groupId>
+ <artifactId>jboss-jsfunit-core</artifactId>
+ <version>1.2.0.Final</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.jboss.test-jsf</groupId>
<artifactId>jsf-mock</artifactId>
<version>${jsfmock.version}</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.jboss.jsfunit</groupId>
- <artifactId>jboss-jsfunit-core</artifactId>
- <version>1.2.0.Final</version>
- <scope>test</scope>
- </dependency>
-
</dependencies>
<profiles>
@@ -122,8 +138,8 @@
</profiles>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/seam/modules/faces/trunk</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/seam/modules/faces/trunk</developerConnection>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/seam/modules/faces/trunk </connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/seam/modules/faces/trunk </developerConnection>
<url>http://fisheye.jboss.org/browse/Seam/modules/faces/trunk</url>
</scm>
Copied: modules/faces/trunk/src/main/java/org/jboss/seam/faces/cdi/BeanManagerAware.java (from rev 12236, modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/GenericEventListener.java)
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/cdi/BeanManagerAware.java (rev 0)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/cdi/BeanManagerAware.java 2010-03-23 01:52:45 UTC (rev 12245)
@@ -0,0 +1,50 @@
+package org.jboss.seam.faces.cdi;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.enterprise.inject.spi.BeanManager;
+import javax.inject.Inject;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+public class BeanManagerAware
+{
+ @Inject
+ BeanManager beanManager;
+
+ // FIXME: hack to work around invalid binding in JBoss AS 6 M2
+ private static final List<String> beanManagerLocations;
+
+ static
+ {
+ beanManagerLocations = new ArrayList<String>();
+ beanManagerLocations.add("java:comp/BeanManager");
+ beanManagerLocations.add("java:app/BeanManager");
+ }
+
+ protected BeanManager getBeanManager()
+ {
+ if (beanManager == null)
+ {
+ beanManager = lookupBeanManager();
+ }
+ return beanManager;
+ }
+
+ private BeanManager lookupBeanManager()
+ {
+ for (String location : beanManagerLocations)
+ {
+ try
+ {
+ return (BeanManager) new InitialContext().lookup(location);
+ }
+ catch (NamingException e)
+ {
+ // No panic, keep trying
+ }
+ }
+ throw new IllegalArgumentException("Could not find BeanManager in " + beanManagerLocations);
+ }
+}
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/component/MethodBindingMethodExpressionAdapter.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/component/MethodBindingMethodExpressionAdapter.java 2010-03-23 01:15:48 UTC (rev 12244)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/component/MethodBindingMethodExpressionAdapter.java 2010-03-23 01:52:45 UTC (rev 12245)
@@ -41,6 +41,7 @@
import javax.faces.context.FacesContext;
import javax.faces.el.EvaluationException;
import javax.faces.el.MethodBinding;
+import javax.faces.el.MethodNotFoundException;
import javax.el.MethodExpression;
import javax.el.MethodInfo;
@@ -69,13 +70,14 @@
{
} // for StateHolder
- MethodBindingMethodExpressionAdapter(MethodExpression methodExpression)
+ MethodBindingMethodExpressionAdapter(final MethodExpression methodExpression)
{
this.methodExpression = methodExpression;
}
@Override
- public Object invoke(FacesContext context, Object params[]) throws javax.faces.el.EvaluationException, javax.faces.el.MethodNotFoundException
+ @SuppressWarnings("deprecation")
+ public Object invoke(final FacesContext context, final Object params[]) throws EvaluationException, MethodNotFoundException
{
assert (null != methodExpression);
if (context == null)
@@ -107,20 +109,21 @@
}
catch (NullPointerException e)
{
- throw new javax.faces.el.MethodNotFoundException(e);
+ throw new MethodNotFoundException(e);
}
return result;
}
@Override
- public Class getType(FacesContext context) throws javax.faces.el.MethodNotFoundException
+ @SuppressWarnings("deprecation")
+ public Class<?> getType(final FacesContext context) throws MethodNotFoundException
{
assert (null != methodExpression);
if (context == null)
{
throw new NullPointerException("FacesConext -> null");
}
- Class result = null;
+ Class<?> result = null;
if (context == null)
{
throw new NullPointerException();
@@ -133,15 +136,15 @@
}
catch (javax.el.PropertyNotFoundException e)
{
- throw new javax.faces.el.MethodNotFoundException(e);
+ throw new MethodNotFoundException(e);
}
catch (javax.el.MethodNotFoundException e)
{
- throw new javax.faces.el.MethodNotFoundException(e);
+ throw new MethodNotFoundException(e);
}
catch (ELException e)
{
- throw new javax.faces.el.MethodNotFoundException(e);
+ throw new MethodNotFoundException(e);
}
return result;
}
@@ -154,7 +157,8 @@
}
@Override
- public boolean equals(Object other)
+ @SuppressWarnings("deprecation")
+ public boolean equals(final Object other)
{
if (this == other)
{
@@ -206,7 +210,7 @@
// Get all of the methods with the matching name and try
// to find a match based on controlInfo's return and parameter
// types
- Class type = binding.getType(context);
+ Class<?> type = binding.getType(context);
Method[] methods = result.getClass().getMethods();
for (Method meth : methods)
{
@@ -234,12 +238,12 @@
return this.tranzient;
}
- public void setTransient(boolean tranzient)
+ public void setTransient(final boolean tranzient)
{
this.tranzient = tranzient;
}
- public Object saveState(FacesContext context)
+ public Object saveState(final FacesContext context)
{
if (context == null)
{
@@ -269,7 +273,7 @@
}
- public void restoreState(FacesContext context, Object state)
+ public void restoreState(final FacesContext context, final Object state)
{
if (context == null)
{
@@ -288,7 +292,7 @@
String className = stateStruct[1].toString();
MethodExpression result = null;
- Class toRestoreClass = null;
+ Class<?> toRestoreClass = null;
if (null != className)
{
try
@@ -316,7 +320,7 @@
}
}
- if (null != result && null != savedState)
+ if ((null != result) && (null != savedState))
{
// don't need to check transient, since that was
// done on the saving side.
@@ -339,7 +343,7 @@
//
// Helper methods for StateHolder
//
- private static Class loadClass(String name, Object fallbackClass) throws ClassNotFoundException
+ private static Class<?> loadClass(final String name, final Object fallbackClass) throws ClassNotFoundException
{
ClassLoader loader = Thread.currentThread().getContextClassLoader();
if (loader == null)
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/component/UIViewAction.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/component/UIViewAction.java 2010-03-23 01:15:48 UTC (rev 12244)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/component/UIViewAction.java 2010-03-23 01:52:45 UTC (rev 12245)
@@ -139,7 +139,7 @@
{
}
- PropertyKeys(String name)
+ PropertyKeys(final String name)
{
this.name = name;
}
@@ -175,6 +175,7 @@
*
* @deprecated This has been replaced by {@link #getActionExpression}.
*/
+ @Deprecated
public MethodBinding getAction()
{
MethodBinding result = null;
@@ -194,7 +195,8 @@
* {@link #setActionExpression(javax.el.MethodExpression)}.
* @throws UnsupportedOperationException if called
*/
- public void setAction(MethodBinding action)
+ @Deprecated
+ public void setAction(final MethodBinding action)
{
throw new UnsupportedOperationException("Not supported.");
}
@@ -204,6 +206,7 @@
*
* @throws UnsupportedOperationException if called
*/
+ @SuppressWarnings("deprecation")
public MethodBinding getActionListener()
{
throw new UnsupportedOperationException("Not supported.");
@@ -214,7 +217,8 @@
*
* @throws UnsupportedOperationException if called
*/
- public void setActionListener(MethodBinding actionListener)
+ @SuppressWarnings("deprecation")
+ public void setActionListener(final MethodBinding actionListener)
{
throw new UnsupportedOperationException("Not supported.");
}
@@ -235,7 +239,7 @@
* Sets the immediate flag, which controls the JSF lifecycle in which the
* action is invoked.
*/
- public void setImmediate(boolean immediate)
+ public void setImmediate(final boolean immediate)
{
getStateHelper().put(PropertyKeys.immediate, immediate);
}
@@ -268,7 +272,7 @@
/**
* Set the name of the phase in which the action is to be queued.
*/
- public void setPhase(String phase)
+ public void setPhase(final String phase)
{
getStateHelper().put(PropertyKeys.phase, phase);
}
@@ -311,7 +315,7 @@
*
* @throws UnsupportedOperationException if called
*/
- public void addActionListener(ActionListener listener)
+ public void addActionListener(final ActionListener listener)
{
throw new UnsupportedOperationException("Not supported.");
}
@@ -329,7 +333,7 @@
*
* @throws UnsupportedOperationException if called
*/
- public void removeActionListener(ActionListener listener)
+ public void removeActionListener(final ActionListener listener)
{
throw new UnsupportedOperationException("Not supported.");
}
@@ -345,7 +349,7 @@
/**
* Sets the action, represented as an EL method expression, to invoke.
*/
- public void setActionExpression(MethodExpression actionExpression)
+ public void setActionExpression(final MethodExpression actionExpression)
{
getStateHelper().put(PropertyKeys.actionExpression, actionExpression);
}
@@ -363,7 +367,7 @@
* Set the bookean flag that controls whether the action is invoked during a
* faces (postback) request.
*/
- public void setOnPostback(boolean onPostback)
+ public void setOnPostback(final boolean onPostback)
{
getStateHelper().put(PropertyKeys.onPostback, onPostback);
}
@@ -381,7 +385,7 @@
* Sets the condition, represented as an EL value expression, that must
* evaluate to true for the action to be invoked.
*/
- public void setIf(boolean condition)
+ public void setIf(final boolean condition)
{
getStateHelper().put(PropertyKeys.ifAttr, condition);
}
@@ -405,7 +409,7 @@
* @throws NullPointerException if <code>event</code> is <code>null</code>
*/
@Override
- public void broadcast(FacesEvent event) throws AbortProcessingException
+ public void broadcast(final FacesEvent event) throws AbortProcessingException
{
super.broadcast(event);
@@ -417,7 +421,7 @@
// only proceed if the response has not been marked complete and
// navigation to another view has not occurred
- if (event instanceof ActionEvent && !context.getResponseComplete() && context.getViewRoot() == getViewRootOf(event))
+ if ((event instanceof ActionEvent) && !context.getResponseComplete() && (context.getViewRoot() == getViewRootOf(event)))
{
ActionListener listener = context.getApplication().getActionListener();
if (listener != null)
@@ -498,7 +502,7 @@
* passing the {@link ActionEvent} just created.
*/
@Override
- public void decode(FacesContext context)
+ public void decode(final FacesContext context)
{
if (context == null)
{
@@ -528,7 +532,7 @@
queueEvent(e);
}
- private UIViewRoot getViewRootOf(FacesEvent e)
+ private UIViewRoot getViewRootOf(final FacesEvent e)
{
UIComponent c = e.getComponent();
do
@@ -543,7 +547,7 @@
return null;
}
- private Lifecycle getLifecycle(FacesContext context)
+ private Lifecycle getLifecycle(final FacesContext context)
{
LifecycleFactory lifecycleFactory = (LifecycleFactory) FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
String lifecycleId = context.getExternalContext().getInitParameter(FacesServlet.LIFECYCLE_ID_ATTR);
@@ -562,12 +566,12 @@
private class InstrumentedFacesContext extends FacesContextWrapper
{
- private FacesContext wrapped;
+ private final FacesContext wrapped;
private boolean viewRootCleared = false;
private boolean renderedResponseControlDisabled = false;
private Boolean postback = null;
- public InstrumentedFacesContext(FacesContext wrapped)
+ public InstrumentedFacesContext(final FacesContext wrapped)
{
this.wrapped = wrapped;
}
@@ -590,7 +594,7 @@
}
@Override
- public void setViewRoot(UIViewRoot viewRoot)
+ public void setViewRoot(final UIViewRoot viewRoot)
{
viewRootCleared = false;
wrapped.setViewRoot(viewRoot);
Added: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/DelegatingPhaseListener.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/DelegatingPhaseListener.java (rev 0)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/DelegatingPhaseListener.java 2010-03-23 01:52:45 UTC (rev 12245)
@@ -0,0 +1,77 @@
+package org.jboss.seam.faces.event;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.faces.event.PhaseEvent;
+import javax.faces.event.PhaseId;
+import javax.faces.event.PhaseListener;
+
+import org.jboss.seam.faces.cdi.BeanManagerAware;
+
+/**
+ * Provide CDI injection to PhaseListener artifacts by delegating through this
+ * class.
+ *
+ * @author <a href="mailto:lincolnbaxter@gmail.com>Lincoln Baxter, III</a>
+ *
+ */
+public class DelegatingPhaseListener extends BeanManagerAware implements PhaseListener
+{
+ private static final long serialVersionUID = 8454616175394888259L;
+
+ public PhaseId getPhaseId()
+ {
+ return PhaseId.ANY_PHASE;
+ }
+
+ public void beforePhase(final PhaseEvent event)
+ {
+ for (PhaseListener listener : getPhaseListeners())
+ {
+ if (shouldProcessPhase(listener, event))
+ {
+ listener.beforePhase(event);
+ }
+ }
+ }
+
+ public void afterPhase(final PhaseEvent event)
+ {
+ for (PhaseListener listener : getPhaseListeners())
+ {
+ if (shouldProcessPhase(listener, event))
+ {
+ listener.afterPhase(event);
+ }
+ }
+ }
+
+ /**
+ * Determine if the {@link PhaseListener} should process the given
+ * {@link PhaseEvent}.
+ */
+ private boolean shouldProcessPhase(final PhaseListener listener, final PhaseEvent event)
+ {
+ return (PhaseId.ANY_PHASE.equals(listener.getPhaseId()) || event.getPhaseId().equals(listener.getPhaseId()));
+ }
+
+ @SuppressWarnings("unchecked")
+ private List<PhaseListener> getPhaseListeners()
+ {
+ BeanManager manager = getBeanManager();
+ List<PhaseListener> result = new ArrayList<PhaseListener>();
+
+ Bean<PhaseEventBridge> bean = (Bean<PhaseEventBridge>) manager.getBeans(PhaseEventBridge.class).iterator().next();
+ CreationalContext<PhaseEventBridge> context = manager.createCreationalContext(bean);
+ PhaseEventBridge listener = (PhaseEventBridge) manager.getReference(bean, PhaseEventBridge.class, context);
+
+ result.add(listener);
+
+ return result;
+ }
+
+}
Added: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/DelegatingSystemEventListener.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/DelegatingSystemEventListener.java (rev 0)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/DelegatingSystemEventListener.java 2010-03-23 01:52:45 UTC (rev 12245)
@@ -0,0 +1,56 @@
+package org.jboss.seam.faces.event;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.SystemEvent;
+import javax.faces.event.SystemEventListener;
+
+import org.jboss.seam.faces.cdi.BeanManagerAware;
+
+/**
+ * Provide CDI injection to SystemEventListener artifacts by delegating through
+ * this class.
+ *
+ * @author <a href="mailto:lincolnbaxter@gmail.com>Lincoln Baxter, III</a>
+ *
+ */
+public class DelegatingSystemEventListener extends BeanManagerAware implements SystemEventListener
+{
+
+ public boolean isListenerForSource(final Object source)
+ {
+ return true;
+ }
+
+ public void processEvent(final SystemEvent event) throws AbortProcessingException
+ {
+ for (SystemEventListener l : getEventListeners())
+ {
+ if (l.isListenerForSource(event.getSource()))
+ {
+ l.processEvent(event);
+ }
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private List<SystemEventListener> getEventListeners()
+ {
+ BeanManager manager = getBeanManager();
+ List<SystemEventListener> result = new ArrayList<SystemEventListener>();
+
+ Bean<SystemEventBridge> bean = (Bean<SystemEventBridge>) manager.getBeans(SystemEventBridge.class).iterator().next();
+ CreationalContext<SystemEventBridge> context = manager.createCreationalContext(bean);
+ SystemEventBridge listener = (SystemEventBridge) manager.getReference(bean, SystemEventBridge.class, context);
+
+ result.add(listener);
+
+ return result;
+ }
+
+}
Deleted: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/GenericEventListener.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/GenericEventListener.java 2010-03-23 01:15:48 UTC (rev 12244)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/GenericEventListener.java 2010-03-23 01:52:45 UTC (rev 12245)
@@ -1,51 +0,0 @@
-package org.jboss.seam.faces.event;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.enterprise.inject.spi.BeanManager;
-import javax.inject.Inject;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-@SuppressWarnings("serial")
-public class GenericEventListener
-{
-
- @Inject
- BeanManager beanManager;
-
- // FIXME: hack to work around invalid binding in JBoss AS 6 M2
- private static final List<String> beanManagerLocations = new ArrayList<String>()
- {
- {
- add("java:comp/BeanManager");
- add("java:app/BeanManager");
- }
- };
-
- protected BeanManager getBeanManager()
- {
- if (beanManager == null)
- {
- beanManager = lookupBeanManager();
- }
- return beanManager;
- }
-
- private BeanManager lookupBeanManager()
- {
- for (String location : beanManagerLocations)
- {
- try
- {
- return (BeanManager) new InitialContext().lookup(location);
- }
- catch (NamingException e)
- {
- // No panic, keep trying
- }
- }
- throw new IllegalArgumentException("Could not find BeanManager in " + beanManagerLocations);
- }
-}
Copied: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/PhaseEventBridge.java (from rev 12236, modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/PhaseEventListener.java)
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/PhaseEventBridge.java (rev 0)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/PhaseEventBridge.java 2010-03-23 01:52:45 UTC (rev 12245)
@@ -0,0 +1,163 @@
+package org.jboss.seam.faces.event;
+
+import java.lang.annotation.Annotation;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.event.Observes;
+import javax.enterprise.util.AnnotationLiteral;
+import javax.faces.event.PhaseEvent;
+import javax.faces.event.PhaseId;
+import javax.faces.event.PhaseListener;
+import javax.inject.Inject;
+
+import org.jboss.seam.faces.cdi.BeanManagerAware;
+import org.jboss.seam.faces.event.qualifier.After;
+import org.jboss.seam.faces.event.qualifier.AnyPhase;
+import org.jboss.seam.faces.event.qualifier.ApplyRequestValues;
+import org.jboss.seam.faces.event.qualifier.Before;
+import org.jboss.seam.faces.event.qualifier.InvokeApplication;
+import org.jboss.seam.faces.event.qualifier.ProcessValidations;
+import org.jboss.seam.faces.event.qualifier.RenderResponse;
+import org.jboss.seam.faces.event.qualifier.RestoreView;
+import org.jboss.seam.faces.event.qualifier.UpdateModelValues;
+import org.slf4j.Logger;
+
+/**
+ * A PhaseListener used to bridge JSF phase events to the CDI event model.
+ * <p>
+ *
+ * For each JSF {@link PhaseEvent}, a corresponding Seam CDI event will be
+ * fired. Event listeners can be registered by observing the appropriate Seam
+ * CDI event (see @{@link Observes}):
+ * <p>
+ * <b>For example:</b>
+ * <p>
+ * <code>
+ * public void listener(@Observes @Before @RenderResponse PhaseEvent event)
+ * {
+ * //do something
+ * }
+ * </code>
+ *
+ * @author Nicklas Karlsson
+ * @author <a href="mailto:lincolnbaxter@gmail.com>Lincoln Baxter, III</a>
+ *
+ */
+@ApplicationScoped
+public class PhaseEventBridge extends BeanManagerAware implements PhaseListener
+{
+ private static final long serialVersionUID = -6181019551463318453L;
+
+ @Inject
+ private Logger log;
+
+ /**
+ * @param whenQualifier When this event occurred (e.g.:
+ * {@link PhaseListener#beforePhase(PhaseEvent)} or
+ * {@link PhaseListener#afterPhase(PhaseEvent)})
+ * @param event The JSF PhaseEvent to be propagated
+ */
+ private void handlePhase(final AnnotationLiteral<?> whenQualifier, final PhaseEvent event)
+ {
+ Annotation phaseQualifier = null;
+
+ if (PhaseId.RESTORE_VIEW.equals(event.getPhaseId()))
+ {
+ phaseQualifier = PhaseEventBridge.RESTORE_VIEW;
+ }
+ else if (PhaseId.PROCESS_VALIDATIONS.equals(event.getPhaseId()))
+ {
+ phaseQualifier = PhaseEventBridge.PROCESS_VALIDATIONS;
+ }
+ else if (PhaseId.APPLY_REQUEST_VALUES.equals(event.getPhaseId()))
+ {
+ phaseQualifier = PhaseEventBridge.APPLY_REQUEST_VALUES;
+ }
+ else if (PhaseId.INVOKE_APPLICATION.equals(event.getPhaseId()))
+ {
+ phaseQualifier = PhaseEventBridge.INVOKE_APPLICATION;
+ }
+ else if (PhaseId.UPDATE_MODEL_VALUES.equals(event.getPhaseId()))
+ {
+ phaseQualifier = PhaseEventBridge.UPDATE_MODEL_VALUES;
+ }
+ else if (PhaseId.RENDER_RESPONSE.equals(event.getPhaseId()))
+ {
+ phaseQualifier = PhaseEventBridge.RENDER_RESPONSE;
+ }
+ else
+ {
+ log.error("Unknown JSF PhaseId detected during CDI event broadcasting");
+ }
+
+ /*
+ * This propagates the event to CDI
+ */
+ getBeanManager().fireEvent(event, new Annotation[] { whenQualifier, phaseQualifier });
+ getBeanManager().fireEvent(event, new Annotation[] { whenQualifier, PhaseEventBridge.ANY_PHASE });
+ }
+
+ public void afterPhase(final PhaseEvent e)
+ {
+ handlePhase(AFTER, e);
+ }
+
+ public void beforePhase(final PhaseEvent e)
+ {
+ handlePhase(BEFORE, e);
+ }
+
+ public PhaseId getPhaseId()
+ {
+ return PhaseId.ANY_PHASE;
+ }
+
+ /*
+ * Annotation Literal Constants
+ */
+ private static final AnnotationLiteral<Before> BEFORE = new AnnotationLiteral<Before>()
+ {
+ private static final long serialVersionUID = -1610281796509557441L;
+ };
+
+ private static final AnnotationLiteral<After> AFTER = new AnnotationLiteral<After>()
+ {
+ private static final long serialVersionUID = 5121252401235504952L;
+ };
+
+ private static final AnnotationLiteral<AnyPhase> ANY_PHASE = new AnnotationLiteral<AnyPhase>()
+ {
+ private static final long serialVersionUID = 6334015723435615561L;
+ };
+
+ private static final AnnotationLiteral<RestoreView> RESTORE_VIEW = new AnnotationLiteral<RestoreView>()
+ {
+ private static final long serialVersionUID = 8812020629644833820L;
+ };
+
+ private static final AnnotationLiteral<ProcessValidations> PROCESS_VALIDATIONS = new AnnotationLiteral<ProcessValidations>()
+ {
+ private static final long serialVersionUID = 8637149472340997800L;
+ };
+
+ private static final AnnotationLiteral<ApplyRequestValues> APPLY_REQUEST_VALUES = new AnnotationLiteral<ApplyRequestValues>()
+ {
+ private static final long serialVersionUID = 8558744089046159077L;
+ };
+
+ private static final AnnotationLiteral<InvokeApplication> INVOKE_APPLICATION = new AnnotationLiteral<InvokeApplication>()
+ {
+ private static final long serialVersionUID = 3161037426109802030L;
+ };
+
+ private static final AnnotationLiteral<UpdateModelValues> UPDATE_MODEL_VALUES = new AnnotationLiteral<UpdateModelValues>()
+ {
+ private static final long serialVersionUID = -2714189905299700793L;
+ };
+
+ private static final AnnotationLiteral<RenderResponse> RENDER_RESPONSE = new AnnotationLiteral<RenderResponse>()
+ {
+ private static final long serialVersionUID = -8708300190197778734L;
+ };
+
+}
Deleted: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/PhaseEventListener.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/PhaseEventListener.java 2010-03-23 01:15:48 UTC (rev 12244)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/PhaseEventListener.java 2010-03-23 01:52:45 UTC (rev 12245)
@@ -1,100 +0,0 @@
-package org.jboss.seam.faces.event;
-
-import java.lang.annotation.Annotation;
-
-import javax.enterprise.util.AnnotationLiteral;
-import javax.faces.event.PhaseEvent;
-import javax.faces.event.PhaseId;
-import javax.faces.event.PhaseListener;
-
-import org.jboss.seam.faces.event.qualifier.After;
-import org.jboss.seam.faces.event.qualifier.ApplyRequestValues;
-import org.jboss.seam.faces.event.qualifier.Before;
-import org.jboss.seam.faces.event.qualifier.InvokeApplication;
-import org.jboss.seam.faces.event.qualifier.ProcessValidations;
-import org.jboss.seam.faces.event.qualifier.RenderResponse;
-import org.jboss.seam.faces.event.qualifier.RestoreView;
-import org.jboss.seam.faces.event.qualifier.UpdateModelValues;
-
-public class PhaseEventListener extends GenericEventListener implements PhaseListener
-{
- private static final long serialVersionUID = 1L;
-
- private enum When
- {
- BEFORE, AFTER
- };
-
- @SuppressWarnings("serial")
- private void handlePhase(When when, PhaseEvent e)
- {
- Annotation whenAnnotation = null;
- Annotation phaseAnnotation = null;
- switch (when)
- {
- case BEFORE:
- whenAnnotation = new AnnotationLiteral<Before>()
- {
- };
- break;
- case AFTER:
- whenAnnotation = new AnnotationLiteral<After>()
- {
- };
- break;
- }
- if (e.getPhaseId() == PhaseId.APPLY_REQUEST_VALUES)
- {
- phaseAnnotation = new AnnotationLiteral<ApplyRequestValues>()
- {
- };
- }
- else if (e.getPhaseId() == PhaseId.INVOKE_APPLICATION)
- {
- phaseAnnotation = new AnnotationLiteral<InvokeApplication>()
- {
- };
- }
- else if (e.getPhaseId() == PhaseId.PROCESS_VALIDATIONS)
- {
- phaseAnnotation = new AnnotationLiteral<ProcessValidations>()
- {
- };
- }
- else if (e.getPhaseId() == PhaseId.RENDER_RESPONSE)
- {
- phaseAnnotation = new AnnotationLiteral<RenderResponse>()
- {
- };
- }
- else if (e.getPhaseId() == PhaseId.RESTORE_VIEW)
- {
- phaseAnnotation = new AnnotationLiteral<RestoreView>()
- {
- };
- }
- else if (e.getPhaseId() == PhaseId.UPDATE_MODEL_VALUES)
- {
- phaseAnnotation = new AnnotationLiteral<UpdateModelValues>()
- {
- };
- }
- getBeanManager().fireEvent(e, new Annotation[] { whenAnnotation, phaseAnnotation });
- }
-
- public void afterPhase(PhaseEvent e)
- {
- handlePhase(When.AFTER, e);
- }
-
- public void beforePhase(PhaseEvent e)
- {
- handlePhase(When.BEFORE, e);
- }
-
- public PhaseId getPhaseId()
- {
- return PhaseId.ANY_PHASE;
- }
-
-}
Copied: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/SystemEventBridge.java (from rev 12236, modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/SystemEventListener.java)
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/SystemEventBridge.java (rev 0)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/SystemEventBridge.java 2010-03-23 01:52:45 UTC (rev 12245)
@@ -0,0 +1,120 @@
+package org.jboss.seam.faces.event;
+
+import java.lang.annotation.Annotation;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.event.Observes;
+import javax.enterprise.util.AnnotationLiteral;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.ComponentSystemEvent;
+import javax.faces.event.ExceptionQueuedEvent;
+import javax.faces.event.PostConstructApplicationEvent;
+import javax.faces.event.PostConstructCustomScopeEvent;
+import javax.faces.event.PreDestroyApplicationEvent;
+import javax.faces.event.PreDestroyCustomScopeEvent;
+import javax.faces.event.SystemEvent;
+import javax.faces.event.SystemEventListener;
+
+import org.jboss.seam.faces.SeamFacesException;
+import org.jboss.seam.faces.cdi.BeanManagerAware;
+
+/**
+ * A SystemEventListener used to bridge JSF system events to the CDI event
+ * model.
+ * <p>
+ *
+ * For each JSF system event (e.g: {@link PostConstructApplicationEvent}, a
+ * corresponding Seam CDI event will be fired.
+ * <p>
+ *
+ * Event listeners can be registered by observing the appropriate Seam CDI event
+ * (see @{@link Observes}):
+ * <p>
+ * <b>For example:</b>
+ * <p>
+ * <code>
+ * public void listener(@Observes org.jboss.seam.faces.event.qualifier.ExceptionQueuedEvent event)
+ * {
+ * //do something
+ * }
+ * </code>
+ *
+ */
+@ApplicationScoped
+public class SystemEventBridge extends BeanManagerAware implements SystemEventListener
+{
+
+ public boolean isListenerForSource(final Object source)
+ {
+ return true;
+ }
+
+ public void processEvent(final SystemEvent e) throws AbortProcessingException
+ {
+ Object payload = e.getClass().cast(e);
+ Annotation qualifier = null;
+
+ if (e instanceof ComponentSystemEvent)
+ {
+ qualifier = COMPONENT_SYSTEM_EVENT;
+ }
+ else if (e instanceof ExceptionQueuedEvent)
+ {
+ qualifier = EXCEPTION_QUEUED_EVENT;
+ }
+ else if (e instanceof PostConstructApplicationEvent)
+ {
+ qualifier = POST_CONSTRUCT_APPLICATION_EVENT;
+ }
+ else if (e instanceof PostConstructCustomScopeEvent)
+ {
+ qualifier = POST_CONSTRUCT_CUSTOM_SCOPE_EVENT;
+ }
+ else if (e instanceof PreDestroyApplicationEvent)
+ {
+ qualifier = PRE_DESTROY_APPLICATION_EVENT;
+ }
+ else if (e instanceof PreDestroyCustomScopeEvent)
+ {
+ qualifier = PRE_DESTROY_CUSTOM_SCOPE_EVENT;
+ }
+ else
+ {
+ throw new SeamFacesException("Unknown JSF System Event detected during CDI event broadcasting");
+ }
+
+ /*
+ * This propagates the event to CDI
+ */
+ getBeanManager().fireEvent(payload, qualifier);
+ }
+
+ /*
+ * System Event Annotations
+ */
+ private static final AnnotationLiteral<org.jboss.seam.faces.event.qualifier.PreDestroyCustomScopeEvent> PRE_DESTROY_CUSTOM_SCOPE_EVENT = new AnnotationLiteral<org.jboss.seam.faces.event.qualifier.PreDestroyCustomScopeEvent>()
+ {
+ private static final long serialVersionUID = -7243409955575081242L;
+ };
+ private static final AnnotationLiteral<org.jboss.seam.faces.event.qualifier.PreDestroyApplicationEvent> PRE_DESTROY_APPLICATION_EVENT = new AnnotationLiteral<org.jboss.seam.faces.event.qualifier.PreDestroyApplicationEvent>()
+ {
+ private static final long serialVersionUID = -7448942843812054204L;
+ };
+ private static final AnnotationLiteral<org.jboss.seam.faces.event.qualifier.PostConstructCustomScopeEvent> POST_CONSTRUCT_CUSTOM_SCOPE_EVENT = new AnnotationLiteral<org.jboss.seam.faces.event.qualifier.PostConstructCustomScopeEvent>()
+ {
+ private static final long serialVersionUID = 6194794712139598271L;
+ };
+ private static final AnnotationLiteral<org.jboss.seam.faces.event.qualifier.PostConstructApplicationEvent> POST_CONSTRUCT_APPLICATION_EVENT = new AnnotationLiteral<org.jboss.seam.faces.event.qualifier.PostConstructApplicationEvent>()
+ {
+ private static final long serialVersionUID = -7119316486394672512L;
+ };
+ private static final AnnotationLiteral<org.jboss.seam.faces.event.qualifier.ExceptionQueuedEvent> EXCEPTION_QUEUED_EVENT = new AnnotationLiteral<org.jboss.seam.faces.event.qualifier.ExceptionQueuedEvent>()
+ {
+ private static final long serialVersionUID = -2694169811275854595L;
+ };
+ private static final AnnotationLiteral<org.jboss.seam.faces.event.qualifier.ComponentSystemEvent> COMPONENT_SYSTEM_EVENT = new AnnotationLiteral<org.jboss.seam.faces.event.qualifier.ComponentSystemEvent>()
+ {
+ private static final long serialVersionUID = -8018221003951485295L;
+ };
+
+}
Deleted: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/SystemEventListener.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/SystemEventListener.java 2010-03-23 01:15:48 UTC (rev 12244)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/SystemEventListener.java 2010-03-23 01:52:45 UTC (rev 12245)
@@ -1,66 +0,0 @@
-package org.jboss.seam.faces.event;
-
-import java.lang.annotation.Annotation;
-
-import javax.enterprise.util.AnnotationLiteral;
-import javax.faces.event.AbortProcessingException;
-import javax.faces.event.ComponentSystemEvent;
-import javax.faces.event.ExceptionQueuedEvent;
-import javax.faces.event.PostConstructApplicationEvent;
-import javax.faces.event.PostConstructCustomScopeEvent;
-import javax.faces.event.PreDestroyApplicationEvent;
-import javax.faces.event.PreDestroyCustomScopeEvent;
-import javax.faces.event.SystemEvent;
-
-public class SystemEventListener extends GenericEventListener implements javax.faces.event.SystemEventListener
-{
- public boolean isListenerForSource(Object source)
- {
- return true;
- }
-
- @SuppressWarnings("serial")
- public void processEvent(SystemEvent e) throws AbortProcessingException
- {
- Object payload = e.getClass().cast(e);
- Annotation qualifier = null;
- if (e instanceof ComponentSystemEvent)
- {
- qualifier = new AnnotationLiteral<org.jboss.seam.faces.event.qualifier.ComponentSystemEvent>()
- {
- };
- }
- else if (e instanceof ExceptionQueuedEvent)
- {
- qualifier = new AnnotationLiteral<org.jboss.seam.faces.event.qualifier.ExceptionQueuedEvent>()
- {
- };
- }
- else if (e instanceof PostConstructApplicationEvent)
- {
- qualifier = new AnnotationLiteral<org.jboss.seam.faces.event.qualifier.PostConstructApplicationEvent>()
- {
- };
- }
- else if (e instanceof PostConstructCustomScopeEvent)
- {
- qualifier = new AnnotationLiteral<org.jboss.seam.faces.event.qualifier.PostConstructCustomScopeEvent>()
- {
- };
- }
- else if (e instanceof PreDestroyApplicationEvent)
- {
- qualifier = new AnnotationLiteral<org.jboss.seam.faces.event.qualifier.PreDestroyApplicationEvent>()
- {
- };
- }
- else if (e instanceof PreDestroyCustomScopeEvent)
- {
- qualifier = new AnnotationLiteral<org.jboss.seam.faces.event.qualifier.PreDestroyCustomScopeEvent>()
- {
- };
- }
- getBeanManager().fireEvent(payload, qualifier);
- }
-
-}
Added: modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/AnyPhase.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/AnyPhase.java (rev 0)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/event/qualifier/AnyPhase.java 2010-03-23 01:52:45 UTC (rev 12245)
@@ -0,0 +1,20 @@
+package org.jboss.seam.faces.event.qualifier;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+/**
+ * @author <a href="mailto:lincolnbaxter@gmail.com>Lincoln Baxter, III</a>
+ */
+@Qualifier
+@Target( { FIELD, PARAMETER })
+@Retention(RUNTIME)
+public @interface AnyPhase
+{
+}
\ No newline at end of file
Modified: modules/faces/trunk/src/main/resources/META-INF/faces-config.xml
===================================================================
--- modules/faces/trunk/src/main/resources/META-INF/faces-config.xml 2010-03-23 01:15:48 UTC (rev 12244)
+++ modules/faces/trunk/src/main/resources/META-INF/faces-config.xml 2010-03-23 01:52:45 UTC (rev 12245)
@@ -15,67 +15,36 @@
<lifecycle>
<phase-listener>org.jboss.seam.faces.context.FlashScopedContext</phase-listener>
- <phase-listener>org.jboss.seam.faces.event.PhaseEventListener</phase-listener>
- </lifecycle>
+ <phase-listener>org.jboss.seam.faces.event.DelegatingPhaseListener</phase-listener>
+ </lifecycle>
<application>
<system-event-listener>
- <system-event-listener-class>org.jboss.seam.faces.event.SystemEventListener</system-event-listener-class>
+ <system-event-listener-class>org.jboss.seam.faces.event.DelegatingSystemEventListener</system-event-listener-class>
<system-event-class>javax.faces.event.ComponentSystemEvent</system-event-class>
</system-event-listener>
<system-event-listener>
- <system-event-listener-class>org.jboss.seam.faces.event.SystemEventListener</system-event-listener-class>
+ <system-event-listener-class>org.jboss.seam.faces.event.DelegatingSystemEventListener</system-event-listener-class>
<system-event-class>javax.faces.event.ExceptionQueuedEvent</system-event-class>
</system-event-listener>
<system-event-listener>
- <system-event-listener-class>org.jboss.seam.faces.event.SystemEventListener</system-event-listener-class>
+ <system-event-listener-class>org.jboss.seam.faces.event.DelegatingSystemEventListener</system-event-listener-class>
<system-event-class>javax.faces.event.PostConstructApplicationEvent</system-event-class>
</system-event-listener>
<system-event-listener>
- <system-event-listener-class>org.jboss.seam.faces.event.SystemEventListener</system-event-listener-class>
+ <system-event-listener-class>org.jboss.seam.faces.event.DelegatingSystemEventListener</system-event-listener-class>
<system-event-class>javax.faces.event.PostConstructCustomScopeEvent</system-event-class>
</system-event-listener>
<system-event-listener>
- <system-event-listener-class>org.jboss.seam.faces.event.SystemEventListener</system-event-listener-class>
+ <system-event-listener-class>org.jboss.seam.faces.event.DelegatingSystemEventListener</system-event-listener-class>
<system-event-class>javax.faces.event.PreDestroyApplicationEvent</system-event-class>
</system-event-listener>
<system-event-listener>
- <system-event-listener-class>org.jboss.seam.faces.event.SystemEventListener</system-event-listener-class>
+ <system-event-listener-class>org.jboss.seam.faces.event.DelegatingSystemEventListener</system-event-listener-class>
<system-event-class>javax.faces.event.PreDestroyCustomScopeEvent</system-event-class>
</system-event-listener>
</application>
- <!--
- <factory>
- <application-factory>org.jboss.seam.faces.application.SeamApplicationFactory</application-factory>
- </factory>
-
- <application>
- <message-bundle>org.jboss.seam.international.SeamResourceBundleAdapter</message-bundle>
- <view-handler>org.jboss.seam.faces.application.SeamViewHandler</view-handler>
- <el-resolver>org.jboss.seam.el.SeamELResolver</el-resolver>
- <el-resolver>org.jboss.seam.faces.el.SeamFacesELResolver</el-resolver>
- <system-event-listener>
- <system-event-listener-class>org.jboss.seam.faces.lifecycle.SeamPreRenderViewListener</system-event-listener-class>
- <system-event-class>javax.faces.event.PreRenderViewEvent</system-event-class>
- </system-event-listener>
- </application>
-
- <lifecycle>
- <phase-listener>org.jboss.seam.faces.lifecycle.SeamPhaseListener</phase-listener>
- </lifecycle>
-
- <component>
- <component-type>org.jboss.seam.faces.Import</component-type>
- <component-class>org.jboss.seam.faces.component.UIImport</component-class>
- </component>
-
- <component>
- <component-type>org.jboss.seam.faces.RestrictView</component-type>
- <component-class>org.jboss.seam.faces.component.UIRestrictView</component-class>
- </component>
- -->
-
<component>
<component-type>org.jboss.seam.faces.ViewAction</component-type>
<component-class>org.jboss.seam.faces.component.UIViewAction</component-class>
Added: modules/faces/trunk/src/test/java/org/jboss/seam/faces/MockLogger.java
===================================================================
--- modules/faces/trunk/src/test/java/org/jboss/seam/faces/MockLogger.java (rev 0)
+++ modules/faces/trunk/src/test/java/org/jboss/seam/faces/MockLogger.java 2010-03-23 01:52:45 UTC (rev 12245)
@@ -0,0 +1,271 @@
+package org.jboss.seam.faces;
+
+import org.slf4j.Logger;
+import org.slf4j.Marker;
+
+/**
+ * Provide a completely empty logger implementation for Unit Tests. This entire
+ * class is a no-op; it does <i>nothing</i>.
+ *
+ * @author <a href="mailto:lincolnbaxter@gmail.com>Lincoln Baxter, III</a>
+ *
+ */
+public class MockLogger implements Logger
+{
+
+ public void debug(final String arg0)
+ {
+ }
+
+ public void debug(final String arg0, final Object arg1)
+ {
+ }
+
+ public void debug(final String arg0, final Object[] arg1)
+ {
+ }
+
+ public void debug(final String arg0, final Throwable arg1)
+ {
+ }
+
+ public void debug(final Marker arg0, final String arg1)
+ {
+ }
+
+ public void debug(final String arg0, final Object arg1, final Object arg2)
+ {
+ }
+
+ public void debug(final Marker arg0, final String arg1, final Object arg2)
+ {
+ }
+
+ public void debug(final Marker arg0, final String arg1, final Object[] arg2)
+ {
+ }
+
+ public void debug(final Marker arg0, final String arg1, final Throwable arg2)
+ {
+ }
+
+ public void debug(final Marker arg0, final String arg1, final Object arg2, final Object arg3)
+ {
+ }
+
+ public void error(final String arg0)
+ {
+ }
+
+ public void error(final String arg0, final Object arg1)
+ {
+ }
+
+ public void error(final String arg0, final Object[] arg1)
+ {
+ }
+
+ public void error(final String arg0, final Throwable arg1)
+ {
+ }
+
+ public void error(final Marker arg0, final String arg1)
+ {
+ }
+
+ public void error(final String arg0, final Object arg1, final Object arg2)
+ {
+ }
+
+ public void error(final Marker arg0, final String arg1, final Object arg2)
+ {
+ }
+
+ public void error(final Marker arg0, final String arg1, final Object[] arg2)
+ {
+ }
+
+ public void error(final Marker arg0, final String arg1, final Throwable arg2)
+ {
+ }
+
+ public void error(final Marker arg0, final String arg1, final Object arg2, final Object arg3)
+ {
+ }
+
+ public String getName()
+ {
+ return null;
+ }
+
+ public void info(final String arg0)
+ {
+ }
+
+ public void info(final String arg0, final Object arg1)
+ {
+ }
+
+ public void info(final String arg0, final Object[] arg1)
+ {
+ }
+
+ public void info(final String arg0, final Throwable arg1)
+ {
+ }
+
+ public void info(final Marker arg0, final String arg1)
+ {
+ }
+
+ public void info(final String arg0, final Object arg1, final Object arg2)
+ {
+ }
+
+ public void info(final Marker arg0, final String arg1, final Object arg2)
+ {
+ }
+
+ public void info(final Marker arg0, final String arg1, final Object[] arg2)
+ {
+ }
+
+ public void info(final Marker arg0, final String arg1, final Throwable arg2)
+ {
+ }
+
+ public void info(final Marker arg0, final String arg1, final Object arg2, final Object arg3)
+ {
+ }
+
+ public boolean isDebugEnabled()
+ {
+ return false;
+ }
+
+ public boolean isDebugEnabled(final Marker arg0)
+ {
+ return false;
+ }
+
+ public boolean isErrorEnabled()
+ {
+ return false;
+ }
+
+ public boolean isErrorEnabled(final Marker arg0)
+ {
+ return false;
+ }
+
+ public boolean isInfoEnabled()
+ {
+ return false;
+ }
+
+ public boolean isInfoEnabled(final Marker arg0)
+ {
+ return false;
+ }
+
+ public boolean isTraceEnabled()
+ {
+ return false;
+ }
+
+ public boolean isTraceEnabled(final Marker arg0)
+ {
+ return false;
+ }
+
+ public boolean isWarnEnabled()
+ {
+ return false;
+ }
+
+ public boolean isWarnEnabled(final Marker arg0)
+ {
+ return false;
+ }
+
+ public void trace(final String arg0)
+ {
+ }
+
+ public void trace(final String arg0, final Object arg1)
+ {
+ }
+
+ public void trace(final String arg0, final Object[] arg1)
+ {
+ }
+
+ public void trace(final String arg0, final Throwable arg1)
+ {
+ }
+
+ public void trace(final Marker arg0, final String arg1)
+ {
+ }
+
+ public void trace(final String arg0, final Object arg1, final Object arg2)
+ {
+ }
+
+ public void trace(final Marker arg0, final String arg1, final Object arg2)
+ {
+ }
+
+ public void trace(final Marker arg0, final String arg1, final Object[] arg2)
+ {
+ }
+
+ public void trace(final Marker arg0, final String arg1, final Throwable arg2)
+ {
+ }
+
+ public void trace(final Marker arg0, final String arg1, final Object arg2, final Object arg3)
+ {
+ }
+
+ public void warn(final String arg0)
+ {
+ }
+
+ public void warn(final String arg0, final Object arg1)
+ {
+ }
+
+ public void warn(final String arg0, final Object[] arg1)
+ {
+ }
+
+ public void warn(final String arg0, final Throwable arg1)
+ {
+ }
+
+ public void warn(final Marker arg0, final String arg1)
+ {
+ }
+
+ public void warn(final String arg0, final Object arg1, final Object arg2)
+ {
+ }
+
+ public void warn(final Marker arg0, final String arg1, final Object arg2)
+ {
+ }
+
+ public void warn(final Marker arg0, final String arg1, final Object[] arg2)
+ {
+ }
+
+ public void warn(final Marker arg0, final String arg1, final Throwable arg2)
+ {
+ }
+
+ public void warn(final Marker arg0, final String arg1, final Object arg2, final Object arg3)
+ {
+ }
+
+}
Copied: modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/PhaseEventBridgeTest.java (from rev 12236, modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/PhaseListenerTests.java)
===================================================================
--- modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/PhaseEventBridgeTest.java (rev 0)
+++ modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/PhaseEventBridgeTest.java 2010-03-23 01:52:45 UTC (rev 12245)
@@ -0,0 +1,139 @@
+package org.jboss.seam.faces.event;
+
+import static org.junit.Assert.assertEquals;
+
+import javax.faces.event.PhaseEvent;
+import javax.faces.event.PhaseId;
+import javax.inject.Inject;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.faces.MockLogger;
+import org.jboss.seam.faces.cdi.BeanManagerAware;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.Archives;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
+import org.jboss.test.faces.mock.context.MockFacesContext;
+import org.jboss.test.faces.mock.lifecycle.MockLifecycle;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class PhaseEventBridgeTest
+{
+ @Deployment
+ public static JavaArchive createTestArchive()
+ {
+ return Archives.create("test.jar", JavaArchive.class).addClasses(PhaseEventObserver.class, PhaseEventBridge.class, BeanManagerAware.class, MockLogger.class).addManifestResource(new ByteArrayAsset(new byte[0]), ArchivePaths.create("beans.xml"));
+ }
+
+ @Inject
+ PhaseEventBridge phaseEventBridge;
+
+ private final MockFacesContext facesContext = new MockFacesContext();
+ private final MockLifecycle lifecycle = new MockLifecycle();
+
+ @Test
+ public void testBeforeAnyPhaseObserver()
+ {
+ phaseEventBridge.beforePhase(new PhaseEvent(facesContext, PhaseId.RENDER_RESPONSE, lifecycle));
+ phaseEventBridge.beforePhase(new PhaseEvent(facesContext, PhaseId.APPLY_REQUEST_VALUES, lifecycle));
+ phaseEventBridge.beforePhase(new PhaseEvent(facesContext, PhaseId.PROCESS_VALIDATIONS, lifecycle));
+ assertEquals(3, PhaseEventObserver.beforeAnyPhaseCount);
+ }
+
+ @Test
+ public void testAfterAnyPhaseObserver()
+ {
+ phaseEventBridge.afterPhase(new PhaseEvent(facesContext, PhaseId.RENDER_RESPONSE, lifecycle));
+ phaseEventBridge.afterPhase(new PhaseEvent(facesContext, PhaseId.APPLY_REQUEST_VALUES, lifecycle));
+ phaseEventBridge.afterPhase(new PhaseEvent(facesContext, PhaseId.PROCESS_VALIDATIONS, lifecycle));
+ assertEquals(3, PhaseEventObserver.afterAnyPhaseCount);
+ }
+
+ @Test
+ public void testBeforeRenderResponseObserver()
+ {
+ phaseEventBridge.beforePhase(new PhaseEvent(facesContext, PhaseId.RENDER_RESPONSE, lifecycle));
+ assert PhaseEventObserver.observeBeforeRenderResponse;
+ }
+
+ @Test
+ public void testAfterRenderResponseObserver()
+ {
+ phaseEventBridge.afterPhase(new PhaseEvent(facesContext, PhaseId.RENDER_RESPONSE, lifecycle));
+ assert PhaseEventObserver.observeAfterRenderResponse;
+ }
+
+ @Test
+ public void testBeforeApplyRequestValuesObserver()
+ {
+ phaseEventBridge.beforePhase(new PhaseEvent(facesContext, PhaseId.APPLY_REQUEST_VALUES, lifecycle));
+ assert PhaseEventObserver.observeBeforeApplyRequestValues;
+ }
+
+ @Test
+ public void testAfterApplyRequestValuesObserver()
+ {
+ phaseEventBridge.afterPhase(new PhaseEvent(facesContext, PhaseId.APPLY_REQUEST_VALUES, lifecycle));
+ assert PhaseEventObserver.observeAfterApplyRequestValues;
+ }
+
+ @Test
+ public void testBeforeInvokeApplicationObserver()
+ {
+ phaseEventBridge.beforePhase(new PhaseEvent(facesContext, PhaseId.INVOKE_APPLICATION, lifecycle));
+ assert PhaseEventObserver.observeBeforeInvokeApplication;
+ }
+
+ @Test
+ public void testAfterInvokeApplicationObserver()
+ {
+ phaseEventBridge.afterPhase(new PhaseEvent(facesContext, PhaseId.INVOKE_APPLICATION, lifecycle));
+ assert PhaseEventObserver.observeAfterInvokeApplication;
+ }
+
+ @Test
+ public void testBeforeProcessValidationsObserver()
+ {
+ phaseEventBridge.beforePhase(new PhaseEvent(facesContext, PhaseId.PROCESS_VALIDATIONS, lifecycle));
+ assert PhaseEventObserver.observeBeforeProcessValidations;
+ }
+
+ @Test
+ public void testAfterProcessValidationsObserver()
+ {
+ phaseEventBridge.afterPhase(new PhaseEvent(facesContext, PhaseId.PROCESS_VALIDATIONS, lifecycle));
+ assert PhaseEventObserver.observeAfterProcessValidations;
+ }
+
+ @Test
+ public void testBeforeRestoreViewObserver()
+ {
+ phaseEventBridge.beforePhase(new PhaseEvent(facesContext, PhaseId.RESTORE_VIEW, lifecycle));
+ assert PhaseEventObserver.observeBeforeRestoreView;
+ }
+
+ @Test
+ public void testAfterRestoreViewObserver()
+ {
+ phaseEventBridge.afterPhase(new PhaseEvent(facesContext, PhaseId.RESTORE_VIEW, lifecycle));
+ assert PhaseEventObserver.observeAfterRestoreView;
+ }
+
+ @Test
+ public void testBeforeUpdateModelValuesObserver()
+ {
+ phaseEventBridge.beforePhase(new PhaseEvent(facesContext, PhaseId.UPDATE_MODEL_VALUES, lifecycle));
+ assert PhaseEventObserver.observeBeforeUpdateModelValues;
+ }
+
+ @Test
+ public void testAfterUpdateModelValuesObserver()
+ {
+ phaseEventBridge.afterPhase(new PhaseEvent(facesContext, PhaseId.UPDATE_MODEL_VALUES, lifecycle));
+ assert PhaseEventObserver.observeAfterUpdateModelValues;
+ }
+
+}
Copied: modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/PhaseEventObserver.java (from rev 12236, modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/PhaseListenerObserver.java)
===================================================================
--- modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/PhaseEventObserver.java (rev 0)
+++ modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/PhaseEventObserver.java 2010-03-23 01:52:45 UTC (rev 12245)
@@ -0,0 +1,105 @@
+package org.jboss.seam.faces.event;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.event.Observes;
+import javax.faces.event.PhaseEvent;
+
+import org.jboss.seam.faces.event.qualifier.After;
+import org.jboss.seam.faces.event.qualifier.AnyPhase;
+import org.jboss.seam.faces.event.qualifier.ApplyRequestValues;
+import org.jboss.seam.faces.event.qualifier.Before;
+import org.jboss.seam.faces.event.qualifier.InvokeApplication;
+import org.jboss.seam.faces.event.qualifier.ProcessValidations;
+import org.jboss.seam.faces.event.qualifier.RenderResponse;
+import org.jboss.seam.faces.event.qualifier.RestoreView;
+import org.jboss.seam.faces.event.qualifier.UpdateModelValues;
+
+@ApplicationScoped
+public class PhaseEventObserver
+{
+ public static boolean observeBeforeRenderResponse;
+ public static boolean observeAfterRenderResponse;
+ public static boolean observeBeforeApplyRequestValues;
+ public static boolean observeAfterApplyRequestValues;
+ public static boolean observeBeforeInvokeApplication;
+ public static boolean observeAfterInvokeApplication;
+ public static boolean observeBeforeProcessValidations;
+ public static boolean observeAfterProcessValidations;
+ public static boolean observeBeforeRestoreView;
+ public static boolean observeAfterRestoreView;
+ public static boolean observeBeforeUpdateModelValues;
+ public static boolean observeAfterUpdateModelValues;
+ public static int beforeAnyPhaseCount;
+ public static int afterAnyPhaseCount;
+
+ public void observeBeforeAnyPhase(@Observes @Before @AnyPhase final PhaseEvent e)
+ {
+ beforeAnyPhaseCount++;
+ }
+
+ public void observeAfterAnyPhase(@Observes @After @AnyPhase final PhaseEvent e)
+ {
+ afterAnyPhaseCount++;
+ }
+
+ public void observeBeforeRenderResponse(@Observes @Before @RenderResponse final PhaseEvent e)
+ {
+ PhaseEventObserver.observeBeforeRenderResponse = true;
+ }
+
+ public void observeAfterRenderResponse(@Observes @After @RenderResponse final PhaseEvent e)
+ {
+ PhaseEventObserver.observeAfterRenderResponse = true;
+ }
+
+ public void observeBeforeApplyRequestValues(@Observes @Before @ApplyRequestValues final PhaseEvent e)
+ {
+ PhaseEventObserver.observeBeforeApplyRequestValues = true;
+ }
+
+ public void observeAfterApplyRequestValues(@Observes @After @ApplyRequestValues final PhaseEvent e)
+ {
+ PhaseEventObserver.observeAfterApplyRequestValues = true;
+ }
+
+ public void observeBeforeInvokeApplication(@Observes @Before @InvokeApplication final PhaseEvent e)
+ {
+ PhaseEventObserver.observeBeforeInvokeApplication = true;
+ }
+
+ public void observeAfterInvokeApplication(@Observes @After @InvokeApplication final PhaseEvent e)
+ {
+ PhaseEventObserver.observeAfterInvokeApplication = true;
+ }
+
+ public void observeBeforeProcessValidations(@Observes @Before @ProcessValidations final PhaseEvent e)
+ {
+ PhaseEventObserver.observeBeforeProcessValidations = true;
+ }
+
+ public void observeAfterProcessValidations(@Observes @After @ProcessValidations final PhaseEvent e)
+ {
+ PhaseEventObserver.observeAfterProcessValidations = true;
+ }
+
+ public void observeBeforeRestoreView(@Observes @Before @RestoreView final PhaseEvent e)
+ {
+ PhaseEventObserver.observeBeforeRestoreView = true;
+ }
+
+ public void observeAfterRestoreView(@Observes @After @RestoreView final PhaseEvent e)
+ {
+ PhaseEventObserver.observeAfterRestoreView = true;
+ }
+
+ public void observeBeforeUpdateModelValues(@Observes @Before @UpdateModelValues final PhaseEvent e)
+ {
+ PhaseEventObserver.observeBeforeUpdateModelValues = true;
+ }
+
+ public void observeAfterUpdateModelValues(@Observes @After @UpdateModelValues final PhaseEvent e)
+ {
+ PhaseEventObserver.observeAfterUpdateModelValues = true;
+ }
+
+}
Deleted: modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/PhaseListenerObserver.java
===================================================================
--- modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/PhaseListenerObserver.java 2010-03-23 01:15:48 UTC (rev 12244)
+++ modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/PhaseListenerObserver.java 2010-03-23 01:52:45 UTC (rev 12245)
@@ -1,92 +0,0 @@
-package org.jboss.seam.faces.event;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.enterprise.event.Observes;
-import javax.faces.event.PhaseEvent;
-
-import org.jboss.seam.faces.event.qualifier.After;
-import org.jboss.seam.faces.event.qualifier.ApplyRequestValues;
-import org.jboss.seam.faces.event.qualifier.Before;
-import org.jboss.seam.faces.event.qualifier.InvokeApplication;
-import org.jboss.seam.faces.event.qualifier.ProcessValidations;
-import org.jboss.seam.faces.event.qualifier.RenderResponse;
-import org.jboss.seam.faces.event.qualifier.RestoreView;
-import org.jboss.seam.faces.event.qualifier.UpdateModelValues;
-
-@ApplicationScoped
-public class PhaseListenerObserver
-{
- public static boolean observeBeforeRenderResponse;
- public static boolean observeAfterRenderResponse;
- public static boolean observeBeforeApplyRequestValues;
- public static boolean observeAfterApplyRequestValues;
- public static boolean observeBeforeInvokeApplication;
- public static boolean observeAfterInvokeApplication;
- public static boolean observeBeforeProcessValidations;
- public static boolean observeAfterProcessValidations;
- public static boolean observeBeforeRestoreView;
- public static boolean observeAfterRestoreView;
- public static boolean observeBeforeUpdateModelValues;
- public static boolean observeAfterUpdateModelValues;
-
- public void observeBeforeRenderResponse(@Observes @Before @RenderResponse PhaseEvent e)
- {
- PhaseListenerObserver.observeBeforeRenderResponse = true;
- }
-
- public void observeAfterRenderResponse(@Observes @After @RenderResponse PhaseEvent e)
- {
- PhaseListenerObserver.observeAfterRenderResponse = true;
- }
-
- public void observeBeforeApplyRequestValues(@Observes @Before @ApplyRequestValues PhaseEvent e)
- {
- PhaseListenerObserver.observeBeforeApplyRequestValues = true;
- }
-
- public void observeAfterApplyRequestValues(@Observes @After @ApplyRequestValues PhaseEvent e)
- {
- PhaseListenerObserver.observeAfterApplyRequestValues = true;
- }
-
- public void observeBeforeInvokeApplication(@Observes @Before @InvokeApplication PhaseEvent e)
- {
- PhaseListenerObserver.observeBeforeInvokeApplication = true;
- }
-
- public void observeAfterInvokeApplication(@Observes @After @InvokeApplication PhaseEvent e)
- {
- PhaseListenerObserver.observeAfterInvokeApplication = true;
- }
-
- public void observeBeforeProcessValidations(@Observes @Before @ProcessValidations PhaseEvent e)
- {
- PhaseListenerObserver.observeBeforeProcessValidations = true;
- }
-
- public void observeAfterProcessValidations(@Observes @After @ProcessValidations PhaseEvent e)
- {
- PhaseListenerObserver.observeAfterProcessValidations = true;
- }
-
- public void observeBeforeRestoreView(@Observes @Before @RestoreView PhaseEvent e)
- {
- PhaseListenerObserver.observeBeforeRestoreView = true;
- }
-
- public void observeAfterRestoreView(@Observes @After @RestoreView PhaseEvent e)
- {
- PhaseListenerObserver.observeAfterRestoreView = true;
- }
-
- public void observeBeforeUpdateModelValues(@Observes @Before @UpdateModelValues PhaseEvent e)
- {
- PhaseListenerObserver.observeBeforeUpdateModelValues = true;
- }
-
- public void observeAfterUpdateModelValues(@Observes @After @UpdateModelValues PhaseEvent e)
- {
- PhaseListenerObserver.observeAfterUpdateModelValues = true;
- }
-
-}
Deleted: modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/PhaseListenerTests.java
===================================================================
--- modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/PhaseListenerTests.java 2010-03-23 01:15:48 UTC (rev 12244)
+++ modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/PhaseListenerTests.java 2010-03-23 01:52:45 UTC (rev 12245)
@@ -1,117 +0,0 @@
-package org.jboss.seam.faces.event;
-
-import javax.faces.event.PhaseEvent;
-import javax.faces.event.PhaseId;
-import javax.inject.Inject;
-
-import org.jboss.arquillian.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.shrinkwrap.api.ArchivePaths;
-import org.jboss.shrinkwrap.api.Archives;
-import org.jboss.shrinkwrap.api.spec.JavaArchive;
-import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
-import org.jboss.test.faces.mock.context.MockFacesContext;
-import org.jboss.test.faces.mock.lifecycle.MockLifecycle;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-(a)RunWith(Arquillian.class)
-public class PhaseListenerTests
-{
- @Deployment
- public static JavaArchive createTestArchive()
- {
- return Archives.create("test.jar", JavaArchive.class).addClasses(PhaseListenerObserver.class, PhaseEventListener.class, GenericEventListener.class).addManifestResource(new ByteArrayAsset(new byte[0]), ArchivePaths.create("beans.xml"));
- }
-
- @Inject
- PhaseEventListener phaseEventListener;
-
- private final MockFacesContext facesContext = new MockFacesContext();
- private final MockLifecycle lifecycle = new MockLifecycle();
-
- @Test
- public void testBeforeRenderResponseObserver()
- {
- phaseEventListener.beforePhase(new PhaseEvent(facesContext, PhaseId.RENDER_RESPONSE, lifecycle));
- assert PhaseListenerObserver.observeBeforeRenderResponse;
- }
-
- @Test
- public void testAfterRenderResponseObserver()
- {
- phaseEventListener.afterPhase(new PhaseEvent(facesContext, PhaseId.RENDER_RESPONSE, lifecycle));
- assert PhaseListenerObserver.observeAfterRenderResponse;
- }
-
- @Test
- public void testBeforeApplyRequestValuesObserver()
- {
- phaseEventListener.beforePhase(new PhaseEvent(facesContext, PhaseId.APPLY_REQUEST_VALUES, lifecycle));
- assert PhaseListenerObserver.observeBeforeApplyRequestValues;
- }
-
- @Test
- public void testAfterApplyRequestValuesObserver()
- {
- phaseEventListener.afterPhase(new PhaseEvent(facesContext, PhaseId.APPLY_REQUEST_VALUES, lifecycle));
- assert PhaseListenerObserver.observeAfterApplyRequestValues;
- }
-
- @Test
- public void testBeforeInvokeApplicationObserver()
- {
- phaseEventListener.beforePhase(new PhaseEvent(facesContext, PhaseId.INVOKE_APPLICATION, lifecycle));
- assert PhaseListenerObserver.observeBeforeInvokeApplication;
- }
-
- @Test
- public void testAfterInvokeApplicationObserver()
- {
- phaseEventListener.afterPhase(new PhaseEvent(facesContext, PhaseId.INVOKE_APPLICATION, lifecycle));
- assert PhaseListenerObserver.observeAfterInvokeApplication;
- }
-
- @Test
- public void testBeforeProcessValidationsObserver()
- {
- phaseEventListener.beforePhase(new PhaseEvent(facesContext, PhaseId.PROCESS_VALIDATIONS, lifecycle));
- assert PhaseListenerObserver.observeBeforeProcessValidations;
- }
-
- @Test
- public void testAfterProcessValidationsObserver()
- {
- phaseEventListener.afterPhase(new PhaseEvent(facesContext, PhaseId.PROCESS_VALIDATIONS, lifecycle));
- assert PhaseListenerObserver.observeAfterProcessValidations;
- }
-
- @Test
- public void testBeforeRestoreViewObserver()
- {
- phaseEventListener.beforePhase(new PhaseEvent(facesContext, PhaseId.RESTORE_VIEW, lifecycle));
- assert PhaseListenerObserver.observeBeforeRestoreView;
- }
-
- @Test
- public void testAfterRestoreViewObserver()
- {
- phaseEventListener.afterPhase(new PhaseEvent(facesContext, PhaseId.RESTORE_VIEW, lifecycle));
- assert PhaseListenerObserver.observeAfterRestoreView;
- }
-
- @Test
- public void testBeforeUpdateModelValuesObserver()
- {
- phaseEventListener.beforePhase(new PhaseEvent(facesContext, PhaseId.UPDATE_MODEL_VALUES, lifecycle));
- assert PhaseListenerObserver.observeBeforeUpdateModelValues;
- }
-
- @Test
- public void testAfterUpdateModelValuesObserver()
- {
- phaseEventListener.afterPhase(new PhaseEvent(facesContext, PhaseId.UPDATE_MODEL_VALUES, lifecycle));
- assert PhaseListenerObserver.observeAfterUpdateModelValues;
- }
-
-}
Copied: modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/SystemEventBridgeTest.java (from rev 12236, modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/SystemEventListenerTests.java)
===================================================================
--- modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/SystemEventBridgeTest.java (rev 0)
+++ modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/SystemEventBridgeTest.java 2010-03-23 01:52:45 UTC (rev 12245)
@@ -0,0 +1,93 @@
+package org.jboss.seam.faces.event;
+
+import java.util.HashMap;
+
+import javax.faces.event.ComponentSystemEvent;
+import javax.faces.event.ExceptionQueuedEvent;
+import javax.faces.event.ExceptionQueuedEventContext;
+import javax.faces.event.PostConstructApplicationEvent;
+import javax.faces.event.PostConstructCustomScopeEvent;
+import javax.faces.event.PreDestroyApplicationEvent;
+import javax.faces.event.PreDestroyCustomScopeEvent;
+import javax.faces.event.ScopeContext;
+import javax.inject.Inject;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.faces.cdi.BeanManagerAware;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.Archives;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
+import org.jboss.test.faces.mock.application.MockApplication;
+import org.jboss.test.faces.mock.component.MockUIComponent;
+import org.jboss.test.faces.mock.context.MockFacesContext;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class SystemEventBridgeTest
+{
+
+ @Deployment
+ public static JavaArchive createTestArchive()
+ {
+ return Archives.create("test.jar", JavaArchive.class).addClasses(SystemEventObserver.class, SystemEventBridge.class, BeanManagerAware.class).addManifestResource(new ByteArrayAsset(new byte[0]), ArchivePaths.create("beans.xml"));
+ }
+
+ @Inject
+ SystemEventBridge systemEventListener;
+
+ private final MockFacesContext facesContext = new MockFacesContext();
+ private final MockApplication application = new MockApplication();
+
+ @SuppressWarnings("serial")
+ @Test
+ public void testComponentSystemEventObserver()
+ {
+ systemEventListener.processEvent(new ComponentSystemEvent(new MockUIComponent())
+ {
+ });
+ assert SystemEventObserver.componentSystemEvent;
+ }
+
+ @Test
+ public void testExceptionQueuedEventObserver()
+ {
+ ExceptionQueuedEventContext eqec = new ExceptionQueuedEventContext(facesContext, new NullPointerException());
+ ExceptionQueuedEvent eqe = new ExceptionQueuedEvent(eqec);
+ systemEventListener.processEvent(eqe);
+ assert SystemEventObserver.excecptionQueuedEvent;
+ }
+
+ @Test
+ public void testPostConstructApplicationEventObserver()
+ {
+ systemEventListener.processEvent(new PostConstructApplicationEvent(application));
+ assert SystemEventObserver.postConstructApplicationEvent;
+ }
+
+ @Test
+ public void testPostConstructCustomScopeEvent()
+ {
+ ScopeContext sc = new ScopeContext("dummyscope", new HashMap<String, Object>());
+ systemEventListener.processEvent(new PostConstructCustomScopeEvent(sc));
+ assert SystemEventObserver.postConstructCustomScopeEvent;
+ }
+
+ @Test
+ public void testPreDestroyApplicationEventObserver()
+ {
+ systemEventListener.processEvent(new PreDestroyApplicationEvent(application));
+ assert SystemEventObserver.preDestroyApplicationEvent;
+ }
+
+ @Test
+ public void testPreDestroyCustomScopeEventObserver()
+ {
+ ScopeContext sc = new ScopeContext("dummyscope", new HashMap<String, Object>());
+ systemEventListener.processEvent(new PreDestroyCustomScopeEvent(sc));
+ assert SystemEventObserver.preDestroyCustomScopeEvent;
+ }
+
+}
Deleted: modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/SystemEventListenerTests.java
===================================================================
--- modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/SystemEventListenerTests.java 2010-03-23 01:15:48 UTC (rev 12244)
+++ modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/SystemEventListenerTests.java 2010-03-23 01:52:45 UTC (rev 12245)
@@ -1,92 +0,0 @@
-package org.jboss.seam.faces.event;
-
-import java.util.HashMap;
-
-import javax.faces.event.ComponentSystemEvent;
-import javax.faces.event.ExceptionQueuedEvent;
-import javax.faces.event.ExceptionQueuedEventContext;
-import javax.faces.event.PostConstructApplicationEvent;
-import javax.faces.event.PostConstructCustomScopeEvent;
-import javax.faces.event.PreDestroyApplicationEvent;
-import javax.faces.event.PreDestroyCustomScopeEvent;
-import javax.faces.event.ScopeContext;
-import javax.inject.Inject;
-
-import org.jboss.arquillian.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.shrinkwrap.api.ArchivePaths;
-import org.jboss.shrinkwrap.api.Archives;
-import org.jboss.shrinkwrap.api.spec.JavaArchive;
-import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
-import org.jboss.test.faces.mock.application.MockApplication;
-import org.jboss.test.faces.mock.component.MockUIComponent;
-import org.jboss.test.faces.mock.context.MockFacesContext;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-(a)RunWith(Arquillian.class)
-public class SystemEventListenerTests
-{
-
- @Deployment
- public static JavaArchive createTestArchive()
- {
- return Archives.create("test.jar", JavaArchive.class).addClasses(SystemEventObserver.class, SystemEventListener.class, GenericEventListener.class).addManifestResource(new ByteArrayAsset(new byte[0]), ArchivePaths.create("beans.xml"));
- }
-
- @Inject
- SystemEventListener systemEventListener;
-
- private final MockFacesContext facesContext = new MockFacesContext();
- private final MockApplication application = new MockApplication();
-
- @SuppressWarnings("serial")
- @Test
- public void testComponentSystemEventObserver()
- {
- systemEventListener.processEvent(new ComponentSystemEvent(new MockUIComponent())
- {
- });
- assert SystemEventObserver.componentSystemEvent;
- }
-
- @Test
- public void testExceptionQueuedEventObserver()
- {
- ExceptionQueuedEventContext eqec = new ExceptionQueuedEventContext(facesContext, new NullPointerException());
- ExceptionQueuedEvent eqe = new ExceptionQueuedEvent(eqec);
- systemEventListener.processEvent(eqe);
- assert SystemEventObserver.excecptionQueuedEvent;
- }
-
- @Test
- public void testPostConstructApplicationEventObserver()
- {
- systemEventListener.processEvent(new PostConstructApplicationEvent(application));
- assert SystemEventObserver.postConstructApplicationEvent;
- }
-
- @Test
- public void testPostConstructCustomScopeEvent()
- {
- ScopeContext sc = new ScopeContext("dummyscope", new HashMap<String, Object>());
- systemEventListener.processEvent(new PostConstructCustomScopeEvent(sc));
- assert SystemEventObserver.postConstructCustomScopeEvent;
- }
-
- @Test
- public void testPreDestroyApplicationEventObserver()
- {
- systemEventListener.processEvent(new PreDestroyApplicationEvent(application));
- assert SystemEventObserver.preDestroyApplicationEvent;
- }
-
- @Test
- public void testPreDestroyCustomScopeEventObserver()
- {
- ScopeContext sc = new ScopeContext("dummyscope", new HashMap<String, Object>());
- systemEventListener.processEvent(new PreDestroyCustomScopeEvent(sc));
- assert SystemEventObserver.preDestroyCustomScopeEvent;
- }
-
-}
14 years, 9 months