cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r794423 - in /cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/servletservice: ServletServiceMonitor.java ServletServiceMonitorInitializer.java
Date Wed, 15 Jul 2009 21:31:45 GMT
Author: reinhard
Date: Wed Jul 15 21:31:44 2009
New Revision: 794423

URL: http://svn.apache.org/viewvc?rev=794423&view=rev
Log:
COCOON3-38
fix wrong usage of break/continue
show the mount-path as first part of the objectname

Modified:
    cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/servletservice/ServletServiceMonitor.java
    cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/servletservice/ServletServiceMonitorInitializer.java

Modified: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/servletservice/ServletServiceMonitor.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/servletservice/ServletServiceMonitor.java?rev=794423&r1=794422&r2=794423&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/servletservice/ServletServiceMonitor.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/servletservice/ServletServiceMonitor.java
Wed Jul 15 21:31:44 2009
@@ -54,7 +54,7 @@
      * @return all ServletService init parameters
      */
     @ManagedAttribute(description = "Returns all ServletService init parameters")
-    public String[] getServiceServletInitParameters() {
+    public String[] getServletServiceInitParameters() {
         ServletConfig config = this.servlet.getServletConfig();
         @SuppressWarnings("unchecked")
         Enumeration<String> initParameterNames = config.getInitParameterNames();

Modified: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/servletservice/ServletServiceMonitorInitializer.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/servletservice/ServletServiceMonitorInitializer.java?rev=794423&r1=794422&r2=794423&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/servletservice/ServletServiceMonitorInitializer.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/servletservice/ServletServiceMonitorInitializer.java
Wed Jul 15 21:31:44 2009
@@ -44,34 +44,34 @@
 
             // get only ServletServices servlets
             ServletContext servletContext = servletConfig.getServletContext();
+            String servletName = servletConfig.getServletName();
             if (!(servletContext instanceof ServletServiceContext)) {
-                break;
+                this.logger.info(servletName + " isn't Servlet-Service servlet, it will be
ignored.");
+                continue;
             }
 
             ServletServiceContext servletServiceContext = (ServletServiceContext) servletContext;
-            String servletName = servletConfig.getServletName();
             ObjectName name = null;
-            String stringName = "org.apache.cocoon.monitoring:group=ServletServices,name="
+ servletName + " ["
-                    + this.getMountPath(servletServiceContext) + "]";
+            String stringName = "org.apache.cocoon.monitoring:group=ServletServices,name=["
+                    + this.getMountPath(servletServiceContext) + "] " + servletName;
             try {
                 name = new ObjectName(stringName);
             } catch (MalformedObjectNameException e) {
-                String message = "The string passed as a parameter does not have the right
format.";
-                this.logger.error(message, e);
-                throw new RuntimeException(message, e);
+                this.logger.error("The string passed as a parameter does not have the right
format.", e);
+                continue;
             } catch (NullPointerException e) {
-                String message = "Should never happened. Value of name parameter always is
different than null.";
-                this.logger.fatal(message, e);
-                throw new RuntimeException(message, e);
+                this.logger.fatal("Should never happened. Value of name parameter always
is different than null.", e);
+                continue;
             }
 
             if (name == null) {
-                break;
+                this.logger.error("ObjectName is null, something strange happen. Should never
happen.");
+                continue;
             }
 
-            ServletServiceMonitor serviceServletMonitor = new ServletServiceMonitor(servlet);
+            ServletServiceMonitor servletServiceMonitor = new ServletServiceMonitor(servlet);
             if (!servletNames.contains(stringName)) {
-                exporter.registerManagedResource(serviceServletMonitor, name);
+                exporter.registerManagedResource(servletServiceMonitor, name);
                 servletNames.add(stringName);
             }
         }



Mime
View raw message