[seam-commits] Seam SVN: r12243 - in modules/servlet/trunk/src: main/java/org and 11 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Mon Mar 22 17:35:44 EDT 2010


Author: nickarls
Date: 2010-03-22 17:35:42 -0400 (Mon, 22 Mar 2010)
New Revision: 12243

Added:
   modules/servlet/trunk/src/main/java/org/
   modules/servlet/trunk/src/main/java/org/jboss/
   modules/servlet/trunk/src/main/java/org/jboss/seam/
   modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/
   modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/
   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/
   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
   modules/servlet/trunk/src/test/java/org/
   modules/servlet/trunk/src/test/java/org/jboss/
   modules/servlet/trunk/src/test/java/org/jboss/seam/
   modules/servlet/trunk/src/test/java/org/jboss/seam/faces/
   modules/servlet/trunk/src/test/java/org/jboss/seam/faces/event/
   modules/servlet/trunk/src/test/java/org/jboss/seam/faces/event/EventObserver.java
Log:
Initial commit for Servlet Event -> CDI bridge

Added: 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	                        (rev 0)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/HttpManager.java	2010-03-22 21:35:42 UTC (rev 12243)
@@ -0,0 +1,40 @@
+package org.jboss.seam.servlet.event;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.event.Observes;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletRequestEvent;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+import org.jboss.seam.servlet.event.qualifier.Initialized;
+
+ at RequestScoped
+public class HttpManager
+{
+   private HttpSession session;
+   private HttpServletRequest request;
+   private ServletContext context;
+
+   public void refresh(@Observes @Initialized ServletRequestEvent e)
+   {
+      this.request = (HttpServletRequest) e.getServletRequest();
+      session = request.getSession();
+      context = session.getServletContext();
+   }
+
+   public HttpSession getSession()
+   {
+      return session;
+   }
+
+   public HttpServletRequest getRequest()
+   {
+      return request;
+   }
+
+   public ServletContext getContext()
+   {
+      return context;
+   }
+}

Added: 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	                        (rev 0)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/ServletListener.java	2010-03-22 21:35:42 UTC (rev 12243)
@@ -0,0 +1,254 @@
+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;
+
+ at SuppressWarnings("serial")
+ at WebListener
+public class ServletListener implements HttpSessionActivationListener, HttpSessionAttributeListener, HttpSessionBindingListener, HttpSessionListener, ServletContextListener, ServletContextAttributeListener, ServletRequestListener, ServletRequestAttributeListener, AsyncListener
+{
+   @Inject
+   private 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");
+      }
+   };
+
+   public ServletListener()
+   {
+      if (beanManager == null)
+      {
+         beanManager = lookupBeanManager();
+      }
+   }
+
+   private BeanManager lookupBeanManager()
+   {
+      for (String location : beanManagerLocations)
+      {
+         try
+         {
+            return (BeanManager) new InitialContext().lookup(location);
+         }
+         catch (NamingException e)
+         {
+            // No panic, keep trying
+         }
+      }
+      // OK, panic
+      throw new IllegalArgumentException("Could not find BeanManager in " + beanManagerLocations);
+   }
+
+   private void fireEvent(Object payload, Annotation... qualifiers)
+   {
+      System.out.println("Fired event " + payload + " with " + qualifiers);
+      beanManager.fireEvent(payload, qualifiers);
+   }
+
+   public void sessionDidActivate(HttpSessionEvent e)
+   {
+      fireEvent(e, new AnnotationLiteral<DidActivate>()
+      {
+      });
+   }
+
+   public void sessionWillPassivate(HttpSessionEvent e)
+   {
+      fireEvent(e, new AnnotationLiteral<WillPassivate>()
+      {
+      });
+   }
+
+   public void attributeAdded(HttpSessionBindingEvent e)
+   {
+      fireEvent(e, new AnnotationLiteral<AttributeAdded>()
+      {
+      });
+   }
+
+   public void attributeRemoved(HttpSessionBindingEvent e)
+   {
+      fireEvent(e, new AnnotationLiteral<AttributeRemoved>()
+      {
+      });
+   }
+
+   public void attributeReplaced(HttpSessionBindingEvent e)
+   {
+      fireEvent(e, new AnnotationLiteral<AttributeReplaced>()
+      {
+      });
+   }
+
+   public void valueBound(HttpSessionBindingEvent e)
+   {
+      fireEvent(e, new AnnotationLiteral<ValueBound>()
+      {
+      });
+   }
+
+   public void valueUnbound(HttpSessionBindingEvent e)
+   {
+      fireEvent(e, new AnnotationLiteral<ValueUnbound>()
+      {
+      });
+   }
+
+   public void sessionCreated(HttpSessionEvent e)
+   {
+      fireEvent(e, new AnnotationLiteral<Created>()
+      {
+      });
+   }
+
+   public void sessionDestroyed(HttpSessionEvent e)
+   {
+      fireEvent(e, new AnnotationLiteral<Destroyed>()
+      {
+      });
+   }
+
+   public void contextDestroyed(ServletContextEvent e)
+   {
+      fireEvent(e, new AnnotationLiteral<Destroyed>()
+      {
+      });
+   }
+
+   public void contextInitialized(ServletContextEvent e)
+   {
+      fireEvent(e, new AnnotationLiteral<Initialized>()
+      {
+      });
+   }
+
+   public void attributeAdded(ServletContextAttributeEvent e)
+   {
+      fireEvent(e, new AnnotationLiteral<AttributeAdded>()
+      {
+      });
+   }
+
+   public void attributeRemoved(ServletContextAttributeEvent e)
+   {
+      fireEvent(e, new AnnotationLiteral<AttributeRemoved>()
+      {
+      });
+   }
+
+   public void attributeReplaced(ServletContextAttributeEvent e)
+   {
+      fireEvent(e, new AnnotationLiteral<AttributeReplaced>()
+      {
+      });
+   }
+
+   public void requestDestroyed(ServletRequestEvent e)
+   {
+      fireEvent(e, new AnnotationLiteral<Destroyed>()
+      {
+      });
+   }
+
+   public void requestInitialized(ServletRequestEvent e)
+   {
+      fireEvent(e, new AnnotationLiteral<Initialized>()
+      {
+      });
+   }
+
+   public void attributeAdded(ServletRequestAttributeEvent e)
+   {
+      fireEvent(e, new AnnotationLiteral<AttributeAdded>()
+      {
+      });
+   }
+
+   public void attributeRemoved(ServletRequestAttributeEvent e)
+   {
+      fireEvent(e, new AnnotationLiteral<AttributeRemoved>()
+      {
+      });
+   }
+
+   public void attributeReplaced(ServletRequestAttributeEvent e)
+   {
+      fireEvent(e, new AnnotationLiteral<AttributeReplaced>()
+      {
+      });
+   }
+
+   public void onComplete(AsyncEvent e) throws IOException
+   {
+      fireEvent(e, new AnnotationLiteral<Complete>()
+      {
+      });
+   }
+
+   public void onError(AsyncEvent e) throws IOException
+   {
+      fireEvent(e, new AnnotationLiteral<Error>()
+      {
+      });
+   }
+
+   public void onStartAsync(AsyncEvent e) throws IOException
+   {
+      fireEvent(e, new AnnotationLiteral<StartAsync>()
+      {
+      });
+   }
+
+   public void onTimeout(AsyncEvent e) throws IOException
+   {
+      fireEvent(e, new AnnotationLiteral<Timeout>()
+      {
+      });
+   }
+
+}

Added: 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	                        (rev 0)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/AttributeAdded.java	2010-03-22 21:35:42 UTC (rev 12243)
@@ -0,0 +1,14 @@
+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 javax.inject.Qualifier;
+
+ at Qualifier
+ at Target({FIELD, PARAMETER})
+ at Retention(RUNTIME)
+public @interface AttributeAdded {}
\ No newline at end of file

Added: 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	                        (rev 0)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/AttributeRemoved.java	2010-03-22 21:35:42 UTC (rev 12243)
@@ -0,0 +1,14 @@
+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 javax.inject.Qualifier;
+
+ at Qualifier
+ at Target({FIELD, PARAMETER})
+ at Retention(RUNTIME)
+public @interface AttributeRemoved {}
\ No newline at end of file

Added: 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	                        (rev 0)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/AttributeReplaced.java	2010-03-22 21:35:42 UTC (rev 12243)
@@ -0,0 +1,14 @@
+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 javax.inject.Qualifier;
+
+ at Qualifier
+ at Target({FIELD, PARAMETER})
+ at Retention(RUNTIME)
+public @interface AttributeReplaced {}
\ No newline at end of file

Added: 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	                        (rev 0)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Complete.java	2010-03-22 21:35:42 UTC (rev 12243)
@@ -0,0 +1,14 @@
+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 javax.inject.Qualifier;
+
+ at Qualifier
+ at Target({FIELD, PARAMETER})
+ at Retention(RUNTIME)
+public @interface Complete {}
\ No newline at end of file

Added: 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	                        (rev 0)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Created.java	2010-03-22 21:35:42 UTC (rev 12243)
@@ -0,0 +1,14 @@
+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 javax.inject.Qualifier;
+
+ at Qualifier
+ at Target({FIELD, PARAMETER})
+ at Retention(RUNTIME)
+public @interface Created {}
\ No newline at end of file

Added: 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	                        (rev 0)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Destroyed.java	2010-03-22 21:35:42 UTC (rev 12243)
@@ -0,0 +1,14 @@
+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 javax.inject.Qualifier;
+
+ at Qualifier
+ at Target({FIELD, PARAMETER})
+ at Retention(RUNTIME)
+public @interface Destroyed {}
\ No newline at end of file

Added: 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	                        (rev 0)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/DidActivate.java	2010-03-22 21:35:42 UTC (rev 12243)
@@ -0,0 +1,14 @@
+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 javax.inject.Qualifier;
+
+ at Qualifier
+ at Target({FIELD, PARAMETER})
+ at Retention(RUNTIME)
+public @interface DidActivate {}
\ No newline at end of file

Added: 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	                        (rev 0)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Error.java	2010-03-22 21:35:42 UTC (rev 12243)
@@ -0,0 +1,15 @@
+package org.jboss.seam.servlet.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;
+
+ at Qualifier
+ at Target({FIELD, PARAMETER})
+ at Retention(RUNTIME)
+public @interface Error {}
\ No newline at end of file

Added: 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	                        (rev 0)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Initialized.java	2010-03-22 21:35:42 UTC (rev 12243)
@@ -0,0 +1,14 @@
+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 javax.inject.Qualifier;
+
+ at Qualifier
+ at Target({FIELD, PARAMETER})
+ at Retention(RUNTIME)
+public @interface Initialized {}
\ No newline at end of file

Added: 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	                        (rev 0)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/StartAsync.java	2010-03-22 21:35:42 UTC (rev 12243)
@@ -0,0 +1,14 @@
+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 javax.inject.Qualifier;
+
+ at Qualifier
+ at Target({FIELD, PARAMETER})
+ at Retention(RUNTIME)
+public @interface StartAsync {}
\ No newline at end of file

Added: 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	                        (rev 0)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/Timeout.java	2010-03-22 21:35:42 UTC (rev 12243)
@@ -0,0 +1,14 @@
+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 javax.inject.Qualifier;
+
+ at Qualifier
+ at Target({FIELD, PARAMETER})
+ at Retention(RUNTIME)
+public @interface Timeout {}
\ No newline at end of file

Added: 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	                        (rev 0)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/ValueBound.java	2010-03-22 21:35:42 UTC (rev 12243)
@@ -0,0 +1,14 @@
+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 javax.inject.Qualifier;
+
+ at Qualifier
+ at Target({FIELD, PARAMETER})
+ at Retention(RUNTIME)
+public @interface ValueBound {}
\ No newline at end of file

Added: 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	                        (rev 0)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/ValueUnbound.java	2010-03-22 21:35:42 UTC (rev 12243)
@@ -0,0 +1,14 @@
+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 javax.inject.Qualifier;
+
+ at Qualifier
+ at Target({FIELD, PARAMETER})
+ at Retention(RUNTIME)
+public @interface ValueUnbound {}
\ No newline at end of file

Added: 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	                        (rev 0)
+++ modules/servlet/trunk/src/main/java/org/jboss/seam/servlet/event/qualifier/WillPassivate.java	2010-03-22 21:35:42 UTC (rev 12243)
@@ -0,0 +1,14 @@
+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 javax.inject.Qualifier;
+
+ at Qualifier
+ at Target({FIELD, PARAMETER})
+ at Retention(RUNTIME)
+public @interface WillPassivate {}
\ No newline at end of file

Added: modules/servlet/trunk/src/test/java/org/jboss/seam/faces/event/EventObserver.java
===================================================================
--- modules/servlet/trunk/src/test/java/org/jboss/seam/faces/event/EventObserver.java	                        (rev 0)
+++ modules/servlet/trunk/src/test/java/org/jboss/seam/faces/event/EventObserver.java	2010-03-22 21:35:42 UTC (rev 12243)
@@ -0,0 +1,18 @@
+package org.jboss.seam.faces.event;
+
+import javax.enterprise.event.Observes;
+import javax.servlet.http.HttpSessionBindingEvent;
+
+import org.jboss.seam.servlet.event.qualifier.AttributeAdded;
+
+public class EventObserver
+{
+
+   public static boolean sessionAttributeAdded;
+
+   public void observeSessionAttributeAdded(@Observes @AttributeAdded HttpSessionBindingEvent e)
+   {
+      sessionAttributeAdded = true;
+   }
+
+}



More information about the seam-commits mailing list