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

Gavin King gavin.king at jboss.com
Mon Nov 13 20:47:16 EST 2006


  User: gavin   
  Date: 06/11/13 20:47:16

  Modified:    src/main/org/jboss/seam/intercept 
                        SessionBeanInterceptor.java
  Log:
  third try
  
  Revision  Changes    Path
  1.9       +7 -2      jboss-seam/src/main/org/jboss/seam/intercept/SessionBeanInterceptor.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SessionBeanInterceptor.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/intercept/SessionBeanInterceptor.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -b -r1.8 -r1.9
  --- SessionBeanInterceptor.java	13 Nov 2006 20:11:10 -0000	1.8
  +++ SessionBeanInterceptor.java	14 Nov 2006 01:47:16 -0000	1.9
  @@ -72,11 +72,16 @@
      {
         Component invokingComponent = SessionBeanInterceptor.COMPONENT.get();
         Object bean = invocation.getTarget();
  -      if ( invokingComponent!=null )
  +      if ( invokingComponent!=null && invokingComponent.getBeanClass().isInstance(bean) )
         {
            //the session bean was obtained by the application by
            //calling Component.getInstance(), could be a role
            //other than the default role
  +         //note: minor bug here, since if we got another instance of the same
  +         //      bean from JNDI or @EJB while constructing a component,
  +         //      or in an interceptor while calling a component,
  +         //      this will cause that bean to think it is an instance of the
  +         //      component role (rather than the default role)
            if ( log.isTraceEnabled() ) 
            {
               log.trace("post construct phase for instance of component: " + invokingComponent.getName());
  @@ -86,7 +91,7 @@
         else if ( bean.getClass().isAnnotationPresent(Name.class) )
         {
            //the session bean was obtained by the application from
  -         //JNDI (or it was an MDB), so assume the default role
  +         //JNDI, or @EJB (or it was an MDB), so assume the default role
            //TODO: look at more than just @Name, consider components.xml
            String defaultComponentName = bean.getClass().getAnnotation(Name.class).value();
            if ( log.isTraceEnabled() ) 
  
  
  



More information about the jboss-cvs-commits mailing list