geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From genspr...@apache.org
Subject svn commit: r919353 - /geronimo/server/branches/2.1/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/jmx/KernelDelegate.java
Date Fri, 05 Mar 2010 09:45:55 GMT
Author: genspring
Date: Fri Mar  5 09:45:55 2010
New Revision: 919353

URL: http://svn.apache.org/viewvc?rev=919353&view=rev
Log:
GERONIMO-5145 Address getGbean method in KernelDelegate as pointed out by GERONIMO-4844, based
on patch from Ashish.

Modified:
    geronimo/server/branches/2.1/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/jmx/KernelDelegate.java

Modified: geronimo/server/branches/2.1/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/jmx/KernelDelegate.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/jmx/KernelDelegate.java?rev=919353&r1=919352&r2=919353&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/jmx/KernelDelegate.java
(original)
+++ geronimo/server/branches/2.1/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/jmx/KernelDelegate.java
Fri Mar  5 09:45:55 2010
@@ -101,15 +101,14 @@
     }
 
     public Object getGBean(Class type) throws GBeanNotFoundException, InternalKernelException,
IllegalStateException {
-        try {
-            return invokeKernel("getGBean", new Object[] {type}, new String[] {Class.class.getName()});
-        } catch (GBeanNotFoundException e) {
-            throw e;
-        } catch (RuntimeException e) {
-            throw e;
-        } catch (Exception e) {
-            throw new InternalKernelException(e);
+        
+        Set<AbstractName> set = listGBeans(new AbstractNameQuery(type.getName()));
+        
+        for (AbstractName name : set) {
+            return proxyManager.createProxy(name, type);
         }
+        
+        throw new GBeanNotFoundException("No implementation found for type " + type.getName(),
null, set);
     }
 
     public Object getGBean(String shortName, Class type) throws GBeanNotFoundException, InternalKernelException,
IllegalStateException {



Mime
View raw message