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

Gavin King gavin.king at jboss.com
Wed Dec 6 01:07:27 EST 2006


  User: gavin   
  Date: 06/12/06 01:07:27

  Modified:    src/main/org/jboss/seam  Component.java
  Log:
  fix proxy deserialization outside of web context
  
  Revision  Changes    Path
  1.216     +7 -9      jboss-seam/src/main/org/jboss/seam/Component.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Component.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/Component.java,v
  retrieving revision 1.215
  retrieving revision 1.216
  diff -u -b -r1.215 -r1.216
  --- Component.java	4 Dec 2006 01:06:50 -0000	1.215
  +++ Component.java	6 Dec 2006 06:07:26 -0000	1.216
  @@ -121,7 +121,7 @@
    *
    * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
    * @author Gavin King
  - * @version $Revision: 1.215 $
  + * @version $Revision: 1.216 $
    */
   @Scope(ScopeType.APPLICATION)
   @SuppressWarnings("deprecation")
  @@ -262,8 +262,6 @@
   
         initInitializers(applicationContext);
   
  -      //factory = createProxyFactory();
  -
      }
   
      private void initNamespaces(String componentName, Context applicationContext)
  @@ -1064,16 +1062,16 @@
       */
      public Object wrap(Object bean, MethodInterceptor interceptor) throws Exception
      {
  -      Factory proxy = getFactory().newInstance();
  +      Factory proxy = getProxyFactory().newInstance();
         proxy.setCallback(0, interceptor);
         return proxy;
      }
   
  -   private synchronized Class<Factory> getFactory()
  +   private synchronized Class<Factory> getProxyFactory()
      {
         if (factory==null)
         {
  -         factory = createProxyFactory();
  +         factory = createProxyFactory( getType(), getBeanClass(), getBusinessInterfaces() );
         }
         return factory;
      }
  @@ -1455,7 +1453,7 @@
         }
      }
   
  -   private static Set<Class> getBusinessInterfaces(Class clazz)
  +   public static Set<Class> getBusinessInterfaces(Class clazz)
      {
         Set<Class> result = new HashSet<Class>();
   
  @@ -1917,7 +1915,7 @@
         return "Component(" + name + ")";
      }
   
  -   private Class<Factory> createProxyFactory()
  +   public static Class<Factory> createProxyFactory(ComponentType type, Class beanClass, Collection<Class> businessInterfaces)
      {
         Enhancer en = new Enhancer();
         en.setUseCache(false);
  @@ -1927,7 +1925,7 @@
         Set<Class> interfaces = new HashSet<Class>();
         if ( type.isSessionBean() )
         {
  -         interfaces.addAll( getBusinessInterfaces() );
  +         interfaces.addAll(businessInterfaces);
         }
         else
         {
  
  
  



More information about the jboss-cvs-commits mailing list