Author: anovarini
Date: Sun Mar 11 02:21:29 2012
New Revision: 1299324
URL: http://svn.apache.org/viewvc?rev=1299324&view=rev
Log:
Reverted the removal of apparently useful try/catch blocks
Modified:
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/client/Client.groovy
Modified:
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/client/Client.groovy
URL:
http://svn.apache.org/viewvc/incubator/kitty/trunk/src/main/groovy/org/apache/kitty/client/Client.groovy?rev=1299324&r1=1299323&r2=1299324&view=diff
==============================================================================
--- incubator/kitty/trunk/src/main/groovy/org/apache/kitty/client/Client.groovy
(original)
+++ incubator/kitty/trunk/src/main/groovy/org/apache/kitty/client/Client.groovy
Sun Mar 11 02:21:29 2012
@@ -156,35 +156,41 @@ class Client {
throw new DomainIsNoneException()
}
- mbean = this.remote.getMBeanInfo(new ObjectName(objectName))
- for (attr in mbean.getAttributes()) {
- def readable
- def writable
- def value
- def valueStr
+ try {
+ mbean = this.remote.getMBeanInfo(new ObjectName(objectName))
+ for (attr in mbean.getAttributes()) {
+ def readable
+ def writable
+ def value
+ def valueStr
- try {
- value = this.remote.getAttribute(new ObjectName(objectName),
attr.getName())
- valueStr = (String) value
- }
- catch (Exception e) {
- valueStr = "-- " + attr.getType() + " --"
- }
- if (attr.isReadable()) {
- readable = "r"
- }
- else {
- readable = "-"
- }
- if (attr.isWritable()) {
- writable = "w"
- }
- else {
- writable = "-"
+ try {
+ value = this.remote.getAttribute(new
ObjectName(objectName), attr.getName())
+ valueStr = (String) value
+ }
+ catch (Exception e) {
+ valueStr = "-- " + attr.getType() + " --"
+ }
+ if (attr.isReadable()) {
+ readable = "r"
+ }
+ else {
+ readable = "-"
+ }
+ if (attr.isWritable()) {
+ writable = "w"
+ }
+ else {
+ writable = "-"
+ }
+ println "A " + readable + writable + " " + attr.getName() + "
: " + valueStr
}
- println "A " + readable + writable + " " + attr.getName() + " : "
+ valueStr
+ }
+ catch (Exception e) {
+ // ObjectName not found
}
+ try {
mbean = this.remote.getMBeanInfo(new ObjectName(objectName))
for (ops in mbean.getOperations()) {
def params = []
@@ -193,6 +199,10 @@ class Client {
}
println "O " + ops.getReturnType() + " " + ops.getName() + " ( " +
",".concat(params.join()) + ")"
}
+ }
+ catch(Exception e) {
+ // ObjectName not found
+ }
}