You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2009/04/09 12:47:55 UTC

svn commit: r763595 - in /qpid/branches/0.5-release/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: Thu Apr  9 10:47:55 2009
New Revision: 763595

URL: http://svn.apache.org/viewvc?rev=763595&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

merged from trunk, r762365

Modified:
    qpid/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/management/   (props changed)
    qpid/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/management/LoggingManagement.java
    qpid/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/management/LoggingManagementMBean.java
    qpid/branches/0.5-release/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java   (contents, props changed)

Propchange: qpid/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/management/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Thu Apr  9 10:47:55 2009
@@ -0,0 +1 @@
+/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/management:762365

Modified: qpid/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/management/LoggingManagement.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/management/LoggingManagement.java?rev=763595&r1=763594&r2=763595&view=diff
==============================================================================
--- qpid/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/management/LoggingManagement.java (original)
+++ qpid/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/management/LoggingManagement.java Thu Apr  9 10:47:55 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/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/management/LoggingManagementMBean.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/management/LoggingManagementMBean.java?rev=763595&r1=763594&r2=763595&view=diff
==============================================================================
--- qpid/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/management/LoggingManagementMBean.java (original)
+++ qpid/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/management/LoggingManagementMBean.java Thu Apr  9 10:47:55 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/branches/0.5-release/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.5-release/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java?rev=763595&r1=763594&r2=763595&view=diff
==============================================================================
--- qpid/branches/0.5-release/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java (original)
+++ qpid/branches/0.5-release/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java Thu Apr  9 10:47:55 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
+}

Propchange: qpid/branches/0.5-release/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Thu Apr  9 10:47:55 2009
@@ -0,0 +1 @@
+/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java:762365



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