geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r216219 - in /geronimo/trunk/modules: deployment/src/java/org/apache/geronimo/deployment/ kernel/src/java/org/apache/geronimo/gbean/runtime/ kernel/src/java/org/apache/geronimo/kernel/ kernel/src/java/org/apache/geronimo/kernel/basic/ kerne...
Date Wed, 13 Jul 2005 18:51:19 GMT
Author: ammulder
Date: Wed Jul 13 11:51:19 2005
New Revision: 216219

URL: http://svn.apache.org/viewcvs?rev=216219&view=rev
Log:
Change GBeanNotFoundException to take a GBeanName as an argument and store
  it in a property separate from the message.  GERONIMO-749

Modified:
    geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/GBeanDataRegistry.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/GBeanNotFoundException.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicRegistry.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/MBeanServerDelegate.java

Modified: geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/GBeanDataRegistry.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/GBeanDataRegistry.java?rev=216219&r1=216218&r2=216219&view=diff
==============================================================================
--- geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/GBeanDataRegistry.java
(original)
+++ geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/GBeanDataRegistry.java
Wed Jul 13 11:51:19 2005
@@ -45,7 +45,7 @@
     public synchronized GBeanData getGBeanInstance(ObjectName name) throws GBeanNotFoundException
{
         GBeanData gbeanData = (GBeanData) registry.get(name);
         if (gbeanData == null) {
-            throw new GBeanNotFoundException(name.getCanonicalName());
+            throw new GBeanNotFoundException(new GBeanName(name));
         }
         return gbeanData;
     }

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java?rev=216219&r1=216218&r2=216219&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
(original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
Wed Jul 13 11:51:19 2005
@@ -41,6 +41,7 @@
 import org.apache.geronimo.gbean.GOperationSignature;
 import org.apache.geronimo.gbean.GReferenceInfo;
 import org.apache.geronimo.gbean.InvalidConfigurationException;
+import org.apache.geronimo.gbean.GBeanName;
 import org.apache.geronimo.kernel.DependencyManager;
 import org.apache.geronimo.kernel.NoSuchAttributeException;
 import org.apache.geronimo.kernel.NoSuchOperationException;
@@ -323,7 +324,7 @@
         synchronized (this) {
             if (dead) {
                 // someone beat us to the punch... this instance should have never been found
in the first place
-                throw new GBeanNotFoundException(name);
+                throw new GBeanNotFoundException(new GBeanName(objectName));
             }
             dead = true;
         }

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/GBeanNotFoundException.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/GBeanNotFoundException.java?rev=216219&r1=216218&r2=216219&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/GBeanNotFoundException.java
(original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/GBeanNotFoundException.java
Wed Jul 13 11:51:19 2005
@@ -16,22 +16,25 @@
  */
 package org.apache.geronimo.kernel;
 
+import org.apache.geronimo.gbean.GBeanName;
+
 /**
  * @version $Rev$ $Date$
  */
 public class GBeanNotFoundException extends KernelException {
-    public GBeanNotFoundException() {
-    }
+    private GBeanName gBeanName;
 
-    public GBeanNotFoundException(String message) {
-        super(message);
+    public GBeanNotFoundException(GBeanName gBeanName) {
+        super(gBeanName+" not found");
+        this.gBeanName = gBeanName;
     }
 
-    public GBeanNotFoundException(String message, Throwable cause) {
-        super(message, cause);
+    public GBeanNotFoundException(GBeanName gBeanName, Throwable cause) {
+        super(gBeanName+" not found", cause);
+        this.gBeanName = gBeanName;
     }
 
-    public GBeanNotFoundException(Throwable cause) {
-        super(cause);
+    public GBeanName getGBeanName() {
+        return gBeanName;
     }
 }

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicRegistry.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicRegistry.java?rev=216219&r1=216218&r2=216219&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicRegistry.java
(original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicRegistry.java
Wed Jul 13 11:51:19 2005
@@ -87,7 +87,7 @@
      */
     public synchronized void unregister(GBeanName name) throws GBeanNotFoundException, InternalKernelException
{
         if (registry.remove(name) == null) {
-            throw new GBeanNotFoundException("No GBean registered: " + name);
+            throw new GBeanNotFoundException(name);
         }
     }
 
@@ -101,7 +101,7 @@
     public synchronized GBeanInstance getGBeanInstance(GBeanName name) throws GBeanNotFoundException
{
         GBeanInstance instance = (GBeanInstance) registry.get(name);
         if (instance == null) {
-            throw new GBeanNotFoundException("No GBean registered: " + name);
+            throw new GBeanNotFoundException(name);
         }
         return instance;
     }

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/MBeanServerDelegate.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/MBeanServerDelegate.java?rev=216219&r1=216218&r2=216219&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/MBeanServerDelegate.java
(original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/MBeanServerDelegate.java
Wed Jul 13 11:51:19 2005
@@ -38,6 +38,7 @@
 import javax.management.OperationsException;
 import javax.management.QueryExp;
 import javax.management.ReflectionException;
+import javax.management.MalformedObjectNameException;
 import javax.management.loading.ClassLoaderRepository;
 
 import org.apache.geronimo.gbean.GBeanInfo;
@@ -118,7 +119,14 @@
         } catch (NoSuchOperationException e) {
             throw new ReflectionException(new NoSuchMethodException(e.getMessage()));
         } catch (GBeanNotFoundException e) {
-            throw new InstanceNotFoundException(name.getCanonicalName());
+            try {
+                if(name.equals(e.getGBeanName().getObjectName())) {
+                    throw new InstanceNotFoundException(name.getCanonicalName());
+                }
+            } catch (MalformedObjectNameException e1) {
+                throw new MBeanException(e);
+            }
+            throw new MBeanException(e);
         } catch (InternalKernelException e) {
             throw new MBeanException(unwrapInternalKernelException(e));
         } catch (Exception e) {



Mime
View raw message