openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kelap...@apache.org
Subject svn commit: r1005877 - in /openwebbeans/trunk: webbeans-ejb/src/main/java/org/apache/webbeans/ejb/plugin/ webbeans-impl/src/main/java/org/apache/webbeans/intercept/ webbeans-impl/src/main/java/org/apache/webbeans/plugins/
Date Fri, 08 Oct 2010 16:03:27 GMT
Author: kelapure
Date: Fri Oct  8 16:03:26 2010
New Revision: 1005877

URL: http://svn.apache.org/viewvc?rev=1005877&view=rev
Log:
OWB-422 Support needed for PrePassivate, PostActivate, and AroundTimeout via EJBInterceptor.
https://issues.apache.org/jira/browse/OWB-422

Modified:
    openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/plugin/OpenWebBeansEjbLCAPluginImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorDataImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/plugins/OpenWebBeansEjbLCAPlugin.java

Modified: openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/plugin/OpenWebBeansEjbLCAPluginImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/plugin/OpenWebBeansEjbLCAPluginImpl.java?rev=1005877&r1=1005876&r2=1005877&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/plugin/OpenWebBeansEjbLCAPluginImpl.java
(original)
+++ openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/plugin/OpenWebBeansEjbLCAPluginImpl.java
Fri Oct  8 16:03:26 2010
@@ -22,14 +22,14 @@ import java.lang.annotation.Annotation;
 
 import javax.ejb.PrePassivate;
 import javax.ejb.PostActivate;
+import javax.interceptor.AroundTimeout;
 
 import org.apache.webbeans.plugins.OpenWebBeansEjbLCAPlugin;
 import org.apache.webbeans.spi.plugins.AbstractOwbPlugin;
 
 /**
  * EJB Plugin for EJB related components.
- * 
- * @version 
+ * @version $Rev$ $Date$
  */
 public class OpenWebBeansEjbLCAPluginImpl extends AbstractOwbPlugin implements OpenWebBeansEjbLCAPlugin
 
 {
@@ -49,5 +49,12 @@ public class OpenWebBeansEjbLCAPluginImp
     {
         return PostActivate.class;
     }
+
+    @Override
+    public Class<? extends Annotation> getAroundTimeoutClass()
+    {
+        return AroundTimeout.class;
+    }
+        
 }
 

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorDataImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorDataImpl.java?rev=1005877&r1=1005876&r2=1005877&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorDataImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorDataImpl.java
Fri Oct  8 16:03:26 2010
@@ -35,12 +35,14 @@ import org.apache.webbeans.decorator.Web
 import org.apache.webbeans.inject.OWBInjector;
 import org.apache.webbeans.intercept.webbeans.WebBeansInterceptor;
 import org.apache.webbeans.logger.WebBeansLogger;
+import org.apache.webbeans.plugins.OpenWebBeansEjbLCAPlugin;
+import org.apache.webbeans.plugins.PluginLoader;
 import org.apache.webbeans.util.WebBeansUtil;
 
 /**
  * Abstract implementation of the {@link InterceptorData} api contract.
  * 
- * @version $Rev$ $Date$
+ * @version $Rev$ $Date$
  */
 public class InterceptorDataImpl implements InterceptorData
 {
@@ -115,6 +117,17 @@ public class InterceptorDataImpl impleme
      */
     public void setInterceptorMethod(Method m, Class<? extends Annotation> annotation)
     {
+        OpenWebBeansEjbLCAPlugin ejbPlugin = PluginLoader.getInstance().getEjbLCAPlugin();
+        Class <? extends Annotation> prePassivateClass = null;
+        Class <? extends Annotation> postActivateClass = null;
+        Class <? extends Annotation> aroundTimeoutClass = null;
+        if (null != ejbPlugin)
+        {
+            prePassivateClass = ejbPlugin.getPrePassivateClass();
+            postActivateClass = ejbPlugin.getPostActivateClass();
+            aroundTimeoutClass = ejbPlugin.getAroundTimeoutClass();
+        }
+        
         if (annotation.equals(AroundInvoke.class))
         {
             setAroundInvoke(m);
@@ -126,6 +139,18 @@ public class InterceptorDataImpl impleme
         else if (annotation.equals(PreDestroy.class))
         {
             setPreDestroy(m);
+        } 
+        else if (null != ejbPlugin && annotation.equals(prePassivateClass))
+        {
+            setPrePassivate(m);
+        } 
+        else if (null != ejbPlugin && annotation.equals(postActivateClass))
+        {
+            setPostActivate(m);
+        } 
+        else if (null != ejbPlugin && annotation.equals(aroundTimeoutClass))
+        {
+            setAroundTimeout(m);
         }
     }
 
@@ -486,14 +511,17 @@ public class InterceptorDataImpl impleme
         StringBuilder sb = new StringBuilder();
         if (null != webBeansInterceptor) 
         {
-            sb.append("Class: [").append(webBeansInterceptor.getBeanClass()).append("]");
+            sb.append("webBeansInterceptor: [").append(webBeansInterceptor.getBeanClass()).append("]");
         }
-        sb.append(" aroundInvoke [").append(aroundInvoke).append("]");
+        sb.append(" aroundInvoke  [").append(aroundInvoke).append("]");
         sb.append(" aroundTimeout [").append(aroundTimeout).append("]");
+        
         sb.append(" postConstruct [").append(postConstruct).append("]");
-        sb.append(" postActivate [").append(postActivate).append("]");
-        sb.append(" preDestroy [").append(preDestroy).append("]");
-        sb.append(" prePassivate [").append(prePassivate).append("]");
+        sb.append(" preDestroy    [").append(preDestroy).append("]");
+        
+        sb.append(" postActivate  [").append(postActivate).append("]");
+        sb.append(" prePassivate  [").append(prePassivate).append("]");
+        
 
         return sb.toString();
     }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/plugins/OpenWebBeansEjbLCAPlugin.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/plugins/OpenWebBeansEjbLCAPlugin.java?rev=1005877&r1=1005876&r2=1005877&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/plugins/OpenWebBeansEjbLCAPlugin.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/plugins/OpenWebBeansEjbLCAPlugin.java
Fri Oct  8 16:03:26 2010
@@ -21,10 +21,14 @@ package org.apache.webbeans.plugins;
 import java.lang.annotation.Annotation;
 
 import org.apache.webbeans.spi.plugins.OpenWebBeansPlugin;
-
+/**
+ * @version $Rev$ $Date$
+ */
 public interface OpenWebBeansEjbLCAPlugin extends OpenWebBeansPlugin
 {
     public Class<? extends Annotation> getPrePassivateClass();
 
     public Class<? extends Annotation> getPostActivateClass();
+    
+    public Class<? extends Annotation> getAroundTimeoutClass();
 }



Mime
View raw message