[seam-commits] Seam SVN: r15496 - in branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam: util and 1 other directory.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Fri May 10 09:24:00 EDT 2013


Author: manaRH
Date: 2013-05-10 09:24:00 -0400 (Fri, 10 May 2013)
New Revision: 15496

Modified:
   branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/intercept/Interceptor.java
   branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/intercept/SeamInvocationContext.java
   branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/util/EJB.java
Log:
bz948265, JBSEAM-5091 fixing the IAE: no InvocationType

Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/intercept/Interceptor.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/intercept/Interceptor.java	2013-05-10 13:23:46 UTC (rev 15495)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/intercept/Interceptor.java	2013-05-10 13:24:00 UTC (rev 15496)
@@ -2,6 +2,7 @@
 package org.jboss.seam.intercept;
 
 import static org.jboss.seam.util.EJB.AROUND_INVOKE;
+import static org.jboss.seam.util.EJB.AROUND_TIMEOUT;
 import static org.jboss.seam.util.EJB.POST_ACTIVATE;
 import static org.jboss.seam.util.EJB.POST_CONSTRUCT;
 import static org.jboss.seam.util.EJB.PRE_DESTROY;
@@ -10,6 +11,8 @@
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Method;
 
+import javax.interceptor.AroundTimeout;
+
 import org.jboss.seam.Component;
 import org.jboss.seam.annotations.intercept.AroundInvoke;
 import org.jboss.seam.annotations.intercept.InterceptorType;
@@ -28,6 +31,7 @@
    private Class<?> userInterceptorClass;
    private Object statelessUserInterceptorInstance;
    private Method aroundInvokeMethod;
+   private Method aroundTimeoutMethod;
    private Method postConstructMethod;
    private Method preDestroyMethod;
    private Method postActivateMethod;
@@ -132,6 +136,10 @@
          {
             aroundInvokeMethod = method;
          }
+         if ( method.isAnnotationPresent(AROUND_TIMEOUT) || method.isAnnotationPresent(AroundTimeout.class) )
+         {
+            aroundTimeoutMethod = method;
+         }         
          if ( method.isAnnotationPresent(POST_CONSTRUCT) || method.isAnnotationPresent(PostConstruct.class))
          {
             postConstructMethod = method;
@@ -189,6 +197,13 @@
             Reflections.invoke( aroundInvokeMethod, userInterceptor, invocation );
    }
    
+   public Object aroundTimeout(InvocationContext invocation, Object userInterceptor) throws Exception
+   {
+      return aroundTimeoutMethod==null ?
+            invocation.proceed() :
+            Reflections.invoke( aroundTimeoutMethod, userInterceptor, invocation );
+   }
+   
    public Object postConstruct(InvocationContext invocation, Object userInterceptor) throws Exception
    {
       return postConstructMethod==null ?

Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/intercept/SeamInvocationContext.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/intercept/SeamInvocationContext.java	2013-05-10 13:23:46 UTC (rev 15495)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/intercept/SeamInvocationContext.java	2013-05-10 13:24:00 UTC (rev 15496)
@@ -71,6 +71,7 @@
                {
                   return interceptor.aroundInvoke(this, userInterceptor);
                }
+            case AROUND_TIMEOUT: return interceptor.aroundTimeout(this, userInterceptor);
             case POST_CONSTRUCT: return interceptor.postConstruct(this, userInterceptor);
             case PRE_DESTORY: return interceptor.preDestroy(this, userInterceptor);
             case PRE_PASSIVATE: return interceptor.prePassivate(this, userInterceptor);

Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/util/EJB.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/util/EJB.java	2013-05-10 13:23:46 UTC (rev 15495)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/util/EJB.java	2013-05-10 13:24:00 UTC (rev 15496)
@@ -29,6 +29,7 @@
    public static final Class<Annotation> PERSISTENCE_CONTEXT;
    public static final Class<Annotation> INTERCEPTORS;
    public static final Class<Annotation> AROUND_INVOKE;
+   public static final Class<Annotation> AROUND_TIMEOUT;
    public static final Class<Annotation> EJB_EXCEPTION;
    public static final boolean INVOCATION_CONTEXT_AVAILABLE;
    
@@ -61,6 +62,7 @@
       POST_CONSTRUCT = classForName("javax.annotation.PostConstruct");
       INTERCEPTORS = classForName("javax.interceptor.Interceptors");
       AROUND_INVOKE = classForName("javax.interceptor.AroundInvoke");
+      AROUND_TIMEOUT = classForName("javax.interceptor.AroundTimeout");
       EJB_EXCEPTION = classForName("javax.ejb.EJBException");
       INVOCATION_CONTEXT_AVAILABLE = !classForName("javax.interceptor.InvocationContext").equals(Dummy.class);
    }



More information about the seam-commits mailing list