Fixes a bug where service interfaces in superclass were not proxied.

-- 
Cheers,

Peter Donald
---------------------------------------------------
"Therefore it can be said that victorious warriors 
win first, and then go to battle, while defeated 
warriors go to battle first, and then seek to win." 
              - Sun Tzu, the Art Of War
--------------------------------------------------- 
Index: src/java/org/apache/excalibur/fortress/handler/ProxyHelper.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/handler/ProxyHelper.java,v
retrieving revision 1.2
diff -u -r1.2 ProxyHelper.java
--- src/java/org/apache/excalibur/fortress/handler/ProxyHelper.java     9 Nov 2002 
07:44:38 -0000       1.2
+++ src/java/org/apache/excalibur/fortress/handler/ProxyHelper.java     3 Dec 2002 
+00:31:28 -0000
@@ -157,6 +157,23 @@
     private static Class[] guessWorkInterfaces( final Class clazz )
     {
         final ArrayList list = new ArrayList();
+        guessWorkInterfaces( clazz, list );
+
+        list.add( Component.class );
+        return (Class[])list.toArray( new Class[ list.size() ] );
+    }
+
+    /**
+     * Get a list of interfaces to proxy by scanning through
+     * all interfaces a class implements and skipping invalid interfaces
+     * (as defined in {@link #INVALID_INTERFACES}).
+     *
+     * @param clazz the class
+     * @param list the list of current work interfaces 
+     */
+    private static void guessWorkInterfaces( final Class clazz,
+                                             final ArrayList list )
+    {
         final Class[] interfaces = clazz.getInterfaces();
 
         boolean skip = false;
@@ -177,8 +194,7 @@
                 list.add( interfaces[ i ] );
             }
         }
-        list.add( Component.class );
 
-        return (Class[])list.toArray( new Class[ list.size() ] );
+        guessWorkInterfaces( clazz.getSuperclass(),list );
     }
 }

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to