[jboss-cvs] jboss-seam/src/ioc/org/jboss/seam/ioc ...

Ales Justin ales.justin at genera-lynx.com
Wed Feb 28 10:43:13 EST 2007


  User: alesj   
  Date: 07/02/28 10:43:13

  Modified:    src/ioc/org/jboss/seam/ioc  IoCComponent.java
  Log:
  Initial MC int code (some parts still commented - waiting for MC upgrade), fixing builds for separate Spring and MC handling.
  
  Revision  Changes    Path
  1.3       +39 -26    jboss-seam/src/ioc/org/jboss/seam/ioc/IoCComponent.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: IoCComponent.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/ioc/org/jboss/seam/ioc/IoCComponent.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- IoCComponent.java	17 Feb 2007 09:57:44 -0000	1.2
  +++ IoCComponent.java	28 Feb 2007 15:43:13 -0000	1.3
  @@ -21,14 +21,22 @@
   */
   package org.jboss.seam.ioc;
   
  +import java.util.Arrays;
  +import java.util.HashSet;
  +import java.util.Set;
  +import javax.servlet.http.HttpSessionActivationListener;
  +
   import org.jboss.seam.Component;
  +import org.jboss.seam.InterceptionType;
   import org.jboss.seam.ScopeType;
  +import org.jboss.seam.core.Mutable;
  +import org.jboss.seam.intercept.Proxy;
   import org.jboss.seam.log.LogProvider;
   import org.jboss.seam.log.Logging;
   
   /**
    * An extension of Component that allows external IoC
  - * to provide the base instance for a seam component.
  + * to provide the base instance for a Seam component.
    *
    * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
    */
  @@ -37,7 +45,7 @@
      protected final LogProvider log = Logging.getLogProvider(getClass());
   
      /**
  -    * Creates a Spring Seam Component given a beanFactory.
  +    * Creates a Seam Component from other IoC container
       *
       * @param clazz   class
       * @param name    component name
  @@ -53,22 +61,27 @@
      protected abstract Object instantiateIoCBean() throws Exception;
   
      /**
  -    * Instantiates a IoC bean and provides it as a java bean to be wrapped
  -    * by seam.
  +    * Instantiates a IoC bean and provides it as a
  +    * java bean to be wrapped by Seam.
       *
       * @see org.jboss.seam.Component#instantiateJavaBean()
       */
  -/*   protected Object instantiateJavaBean() throws Exception
  +   @Override
  +   protected Object instantiateJavaBean() throws Exception
      {
         Object bean = instantiateIoCBean();
         // initialize the bean following Component.instantiateJavaBean()'s
         // pattern.
         if (getInterceptionType() == InterceptionType.NEVER)
         {
  -         initialize(bean);
  +           // Only call postConstruct if the bean is not stateless otherwise in the case of a singleton it wowuld be
  +           // called every time seam request the bean not just when it is created.
  +           if (getScope() != ScopeType.STATELESS)
  +           {
            callPostConstructMethod(bean);
         }
  -      else
  +       }
  +       else if (!(bean instanceof Proxy))
         {
            // Add all of the interfaces of the bean instance into the Seam
            // proxy bean because spring's proxies add a bunch of interfaces too
  @@ -81,6 +94,6 @@
            bean = ProxyUtils.enhance(bean, interfaces, this);
         }
         return bean;
  -   }*/
  +   }
   
   }
  
  
  



More information about the jboss-cvs-commits mailing list