summaryrefslogtreecommitdiff
path: root/java/management/eclipse-plugin/src
diff options
context:
space:
mode:
authorBhupendra Bhusman Bhardwaj <bhupendrab@apache.org>2007-03-26 16:43:24 +0000
committerBhupendra Bhusman Bhardwaj <bhupendrab@apache.org>2007-03-26 16:43:24 +0000
commit34a518c7670852f15aa6964d2a81234107a7478c (patch)
tree83e9c327e4794e30af2b9c9739b025cfe05646de /java/management/eclipse-plugin/src
parente4481605c0a2caf07e5df3afd939bb4b55a9638a (diff)
downloadqpid-python-34a518c7670852f15aa6964d2a81234107a7478c.tar.gz
QPID-421 displaying AMQMessage properties in user understandable format in Management Console, like Persistent instead of 1.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/M2@522567 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/management/eclipse-plugin/src')
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java13
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java2
2 files changed, 14 insertions, 1 deletions
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java
index 8b4fd3afb5..5ceeb879b4 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java
@@ -21,6 +21,7 @@
package org.apache.qpid.management.ui.jmx;
import java.io.IOException;
+import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
@@ -65,6 +66,9 @@ public class MBeanUtility
String debug = System.getProperty("debug");
_debug = "true".equalsIgnoreCase(debug) ? true : false;
}
+
+ public static final BigInteger MAX_LONG = BigInteger.valueOf(Long.MAX_VALUE);
+ public static final BigInteger MAX_INT = BigInteger.valueOf(Integer.MAX_VALUE);
/**
* Retrieves the MBeanInfo from MBeanServer and stores in the application registry
* @param mbean managed bean
@@ -333,10 +337,19 @@ public class MBeanUtility
Object newValue = value;
if (attribute.getDataType().equals(Long.class.getName()))
{
+ if (MAX_LONG.compareTo(new BigInteger(value)) == -1)
+ {
+ throw new ManagementConsoleException("Entered value is too big for \"" +
+ ViewUtility.getDisplayText(attribute.getName()) + "\"");
+ }
newValue = new Long(Long.parseLong(value));
}
else if (attribute.getDataType().equals(Integer.class.getName()))
{
+ if (MAX_INT.compareTo(new BigInteger(value)) == -1)
+ {
+ throw new ManagementConsoleException("Entered value is too big for " + attribute.getName());
+ }
newValue = new Integer(Integer.parseInt(value));
}
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java
index c3678c04ea..437afeeda1 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java
@@ -488,7 +488,7 @@ public class AttributesTabControl extends TabControl
GridData layoutData = new GridData(SWT.TRAIL, SWT.TOP, false, false);
label.setLayoutData(layoutData);
Text value = new Text(parent, SWT.BEGINNING | SWT.BORDER |SWT.READ_ONLY);
- value.setText(attribute.getName());
+ value.setText(ViewUtility.getDisplayText(attribute.getName()));
value.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));