geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r234420 - in /geronimo/trunk/modules/kernel/src/java/org/apache/geronimo: gbean/ReferenceCollection.java gbean/runtime/ProxyCollection.java kernel/basic/BasicProxyManager.java
Date Mon, 22 Aug 2005 03:15:21 GMT
Author: ammulder
Date: Sun Aug 21 20:15:17 2005
New Revision: 234420

URL: http://svn.apache.org/viewcvs?rev=234420&view=rev
Log:
Add the ability to extract ObjectNames from a reference collection
Change proxy manager so if there's an interface it can't load, it will
  log it and proceed rather than barfing

Modified:
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/ReferenceCollection.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/ProxyCollection.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicProxyManager.java

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/ReferenceCollection.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/ReferenceCollection.java?rev=234420&r1=234419&r2=234420&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/ReferenceCollection.java
(original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/ReferenceCollection.java
Sun Aug 21 20:15:17 2005
@@ -18,6 +18,7 @@
 package org.apache.geronimo.gbean;
 
 import java.util.Collection;
+import javax.management.ObjectName;
 
 /**
  * An extension of collection that allows a client to register for notifications when
@@ -29,4 +30,6 @@
     void addReferenceCollectionListener(ReferenceCollectionListener listener);
 
     void removeReferenceCollectionListener(ReferenceCollectionListener listener);
+
+    ObjectName[] getMemberObjectNames();
 }

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/ProxyCollection.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/ProxyCollection.java?rev=234420&r1=234419&r2=234420&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/ProxyCollection.java
(original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/ProxyCollection.java
Sun Aug 21 20:15:17 2005
@@ -124,6 +124,10 @@
         proxyManager.destroyProxy(proxy);
     }
 
+    public synchronized ObjectName[] getMemberObjectNames() {
+        return (ObjectName[])proxies.keySet().toArray(new ObjectName[0]);
+    }
+
     public synchronized boolean isStopped() {
         return stopped;
     }

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicProxyManager.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicProxyManager.java?rev=234420&r1=234419&r2=234420&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicProxyManager.java
(original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicProxyManager.java
Sun Aug 21 20:15:17 2005
@@ -109,15 +109,17 @@
                 return null;
             }
             String[] names = (String[]) info.getInterfaces().toArray(new String[0]);
-            Class[] intfs = new Class[names.length];
-            for (int i = 0; i < intfs.length; i++) {
-                intfs[i] = loader.loadClass(names[i]);
+            List intfs = new ArrayList();
+            for (int i = 0; i < names.length; i++) {
+                try {
+                    intfs.add(loader.loadClass(names[i]));
+                } catch (ClassNotFoundException e) {
+                    log.warn("Could not load interface "+names[i]+" in provided ClassLoader
for "+target.getKeyProperty("name"));
+                }
             }
-            return createProxyFactory(intfs).createProxy(target);
+            return createProxyFactory((Class[]) intfs.toArray(new Class[intfs.size()])).createProxy(target);
         } catch (GBeanNotFoundException e) {
             throw new IllegalArgumentException("Could not get GBeanInfo for target object:
" + target);
-        } catch (ClassNotFoundException e) {
-            throw new IllegalArgumentException("Could not load interface in provided ClassLoader:
" + e.getMessage());
         }
     }
 



Mime
View raw message