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

Gavin King gavin.king at jboss.com
Wed Jul 26 17:51:05 EDT 2006


  User: gavin   
  Date: 06/07/26 17:51:05

  Modified:    src/main/org/jboss/seam/ejb  SeamInterceptor.java
  Log:
  client-side interceptors
  
  Revision  Changes    Path
  1.38      +26 -4     jboss-seam/src/main/org/jboss/seam/ejb/SeamInterceptor.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SeamInterceptor.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/ejb/SeamInterceptor.java,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -b -r1.37 -r1.38
  --- SeamInterceptor.java	3 Jul 2006 01:52:22 -0000	1.37
  +++ SeamInterceptor.java	26 Jul 2006 21:51:05 -0000	1.38
  @@ -15,6 +15,7 @@
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   import org.jboss.seam.Component;
  +import org.jboss.seam.InterceptorType;
   import org.jboss.seam.Seam;
   import org.jboss.seam.contexts.Contexts;
   import org.jboss.seam.contexts.Lifecycle;
  @@ -25,13 +26,34 @@
    * for a session bean component
    * 
    * @author Gavin King
  - * @version $Revision: 1.37 $
  + * @version $Revision: 1.38 $
    */
   public class SeamInterceptor implements Serializable
   {
      
      private static final Log log = LogFactory.getLog(SeamInterceptor.class);
      
  +   private final InterceptorType type;
  +   private final Component component;
  +   
  +   /**
  +    * Called when instatiated by EJB container
  +    */
  +   public SeamInterceptor()
  +   {
  +      type = InterceptorType.SERVER;
  +      component = null;
  +   }
  +   
  +   /**
  +    * Called when instantiated by Seam
  +    */
  +   public SeamInterceptor(InterceptorType type, Component component)
  +   {
  +      this.type = type;
  +      this.component = component;
  +   }
  +   
      @PostConstruct
      public void initialize(InvocationContext invocation) throws Exception
      {
  @@ -82,7 +104,7 @@
            {
               log.trace("intercepted: " + invocation.getMethod().getName());
            }
  -         return new SeamInvocationContext(invocation, component).proceed();
  +         return new SeamInvocationContext( invocation, component.getInterceptors(type) ).proceed();
         }
         else {
            if ( log.isTraceEnabled() ) 
  @@ -100,12 +122,12 @@
   
      private boolean isSeamComponent(Object bean)
      {
  -      return Seam.getBeanClass( bean.getClass() )!=null;
  +      return component!=null || Seam.getBeanClass( bean.getClass() )!=null;
      }
      
      private Component getSeamComponent(Object bean)
      {
  -      return Component.forName( Seam.getComponentName( bean.getClass() ) );
  +      return component==null ? Component.forName( Seam.getComponentName( bean.getClass() ) ) : component;
      }
      
   }
  
  
  



More information about the jboss-cvs-commits mailing list