karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject git commit: [KARAF-3192]Don't throw IllegalStateException when can't find attribute for a certain bean
Date Thu, 28 Aug 2014 06:19:58 GMT
Repository: karaf
Updated Branches:
  refs/heads/karaf-2.x 770e02dbc -> d05557f99


[KARAF-3192]Don't throw IllegalStateException when can't find attribute for a certain bean


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/d05557f9
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/d05557f9
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/d05557f9

Branch: refs/heads/karaf-2.x
Commit: d05557f993e2f9a88330431de58b1fad19da167a
Parents: 770e02d
Author: Freeman Fang <freeman.fang@gmail.com>
Authored: Thu Aug 28 14:18:03 2014 +0800
Committer: Freeman Fang <freeman.fang@gmail.com>
Committed: Thu Aug 28 14:18:03 2014 +0800

----------------------------------------------------------------------
 management/server/pom.xml                               |  4 ++++
 .../apache/karaf/management/KarafMBeanServerGuard.java  | 12 ++++++++++--
 2 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/d05557f9/management/server/pom.xml
----------------------------------------------------------------------
diff --git a/management/server/pom.xml b/management/server/pom.xml
index b933a1b..061066d 100644
--- a/management/server/pom.xml
+++ b/management/server/pom.xml
@@ -74,6 +74,10 @@
             <version>${easymock.version}</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
     </dependencies>
 
     <build>

http://git-wip-us.apache.org/repos/asf/karaf/blob/d05557f9/management/server/src/main/java/org/apache/karaf/management/KarafMBeanServerGuard.java
----------------------------------------------------------------------
diff --git a/management/server/src/main/java/org/apache/karaf/management/KarafMBeanServerGuard.java
b/management/server/src/main/java/org/apache/karaf/management/KarafMBeanServerGuard.java
index 50af000..0271a62 100644
--- a/management/server/src/main/java/org/apache/karaf/management/KarafMBeanServerGuard.java
+++ b/management/server/src/main/java/org/apache/karaf/management/KarafMBeanServerGuard.java
@@ -48,7 +48,14 @@ import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.service.cm.Configuration;
 import org.osgi.service.cm.ConfigurationAdmin;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+
 public class KarafMBeanServerGuard implements InvocationHandler {
+    
+    private static final Logger LOG = LoggerFactory.getLogger(KarafMBeanServerGuard.class);
 
     private static final String JMX_ACL_PID_PREFIX = "jmx.acl";
     
@@ -210,8 +217,9 @@ public class KarafMBeanServerGuard implements InvocationHandler {
                 prefix = attr.isIs() ? "is" : "get";
             }
         }
-        if (prefix == null)
-            throw new IllegalStateException("Attribute " + attributeName + " can not be found");
+        if (prefix == null) {
+            LOG.debug("Attribute " + attributeName + " can not be found for MBean " + objectName.toString());
+        }
 
         handleInvoke(objectName, prefix + attributeName, new Object[]{}, new String[]{});
     }


Mime
View raw message