You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Robbie Gemmell <ro...@gmail.com> on 2009/04/06 16:54:50 UTC

RE: svn commit: r762365 - in /qpid/trunk/qpid/java: broker/src/main/java/org/apache/qpid/server/logging/management/ management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/

Hi everyone,

I would like to merge this small change into 0.5 (most of it affects the console rather than the broker), as it would be useful to have it available on all released versions of the logging management MBean, rather than needing to determine in future whether it is there or not.

I will merge it over later in the week if there aren’t any objections.

Thanks, 
Robbie

-----Original Message-----
From: robbie@apache.org [mailto:robbie@apache.org] 
Sent: 06 April 2009 15:46
To: commits@qpid.apache.org
Subject: svn commit: r762365 - in /qpid/trunk/qpid/java: broker/src/main/java/org/apache/qpid/server/logging/management/ management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/

Author: robbie
Date: Mon Apr  6 14:45:33 2009
New Revision: 762365

URL: http://svn.apache.org/viewvc?rev=762365&view=rev
Log:
QPID-1790: add new attribute to logging management mbean to indicate available output levels. Update jmx management console to understand String[] attribute value and display contents properly

Modified:
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/management/LoggingManagement.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/management/LoggingManagementMBean.java
    qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/management/LoggingManagement.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/management/LoggingManagement.java?rev=762365&r1=762364&r2=762365&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/management/LoggingManagement.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/management/LoggingManagement.java Mon Apr  6 14:45:33 2009
@@ -47,6 +47,13 @@
                     description = "The log4j xml configuration file LogWatch interval (in seconds). 0 indicates not being checked.")
     Integer getLog4jLogWatchInterval();
     
+    /**
+     * Attribute to represent the available log4j logger output levels.
+     * @return The logging level names.
+     */
+    @MBeanAttribute(name="AvailableLoggerLevels", description = "The values to which log output level can be set.")
+    String[] getAvailableLoggerLevels();
+    
     
     //****** log4j runtime operations ****** //
 

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/management/LoggingManagementMBean.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/management/LoggingManagementMBean.java?rev=762365&r1=762364&r2=762365&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/management/LoggingManagementMBean.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/management/LoggingManagementMBean.java Mon Apr  6 14:45:33 2009
@@ -69,7 +69,10 @@
     private static final Logger _logger = Logger.getLogger(LoggingManagementMBean.class);
     private String _log4jConfigFileName;
     private int _log4jLogWatchInterval;
-    
+    private static final String[] LEVELS = new String[]{Level.ALL.toString(), Level.TRACE.toString(), 
+                                                        Level.DEBUG.toString(), Level.INFO.toString(), 
+                                                        Level.WARN.toString(), Level.ERROR.toString(), 
+                                                        Level.FATAL.toString(),Level.OFF.toString()};   
     static TabularType _loggerLevelTabularType;
     static CompositeType _loggerLevelCompositeType;
 
@@ -108,7 +111,11 @@
     {
         return _log4jLogWatchInterval;
     }
-
+    
+    public String[] getAvailableLoggerLevels()
+    {
+        return LEVELS;
+    }
     @SuppressWarnings("unchecked")
     public synchronized boolean setRuntimeLoggerLevel(String logger, String level)
     {   

Modified: qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java?rev=762365&r1=762364&r2=762365&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java (original)
+++ qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java Mon Apr  6 14:45:33 2009
@@ -509,10 +509,24 @@
         {
             if (!isSimpleType(attribute.getValue()))
             {
-                Composite composite = new Composite(parent, SWT.BORDER);
-                composite.setLayout(new GridLayout());
-                composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
-                ViewUtility.populateCompositeWithData(_toolkit, composite, attribute.getValue());
+                if (attribute.getValue() instanceof String[])
+                {
+                    String result = new String("");
+                    for(String val : (String[]) attribute.getValue()){
+                        result = result.concat(val+ "; ");
+                    }
+                    value = _toolkit.createText(parent, "", textStyle);
+                    
+                    value.setText(result);
+                    value.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+                }
+                else
+                {
+                    Composite composite = new Composite(parent, SWT.BORDER);
+                    composite.setLayout(new GridLayout());
+                    composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+                    ViewUtility.populateCompositeWithData(_toolkit, composite, attribute.getValue());
+                }
             }
             else
             {
@@ -877,7 +891,16 @@
                     break;
                 case 1 : // attribute value column 
                     if (attribute.getValue() != null)
-                        result = String.valueOf(attribute.getValue());
+                        if (attribute.getValue() instanceof String[])
+                        {
+                            for(String val : (String[]) attribute.getValue()){
+                                result = result.concat(val+ "; ");
+                            }
+                        }
+                        else
+                        {
+                            result = String.valueOf(attribute.getValue());
+                        }
                     break;
                 default :
                     result = "";
@@ -933,4 +956,4 @@
             return collator.compare(attribtue1.getName(), attribtue2.getName());
         }
     }
-}
\ No newline at end of file
+}



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org