geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r1028897 - in /geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans: BeanManagerReference.java GeronimoWebBeansPlugin.java
Date Fri, 29 Oct 2010 20:28:55 GMT
Author: djencks
Date: Fri Oct 29 20:28:54 2010
New Revision: 1028897

URL: http://svn.apache.org/viewvc?rev=1028897&view=rev
Log:
GERONIMO-5050 use a serializable bean manager in jndi, admit that servlets etc are ee components
in OWB plugin

Modified:
    geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/BeanManagerReference.java
    geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/GeronimoWebBeansPlugin.java

Modified: geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/BeanManagerReference.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/BeanManagerReference.java?rev=1028897&r1=1028896&r2=1028897&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/BeanManagerReference.java
(original)
+++ geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/BeanManagerReference.java
Fri Oct 29 20:28:54 2010
@@ -21,7 +21,7 @@
 package org.apache.geronimo.openwebbeans;
 
 import javax.naming.NamingException;
-import org.apache.webbeans.container.BeanManagerImpl;
+import org.apache.webbeans.container.InjectableBeanManager;
 import org.apache.xbean.naming.reference.SimpleReference;
 
 /**
@@ -31,6 +31,6 @@ public class BeanManagerReference extend
 
     @Override
     public Object getContent() throws NamingException {
-        return BeanManagerImpl.getManager();
+        return new InjectableBeanManager();
     }
 }

Modified: geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/GeronimoWebBeansPlugin.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/GeronimoWebBeansPlugin.java?rev=1028897&r1=1028896&r2=1028897&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/GeronimoWebBeansPlugin.java
(original)
+++ geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/GeronimoWebBeansPlugin.java
Fri Oct 29 20:28:54 2010
@@ -25,6 +25,18 @@ import javax.enterprise.event.Transactio
 import javax.enterprise.inject.spi.Bean;
 import javax.enterprise.inject.spi.ObserverMethod;
 import javax.enterprise.inject.spi.ProcessAnnotatedType;
+import javax.jws.WebService;
+import javax.servlet.AsyncListener;
+import javax.servlet.Filter;
+import javax.servlet.Servlet;
+import javax.servlet.ServletContextAttributeListener;
+import javax.servlet.ServletContextListener;
+import javax.servlet.ServletRequestAttributeListener;
+import javax.servlet.ServletRequestListener;
+import javax.servlet.http.HttpSessionActivationListener;
+import javax.servlet.http.HttpSessionAttributeListener;
+import javax.servlet.http.HttpSessionBindingListener;
+import javax.servlet.http.HttpSessionListener;
 import javax.transaction.Transaction;
 import javax.transaction.TransactionManager;
 import javax.transaction.UserTransaction;
@@ -37,8 +49,8 @@ import org.apache.webbeans.spi.plugins.O
 
 public class GeronimoWebBeansPlugin 
     extends AbstractOwbPlugin 
-    implements OpenWebBeansJavaEEPlugin, OpenWebBeansEjbPlugin, TransactionService, SecurityService
{
-
+    implements OpenWebBeansJavaEEPlugin, TransactionService, SecurityService {
+ //OpenWebBeansEjbPlugin,
     public <T> Bean<T> defineSessionBean(Class<T> clazz,
                                          ProcessAnnotatedType<T> processAnnotateTypeEvent)
{
         // TODO Auto-generated method stub
@@ -72,6 +84,45 @@ public class GeronimoWebBeansPlugin 
         return false;
     }
 
+    @Override
+    public void isManagedBean(Class<?> clazz) throws Exception {
+        if(Servlet.class.isAssignableFrom(clazz) ||
+                Filter.class.isAssignableFrom(clazz) ||
+                ServletContextListener.class.isAssignableFrom(clazz) ||
+                ServletContextAttributeListener.class.isAssignableFrom(clazz) ||
+                HttpSessionActivationListener.class.isAssignableFrom(clazz) ||
+                HttpSessionAttributeListener.class.isAssignableFrom(clazz) ||
+                HttpSessionBindingListener.class.isAssignableFrom(clazz) ||
+                HttpSessionListener.class.isAssignableFrom(clazz) ||
+                ServletRequestListener.class.isAssignableFrom(clazz) ||
+                ServletRequestAttributeListener.class.isAssignableFrom(clazz) ||
+                AsyncListener.class.isAssignableFrom(clazz) )
+        {
+            throw new Exception("Given class  : " + clazz.getName() + " is not managed bean");
+        }
+    }
+
+    @Override
+    public boolean supportsJavaEeComponentInjections(Class<?> clazz) {
+        if(Servlet.class.isAssignableFrom(clazz) ||
+                Filter.class.isAssignableFrom(clazz) ||
+                ServletContextListener.class.isAssignableFrom(clazz) ||
+                ServletContextAttributeListener.class.isAssignableFrom(clazz) ||
+                HttpSessionActivationListener.class.isAssignableFrom(clazz) ||
+                HttpSessionAttributeListener.class.isAssignableFrom(clazz) ||
+                HttpSessionBindingListener.class.isAssignableFrom(clazz) ||
+                HttpSessionListener.class.isAssignableFrom(clazz) ||
+                ServletRequestListener.class.isAssignableFrom(clazz) ||
+                ServletRequestAttributeListener.class.isAssignableFrom(clazz) ||
+                clazz.isAnnotationPresent(WebService.class) ||
+                AsyncListener.class.isAssignableFrom(clazz) )
+        {
+            return true;
+        }
+
+        return false;
+    }
+
     public Transaction getTransaction() {
         // TODO Auto-generated method stub
         return null;



Mime
View raw message