[jboss-cvs] jboss-seam/src/main/org/jboss/seam/intercept ...

Gavin King gavin.king at jboss.com
Fri Feb 16 18:33:31 EST 2007


  User: gavin   
  Date: 07/02/16 18:33:31

  Modified:    src/main/org/jboss/seam/intercept  RootInterceptor.java
  Log:
  really fix it
  
  Revision  Changes    Path
  1.11      +31 -1     jboss-seam/src/main/org/jboss/seam/intercept/RootInterceptor.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: RootInterceptor.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/intercept/RootInterceptor.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -b -r1.10 -r1.11
  --- RootInterceptor.java	16 Feb 2007 21:42:07 -0000	1.10
  +++ RootInterceptor.java	16 Feb 2007 23:33:31 -0000	1.11
  @@ -7,6 +7,7 @@
   package org.jboss.seam.intercept;
   
   import java.io.Serializable;
  +import java.lang.reflect.Constructor;
   import java.util.List;
   
   import org.jboss.seam.log.LogProvider;
  @@ -149,9 +150,38 @@
         return new SeamInvocationContext( invocation, eventType, userInterceptors, getComponent().getInterceptors(type) );
      }
   
  +   private static final Constructor CONSTRUCTOR;
  +   static
  +   {
  +      if ( EJB.INVOCATION_CONTEXT_AVAILABLE )
  +      {
  +         try
  +         {
  +            Class[] paramTypes = {InvocationContext.class, EventType.class, List.class, List.class};
  +            CONSTRUCTOR = Class.forName("org.jboss.seam.intercept.EE5SeamInvocationContext").getConstructor(paramTypes);
  +         }
  +         catch (Exception e)
  +         {
  +            throw new RuntimeException(e);
  +         }
  +      }
  +      else
  +      {
  +         CONSTRUCTOR = null;
  +      }
  +      
  +   }
  +
      private SeamInvocationContext createEE5SeamInvocationContext(InvocationContext invocation, EventType eventType)
      {
  -      return new EE5SeamInvocationContext( invocation, eventType, userInterceptors, getComponent().getInterceptors(type) );
  +      try
  +      {
  +         return (SeamInvocationContext) CONSTRUCTOR.newInstance( invocation, eventType, userInterceptors, getComponent().getInterceptors(type) );
  +      }
  +      catch (Exception e)
  +      {
  +         throw new RuntimeException(e);
  +      }
      }
   
      private String getInterceptionMessage(InvocationContext invocation, EventType eventType)
  
  
  



More information about the jboss-cvs-commits mailing list