You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by rm...@apache.org on 2013/07/29 08:20:58 UTC

svn commit: r1507950 [4/8] - in /commons/sandbox/monitoring/trunk: ./ aop/ aop/src/main/java/org/apache/commons/monitoring/aop/ aop/src/main/java/org/apache/commons/monitoring/instrumentation/ aop/src/main/resources/ aop/src/test/java/org/ aop/src/test...

Modified: commons/sandbox/monitoring/trunk/pom.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/pom.xml?rev=1507950&r1=1507949&r2=1507950&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/pom.xml (original)
+++ commons/sandbox/monitoring/trunk/pom.xml Mon Jul 29 06:20:54 2013
@@ -16,7 +16,7 @@
   limitations under the License.
 -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                     http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
@@ -32,16 +32,20 @@
   <url>http://commons.apache.org/sandbox/monitoring/</url>
   <inceptionYear>2008</inceptionYear>
   <description>
-    Monitoring provides a simple, lightweight toolkit to instrument java application monitoring capabilities, including performances and thread concurrency.
+    Monitoring provides a simple, lightweight toolkit to instrument java application monitoring capabilities, including
+    performances and thread concurrency.
   </description>
 
   <modules>
     <module>core</module>
-    <module>instrumentation</module>
-    <module>spring</module>
-    <module>reporting</module>
     <module>jdbc</module>
+    <module>aop</module>
     <module>cdi</module>
+    <module>spring</module>
+    <module>web</module>
+    <module>reporting</module>
+    <module>cxf</module>
+    <module>aspectj</module>
   </modules>
 
   <developers>
@@ -60,6 +64,43 @@
     <url>http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/</url>
   </scm>
 
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.rat</groupId>
+        <artifactId>apache-rat-plugin</artifactId>
+        <version>0.7</version>
+        <configuration>
+          <includes>
+            <include>src/**/*</include>
+            <include>pom.xml</include>
+          </includes>
+          <excludes>
+            <exclude>**/*/MANIFEST.MF</exclude>
+            <exclude>.git</exclude>
+            <exclude>.gitignore</exclude>
+            <exclude>**/webapp/js/*.js</exclude>
+            <exclude>**/webapp/css/*.css</exclude>
+          </excludes>
+        </configuration>
+        <executions>
+          <execution>
+            <phase>verify</phase>
+            <goals>
+              <goal>check</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+    <extensions>
+      <extension>
+        <groupId>org.apache.maven.wagon</groupId>
+        <artifactId>wagon-webdav</artifactId>
+        <version>1.0-beta-2</version>
+      </extension>
+    </extensions>
+  </build>
 
   <distributionManagement>
     <site>
@@ -71,8 +112,8 @@
 
   <!-- Compiler source and target JVM (see parent pom) -->
   <properties>
-    <maven.compile.source>1.5</maven.compile.source>
-    <maven.compile.target>1.5</maven.compile.target>
+    <maven.compile.source>1.6</maven.compile.source>
+    <maven.compile.target>1.6</maven.compile.target>
     <commons.componentid>monitoring</commons.componentid>
     <commons.jira.componentid>12312100</commons.jira.componentid>
   </properties>
@@ -86,14 +127,10 @@
         <scope>test</scope>
       </dependency>
       <dependency>
-        <groupId>org.apache.commons.monitoring</groupId>
-        <artifactId>commons-monitoring-core</artifactId>
-        <version>${project.version}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.apache.commons.monitoring</groupId>
-        <artifactId>commons-monitoring-instrumentation</artifactId>
-        <version>${project.version}</version>
+        <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-servlet_2.5_spec</artifactId>
+        <version>1.2</version>
+        <scope>provided</scope>
       </dependency>
     </dependencies>
   </dependencyManagement>

Modified: commons/sandbox/monitoring/trunk/reporting/pom.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/reporting/pom.xml?rev=1507950&r1=1507949&r2=1507950&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/reporting/pom.xml (original)
+++ commons/sandbox/monitoring/trunk/reporting/pom.xml Mon Jul 29 06:20:54 2013
@@ -15,62 +15,74 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
   <parent>
     <artifactId>commons-monitoring-parent</artifactId>
     <groupId>org.apache.commons.monitoring</groupId>
     <version>1.0-SNAPSHOT</version>
   </parent>
-  <modelVersion>4.0.0</modelVersion>
+
   <artifactId>commons-monitoring-reporting</artifactId>
-  <name>Commons Monitoring (Sandbox) reporting</name>
+  <name>Commons Monitoring (Sandbox) :: Reporting</name>
+  <packaging>war</packaging>
+
   <dependencies>
     <dependency>
       <groupId>org.apache.commons.monitoring</groupId>
       <artifactId>commons-monitoring-core</artifactId>
       <version>${project.version}</version>
+      <scope>provided</scope> <!-- using to put it in the container to get JDBC monitoring and deploy the webapp -->
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-lang3</artifactId>
+      <version>3.1</version>
     </dependency>
     <dependency>
-      <groupId>commons-lang</groupId>
-      <artifactId>commons-lang</artifactId>
-      <version>2.4</version>
-    </dependency>
-    <dependency>
-      <groupId>javax.servlet</groupId>
-      <artifactId>servlet-api</artifactId>
-      <version>[2.3,)</version>
-    </dependency>
-    <dependency>
-      <groupId>javax.ws.rs</groupId>
-      <artifactId>jsr311-api</artifactId>
-      <version>1.1</version>
-      <optional>true</optional>
-    </dependency>   
-    
+      <groupId>org.apache.geronimo.specs</groupId>
+      <artifactId>geronimo-servlet_2.5_spec</artifactId>
+    </dependency>
+
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <version>4.5</version>
-      <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>xmlunit</groupId>
       <artifactId>xmlunit</artifactId>
       <version>1.3</version>
-	  <scope>test</scope>
+      <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.codehaus.jettison</groupId>
       <artifactId>jettison</artifactId>
       <version>1.2</version>
-	  <scope>test</scope>
+      <scope>test</scope>
     </dependency>
   </dependencies>
-  
+
   <repositories>
     <repository>
-        <id>java.net</id>
-        <url>http://download.java.net/maven/2</url>
-     </repository>
+      <id>java.net</id>
+      <url>http://download.java.net/maven/2</url>
+    </repository>
   </repositories>
-</project>
\ No newline at end of file
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-war-plugin</artifactId>
+        <version>2.4</version>
+        <configuration>
+          <archiveClasses>true</archiveClasses>
+          <attachClasses>true</attachClasses>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Copied: commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/AbstractVisitor.java (from r1506987, commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/AbstractVisitor.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/AbstractVisitor.java?p2=commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/AbstractVisitor.java&p1=commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/AbstractVisitor.java&r1=1506987&r2=1507950&rev=1507950&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/AbstractVisitor.java (original)
+++ commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/AbstractVisitor.java Mon Jul 29 06:20:54 2013
@@ -15,125 +15,69 @@
  * limitations under the License.
  */
 
-package org.apache.commons.monitoring.reporting;
+package org.apache.commons.monitoring.reporting.format;
 
-import java.util.Collection;
-
-import org.apache.commons.monitoring.Counter;
-import org.apache.commons.monitoring.Gauge;
-import org.apache.commons.monitoring.Metric;
-import org.apache.commons.monitoring.Monitor;
-import org.apache.commons.monitoring.Repository;
+import org.apache.commons.monitoring.Role;
 import org.apache.commons.monitoring.Visitor;
+import org.apache.commons.monitoring.counter.Counter;
+import org.apache.commons.monitoring.monitors.Monitor;
+import org.apache.commons.monitoring.repositories.Repository;
+
+import java.util.Collection;
 
-public abstract class AbstractVisitor
-    implements Visitor
-{
-    private RepositoryFilter filter = FULL;
+public abstract class AbstractVisitor implements Visitor {
+    protected final RoleFilter filter;
 
-    public void setFilter( RepositoryFilter filter )
-    {
+    public AbstractVisitor(final RoleFilter filter) {
         this.filter = filter;
     }
 
-    protected abstract void monitorEnd( String name );
-
-    protected abstract void monitorStart( Monitor monitor );
-
-    protected abstract void gaugeStart( String name );
-
-    protected abstract void gaugeEnd( String name );
-
-    protected abstract void counterStart( String name );
-
-    protected abstract void counterEnd( String name );
-
+    protected abstract void monitorEnd(String name);
+    protected abstract void monitorStart(Monitor monitor);
+    protected abstract void counterStart(String name);
+    protected abstract void counterEnd(String name);
     protected abstract void repositoryEnd();
-
     protected abstract void repositoryStart();
+    protected abstract void attribute(String name, double value);
+    protected abstract void attribute(String name, String value);
+    protected abstract void doVisit(final Repository repository);
+    protected abstract void doVisit(final Monitor monitor);
 
-    protected abstract void attribute( String name, double value );
-
-    protected abstract void attribute( String name, String value );
-
-    public final void visit( Repository repository )
-    {
+    public final void visit(final Repository repository) {
         repositoryStart();
-        doVisit( repository );
+        doVisit(repository);
         repositoryEnd();
     }
 
-    protected abstract void doVisit( Repository repository );
-
-    protected Collection<Monitor> getMonitors( Repository repository )
-    {
+    protected Collection<Monitor> getMonitors(final Repository repository) {
         return repository.getMonitors();
     }
 
-    public final void visit( Monitor monitor )
-    {
-        Monitor.Key key = monitor.getKey();
-        String name = key.getName();
-        monitorStart( monitor );
-        doVisit( monitor );
-        monitorEnd( name );
-    }
-
-    protected abstract void doVisit( Monitor monitor );
-
-    protected Collection<Metric> getMetrics( Monitor monitor )
-    {
-        return monitor.getMetrics();
-    }
-
-    public final void visit( Gauge gauge )
-    {
-        String name = gauge.getRole().getName();
-        gaugeStart( name );
-        attribute( "unit", gauge.getUnit().getName() );
-        attribute( "value", gauge.getValue() );
-        attribute( "max", gauge.getMax() );
-        attribute( "min", gauge.getMin() );
-        attribute( "hits", gauge.getHits() );
-        attribute( "standardDeviation", gauge.getStandardDeviation() );
-        attribute( "variance", gauge.getVariance() );
-        attribute( "mean", gauge.getMean() );
-        attribute( "geometricMean", gauge.getGeometricMean() );
-        attribute( "sumOfLogs", gauge.getSumOfLogs() );
-        attribute( "sumOfSquares", gauge.getSumOfSquares() );
-        gaugeEnd( name );
-    }
-
-    public final void visit( Counter counter )
-    {
-        String name = counter.getRole().getName();
-        counterStart( name );
-        attribute( "unit", counter.getUnit().getName() );
-        attribute( "sum", counter.getSum() );
-        attribute( "max", counter.getMax() );
-        attribute( "min", counter.getMin() );
-        attribute( "hits", counter.getHits() );
-        attribute( "standardDeviation", counter.getStandardDeviation() );
-        attribute( "variance", counter.getVariance() );
-        attribute( "mean", counter.getMean() );
-        attribute( "geometricMean", counter.getGeometricMean() );
-        attribute( "sumOfLogs", counter.getSumOfLogs() );
-        attribute( "sumOfSquares", counter.getSumOfSquares() );
-        counterEnd( name );
-    }
-
-    private static final RepositoryFilter FULL = new RepositoryFilter()
-    {
-
-        public boolean filter( Monitor monitor )
-        {
-            return true;
-        }
+    public final void visit(final Monitor monitor) {
+        final Monitor.Key key = monitor.getKey();
+        final String name = key.getName();
+        monitorStart(monitor);
+        doVisit(monitor);
+        monitorEnd(name);
+    }
 
-        public boolean filter( Metric metric )
-        {
-            return true;
+    protected Collection<Counter> getMetrics(final Monitor monitor) {
+        return monitor.getCounters();
+    }
+
+    private void attributes(final Counter counter) {
+        for (final MetricData md : MetricData.values()) {
+            attribute(md.name(), md.value(counter));
         }
+    }
 
-    };
+    public final void visit(final Counter counter) {
+        final Role role = counter.getRole();
+        if (filter.accept(role)) {
+            final String name = role.getName();
+            counterStart(name);
+            attributes(counter);
+            counterEnd(name);
+        }
+    }
 }
\ No newline at end of file

Added: commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/CSVFormat.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/CSVFormat.java?rev=1507950&view=auto
==============================================================================
--- commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/CSVFormat.java (added)
+++ commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/CSVFormat.java Mon Jul 29 06:20:54 2013
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.monitoring.reporting.format;
+
+import org.apache.commons.monitoring.configuration.Configuration;
+import org.apache.commons.monitoring.monitors.Monitor;
+
+import java.io.PrintWriter;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+public class CSVFormat implements Format {
+    private static final String SEPARATOR = Configuration.getProperty(Configuration.COMMONS_MONITORING_PREFIX + "csv.separator", ";");
+    private static final String ATTRIBUTES_CSV = buildMetricDataHeader();
+
+    public static final String HEADER = "Monitor" + SEPARATOR + "Category" + SEPARATOR + "Role" + SEPARATOR + ATTRIBUTES_CSV + "\n";
+
+    private static final Collection<String> ATTRIBUTES_ORDERED_LIST = Arrays.asList(ATTRIBUTES_CSV.split(SEPARATOR));
+
+    private static String buildMetricDataHeader() {
+        final StringBuilder builder = new StringBuilder();
+        for (final MetricData md : MetricData.values()) {
+            builder.append(md.name()).append(SEPARATOR);
+        }
+
+        final String str = builder.toString();
+        return str.substring(0, str.length() - 1);
+    }
+
+    private String monitorName;
+    private StringBuilder builder = new StringBuilder();
+    private final Map<String, String> attributes = new HashMap<String, String>();
+
+    public void repositoryStart(final PrintWriter writer) {
+        writer.write(HEADER);
+    }
+
+    public void repositoryEnd(final PrintWriter writer) {
+        // no-op
+    }
+
+    public void monitorStart(final PrintWriter writer, final Monitor monitor) {
+        monitorName = monitor.getKey().getName() + SEPARATOR + monitor.getKey().getCategory() + SEPARATOR;
+    }
+
+    public void monitorEnd(final PrintWriter writer, final String name) {
+        // no-op
+    }
+
+    public void counterStart(final PrintWriter writer, final String name) {
+        builder.append(monitorName).append(name).append(SEPARATOR);
+        attributes.clear();
+    }
+
+    public void counterEnd(final PrintWriter writer, final String name) {
+        for (final String key : ATTRIBUTES_ORDERED_LIST) {
+            final String value = attributes.get(key);
+            if (value != null) {
+                builder.append(value);
+            } else {
+                builder.append("?");
+            }
+            builder.append(SEPARATOR);
+        }
+
+        final String s = builder.toString();
+        writer.write(s.substring(0, s.length() - 1) + "\n");
+        builder = new StringBuilder();
+    }
+
+    public void attribute(final PrintWriter writer, String name, final String value) {
+        attributes.put(name, value);
+    }
+
+    public void separator(final PrintWriter writer) {
+        // no-op
+    }
+
+    public void escape(final PrintWriter writer, final String string) {
+        builder.append(string).append(SEPARATOR);
+    }
+}

Copied: commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/Format.java (from r1506987, commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/Format.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/Format.java?p2=commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/Format.java&p1=commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/Format.java&r1=1506987&r2=1507950&rev=1507950&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/Format.java (original)
+++ commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/Format.java Mon Jul 29 06:20:54 2013
@@ -15,42 +15,38 @@
  * limitations under the License.
  */
 
-package org.apache.commons.monitoring.reporting;
+package org.apache.commons.monitoring.reporting.format;
 
-import java.io.PrintWriter;
-
-import org.apache.commons.monitoring.Monitor;
-
-public interface Format
-{
-
-    void repositoryStart( PrintWriter writer );
+import org.apache.commons.monitoring.monitors.Monitor;
 
-    void repositoryEnd( PrintWriter writer );
-
-    void monitorStart( PrintWriter writer, Monitor monitor );
-
-    void monitorEnd( PrintWriter writer, String name );
+import java.io.PrintWriter;
 
-    void gaugeStart( PrintWriter writer, String name );
+public interface Format {
 
-    void gaugeEnd( PrintWriter writer, String name );
+    void repositoryStart(PrintWriter writer);
 
-    void counterStart( PrintWriter writer, String name );
+    void repositoryEnd(PrintWriter writer);
 
-    void counterEnd( PrintWriter writer, String name );
+    void monitorStart(PrintWriter writer, Monitor monitor);
 
-    void attribute( PrintWriter writer, String name, String value );
+    void monitorEnd(PrintWriter writer, String name);
 
-    void separator( PrintWriter writer );
+    void counterStart(PrintWriter writer, String name);
 
-    void escape( PrintWriter writer, String string );
+    void counterEnd(PrintWriter writer, String name);
 
-    public static final Format JSON = new JSONFormat( false );
+    void attribute(PrintWriter writer, String name, String value);
 
-    public static final Format JSON_PRETTY = new JSONFormat( true );
+    void separator(PrintWriter writer);
 
-    public static final Format XML = new XMLFormat( false );
+    void escape(PrintWriter writer, String string);
 
-    public static final Format XML_PRETTY = new XMLFormat( true );;
+    public static interface Defaults {
+        static final Format JSON = new JSONFormat(false);
+        static final Format JSON_PRETTY = new JSONFormat(true);
+        static final Format XML = new XMLFormat(false);
+        static final Format XML_PRETTY = new XMLFormat(true);
+        static final Format CSV = new CSVFormat();
+        static final Format HTML = new HTMLFormat();
+    }
 }

Copied: commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/FormattingVisitor.java (from r1506987, commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/FormattingVisitor.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/FormattingVisitor.java?p2=commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/FormattingVisitor.java&p1=commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/FormattingVisitor.java&r1=1506987&r2=1507950&rev=1507950&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/FormattingVisitor.java (original)
+++ commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/FormattingVisitor.java Mon Jul 29 06:20:54 2013
@@ -15,73 +15,63 @@
  * limitations under the License.
  */
 
-package org.apache.commons.monitoring.reporting;
+package org.apache.commons.monitoring.reporting.format;
+
+import org.apache.commons.monitoring.counter.Counter;
+import org.apache.commons.monitoring.monitors.Monitor;
+import org.apache.commons.monitoring.repositories.Repository;
 
 import java.io.PrintWriter;
 import java.text.DecimalFormat;
 import java.text.NumberFormat;
 import java.util.Locale;
 
-import org.apache.commons.monitoring.Metric;
-import org.apache.commons.monitoring.Monitor;
-import org.apache.commons.monitoring.Repository;
-
-public class FormattingVisitor
-    extends AbstractVisitor
-{
-    protected PrintWriter writer;
-
-    private NumberFormat numberFormat;
-
-    private Format format;
-
-    public FormattingVisitor( Format format, PrintWriter writer )
-    {
-        super();
+public class FormattingVisitor extends AbstractVisitor {
+    protected final PrintWriter writer;
+    private final NumberFormat numberFormat;
+    private final Format format;
+
+    public FormattingVisitor(final Format format, final PrintWriter writer) {
+        this(format, writer, RoleFilter.Defaults.PERFORMANCES);
+    }
+
+    public FormattingVisitor(final Format format, final PrintWriter writer, final RoleFilter filter) {
+        super(filter);
         this.format = format;
         this.writer = writer;
-        this.numberFormat = DecimalFormat.getNumberInstance( Locale.US );
-        this.numberFormat.setMinimumFractionDigits( 1 );
+        this.numberFormat = DecimalFormat.getNumberInstance(Locale.US);
+        this.numberFormat.setMinimumFractionDigits(1);
     }
 
-    protected void doVisit( Repository repository )
-    {
+    protected void doVisit(final Repository repository) {
         boolean first = true;
-        for ( Monitor monitor : getMonitors( repository ) )
-        {
-            if ( !first )
-            {
+        for (final Monitor monitor : getMonitors(repository)) {
+            if (!first) {
                 separator();
             }
             first = false;
-            monitor.accept( this );
+            monitor.accept(this);
         }
     }
 
-    protected void doVisit( Monitor monitor )
-    {
+    protected void doVisit(final Monitor monitor) {
         boolean first = true;
-        for ( Metric metric : getMetrics( monitor ) )
-        {
-            if ( !first )
-            {
+        for (final Counter counter : getMetrics(monitor)) {
+            if (!first) {
                 separator();
             }
             first = false;
-            metric.accept( this );
+            counter.accept(this);
         }
     }
 
-    protected void attribute( String name, double value )
-    {
-        attribute( name, format( value ) );
+    protected void attribute(final String name, final double value) {
+        attribute(name, format(value));
     }
 
-    protected String format( double value )
-    {
-        String s = numberFormat.format( value );
-        if ( "\uFFFD".equals( s ) )
-        {
+    protected String format(final double value) {
+        String s = numberFormat.format(value);
+        if ("\uFFFD".equals(s)) {
             // Locale may have no DecimalFormatSymbols.NaN (set to "\uFFFD" (REPLACE_CHAR))
             s = "NaN";
         }
@@ -89,66 +79,45 @@ public class FormattingVisitor
     }
 
     @Override
-    protected void repositoryStart()
-    {
-        format.repositoryStart( writer );
+    protected void repositoryStart() {
+        format.repositoryStart(writer);
     }
 
     @Override
-    protected void repositoryEnd()
-    {
-        format.repositoryEnd( writer );
-    }
-    
-    protected void attribute( String name, String value )
-    {
-        format.attribute( writer, name, value );
+    protected void repositoryEnd() {
+        format.repositoryEnd(writer);
     }
 
-    @Override
-    protected void counterEnd( String name )
-    {
-        format.counterEnd( writer, name );
+    protected void attribute(String name, String value) {
+        format.attribute(writer, name, value);
     }
 
     @Override
-    protected void counterStart( String name )
-    {
-        format.counterStart( writer, name );
-    }
-
-    protected void escape( String string )
-    {
-        format.escape( writer, string );
+    protected void counterEnd(String name) {
+        format.counterEnd(writer, name);
     }
 
     @Override
-    protected void gaugeEnd( String name )
-    {
-        format.gaugeEnd( writer, name );
+    protected void counterStart(String name) {
+        format.counterStart(writer, name);
     }
 
-    @Override
-    protected void gaugeStart( String name )
-    {
-        format.gaugeStart( writer, name );
+    protected void escape(String string) {
+        format.escape(writer, string);
     }
 
     @Override
-    protected void monitorStart( Monitor monitor )
-    {
-        format.monitorStart( writer, monitor );
+    protected void monitorStart(Monitor monitor) {
+        format.monitorStart(writer, monitor);
     }
 
     @Override
-    protected void monitorEnd( String name )
-    {
-        format.monitorEnd( writer, name );
+    protected void monitorEnd(String name) {
+        format.monitorEnd(writer, name);
     }
 
-    protected void separator()
-    {
-        format.separator( writer );
+    protected void separator() {
+        format.separator(writer);
     }
 
 

Added: commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/HTMLFormat.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/HTMLFormat.java?rev=1507950&view=auto
==============================================================================
--- commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/HTMLFormat.java (added)
+++ commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/HTMLFormat.java Mon Jul 29 06:20:54 2013
@@ -0,0 +1,150 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.monitoring.reporting.format;
+
+import org.apache.commons.lang3.StringEscapeUtils;
+import org.apache.commons.monitoring.monitors.Monitor;
+
+import java.io.PrintWriter;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+// TODO: write a real front?
+public class HTMLFormat implements Format {
+    private static final Collection<String> ATTRIBUTES_ORDERED_LIST = buildMetricDataHeader();
+
+    private static Collection<String> buildMetricDataHeader() {
+        final Collection<String> list = new CopyOnWriteArrayList<String>();
+        list.add("Monitor");
+        list.add("Category");
+        list.add("Role");
+        for (final MetricData md : MetricData.values()) {
+            list.add(md.name());
+        }
+        return list;
+    }
+
+    private final Map<String, String> attributes = new HashMap<String, String>();
+
+    public void repositoryStart(final PrintWriter writer) {
+        writer.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n" +
+            "<html>\n" +
+            "  <head>\n" +
+            "    <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n" +
+            "    \n" +
+            "    <title>Monitoring HTML Report</title>\n" +
+            "\n" +
+            "    <link href=\"" + RenderingContext.getBase() + "/css/theme.blue.css\" rel=\"stylesheet\">\n" +
+            "    <script type=\"text/javascript\" language=\"javascript\" src=\"" + RenderingContext.getBase() + "/js/jquery.min.js" +"\"></script>\n" +
+            "    <script type=\"text/javascript\" language=\"javascript\" src=\"" + RenderingContext.getBase() + "/js/jquery.tablesorter.js" +"\"></script>\n" +
+            "    <script type=\"text/javascript\" language=\"javascript\" src=\"" + RenderingContext.getBase() + "/js/jquery.tablesorter.widgets.js" +"\"></script>\n" +
+            "  </head>\n" +
+            "  <body>\n" +
+            "    <div id=\"container\">\n" +
+            "      <h1>Report</h1>\n" +
+            "\n" +
+            "      <table class=\"sort-table\" id=\"report-table\" border=\"1\">\n" +
+            "        <thead>\n");
+        writeColumnNames(writer);
+        writer.write("        </thead>\n        <tbody>\n");
+    }
+
+    private void writeColumnNames(PrintWriter writer) {
+        for (final String n : ATTRIBUTES_ORDERED_LIST) {
+            writer.write("<th>");
+            writer.write(n);
+            writer.write("</th>\n");
+        }
+    }
+
+    public void repositoryEnd(final PrintWriter writer) {
+        writer.write("      </table>\n" +
+            "\n" +
+            "    </div>" +
+            "" +
+            "    <script type=\"text/javascript\">\n" +
+            "      $(function(){\n" +
+            "        $(\"#report-table\").tablesorter({\n" +
+            "    theme: 'blue',\n" +
+            "    widthFixed : true,\n" +
+            "    widgets: [\"zebra\", \"filter\"],\n" +
+            "    widgetOptions : {\n" +
+            "      filter_childRows : false,\n" +
+            "      filter_columnFilters : true,\n" +
+            "      filter_cssFilter : 'tablesorter-filter',\n" +
+            "      filter_filteredRow   : 'filtered',\n" +
+            "      filter_formatter : null,\n" +
+            "      filter_functions : null,\n" +
+            "      filter_hideFilters : false, // true, (see note in the options section above)\n" +
+            "      filter_ignoreCase : true,\n" +
+            "      filter_liveSearch : true,\n" +
+            "      filter_reset : 'button.reset',\n" +
+            "      filter_searchDelay : 300,\n" +
+            "      filter_serversideFiltering: false,\n" +
+            "      filter_startsWith : false,\n" +
+            "      filter_useParsedData : false\n" +
+            "\n" +
+            "    }\n" +
+            "\n" +
+            "  });\n" +
+            "      });" +
+            "    </script>" +
+            "  </body>\n" +
+            "</html>");
+    }
+
+    public void monitorStart(final PrintWriter writer, final Monitor monitor) {
+        attributes.put("Monitor", StringEscapeUtils.escapeHtml4(monitor.getKey().getName()));
+        attributes.put("Category", monitor.getKey().getCategory());
+    }
+
+    public void monitorEnd(final PrintWriter writer, final String name) {
+    }
+
+    public void counterStart(final PrintWriter writer, final String name) {
+        attributes.put("Role", name);
+    }
+
+    public void counterEnd(final PrintWriter writer, final String name) {
+        writer.write("<tr>\n");
+        for (final String key : ATTRIBUTES_ORDERED_LIST) {
+            writer.write("<td>");
+            final String value = attributes.get(key);
+            if (value != null) {
+                writer.write(value);
+            } else {
+                writer.write("");
+            }
+            writer.write("</td>\n");
+        }
+        writer.write("</tr>\n");
+    }
+
+    public void attribute(final PrintWriter writer, String name, final String value) {
+        attributes.put(name, value);
+    }
+
+    public void separator(final PrintWriter writer) {
+        // no-op
+    }
+
+    public void escape(final PrintWriter writer, final String string) {
+        //  no-op
+    }
+}

Copied: commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/JSONFormat.java (from r1506987, commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/JSONFormat.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/JSONFormat.java?p2=commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/JSONFormat.java&p1=commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/JSONFormat.java&r1=1506987&r2=1507950&rev=1507950&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/JSONFormat.java (original)
+++ commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/JSONFormat.java Mon Jul 29 06:20:54 2013
@@ -15,116 +15,85 @@
  * limitations under the License.
  */
 
-package org.apache.commons.monitoring.reporting;
+package org.apache.commons.monitoring.reporting.format;
 
-import java.io.PrintWriter;
+import org.apache.commons.lang3.StringEscapeUtils;
+import org.apache.commons.monitoring.monitors.Monitor;
 
-import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.commons.monitoring.Monitor;
+import java.io.PrintWriter;
 
 
 /**
  * Format to JSON (JavaScript), with optional indentation
- * 
+ *
  * @author <a href="mailto:nicolas@apache.org">Nicolas De Loof</a>
  */
-public class JSONFormat
-    implements Format
-{
+public class JSONFormat implements Format {
     private boolean indent;
 
-    public JSONFormat( boolean indent )
-    {
+    public JSONFormat(boolean indent) {
         this.indent = indent;
     }
 
-    public void repositoryStart( PrintWriter writer )
-    {
-        writer.append( "{" );
+    public void repositoryStart(PrintWriter writer) {
+        writer.append("{");
     }
 
-    public void repositoryEnd( PrintWriter writer )
-    {
-        if ( indent )
-        {
-            writer.append( "\n" );
+    public void repositoryEnd(PrintWriter writer) {
+        if (indent) {
+            writer.append("\n");
         }
-        writer.append( "}" );
+        writer.append("}");
     }
 
-    public void monitorStart( PrintWriter writer, Monitor monitor )
-    {
-        if ( indent )
-        {
-            writer.append( "\n  " );
+    public void monitorStart(PrintWriter writer, Monitor monitor) {
+        if (indent) {
+            writer.append("\n  ");
         }
         Monitor.Key key = monitor.getKey();
-        escape( writer, key.getName() );
-        writer.append( ":{" );
-    }
-
-    public void monitorEnd( PrintWriter writer, String name )
-    {
-        if ( indent )
-        {
-            writer.append( "\n  " );
+        escape(writer, key.getName());
+        writer.append(":{");
+        if (indent) {
+            writer.append("\n    \"category\": \"").append(monitor.getKey().getCategory()).append("\",");
         }
-
-        writer.append( "}" );
     }
 
-    public void gaugeStart( PrintWriter writer, String name )
-    {
-        if ( indent )
-        {
-            writer.append( "\n    " );
+    public void monitorEnd(PrintWriter writer, String name) {
+        if (indent) {
+            writer.append("\n  ");
         }
-        escape( writer, name );
-        writer.append( ":{" );
-        writeAttribute( writer, "type", "gauge" );
-    }
 
-    public void gaugeEnd( PrintWriter writer, String name )
-    {
-        writer.append( "}" );
+        writer.append("}");
     }
 
-    public void counterStart( PrintWriter writer, String name )
-    {
-        if ( indent )
-        {
-            writer.append( "\n    " );
+    public void counterStart(PrintWriter writer, String name) {
+        if (indent) {
+            writer.append("\n    ");
         }
-        escape( writer, name );
-        writer.append( ":{" );
-        writeAttribute( writer, "type", "counter" );
+        escape(writer, name);
+        writer.append(":{");
+        writeAttribute(writer, "type", "counter");
     }
 
-    public void counterEnd( PrintWriter writer, String name )
-    {
-        writer.append( "}" );
+    public void counterEnd(PrintWriter writer, String name) {
+        writer.append("}");
     }
 
-    public void attribute( PrintWriter writer, String name, String value )
-    {
-        separator( writer );
-        writeAttribute( writer, name, value );
+    public void attribute(PrintWriter writer, String name, String value) {
+        separator(writer);
+        writeAttribute(writer, name, value);
     }
 
-    protected void writeAttribute( PrintWriter writer, String name, String value )
-    {
-        writer.append( name )
-              .append( ":" );
-        escape( writer, value );
+    protected void writeAttribute(PrintWriter writer, String name, String value) {
+        writer.append("\"").append(name).append("\"").append(":");
+        escape(writer, value);
     }
 
-    public void escape( PrintWriter writer, String string )
-    {
-        writer.append( '\"' ).append( StringEscapeUtils.escapeJavaScript( string ) ).append( '\"' );
+    public void escape(PrintWriter writer, String string) {
+        writer.append('\"').append(StringEscapeUtils.escapeEcmaScript(string)).append('\"');
     }
 
-    public void separator( PrintWriter writer )
-    {
-        writer.append( "," );
+    public void separator(PrintWriter writer) {
+        writer.append(",");
     }
 }
\ No newline at end of file

Copied: commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/MetricData.java (from r1506987, commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/MetricData.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/MetricData.java?p2=commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/MetricData.java&p1=commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/MetricData.java&r1=1506987&r2=1507950&rev=1507950&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/MetricData.java (original)
+++ commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/MetricData.java Mon Jul 29 06:20:54 2013
@@ -15,118 +15,97 @@
  * limitations under the License.
  */
 
-package org.apache.commons.monitoring.reporting;
+package org.apache.commons.monitoring.reporting.format;
 
-import org.apache.commons.monitoring.Gauge;
-import org.apache.commons.monitoring.Metric;
+import org.apache.commons.monitoring.counter.Counter;
 
 /**
- * An enum to acces data from a Metric based on the property name. Can be used to avoid reflection on Metric
+ * An enum to acces data from a Counter based on the property name. Can be used to avoid reflection on Counter
  * implementation when requesting data and undesirable exposure of internals.
- * <p>
+ * <p/>
  * example :
- * 
+ * <p/>
  * <pre>
  * String property = httpServletRequest.getParameter( &quot;property&quot; );
- * 
+ *
  * Double data = MetricData.valueOf( property ).value( metric );
  * </pre>
- * 
+ *
  * @author <a href="mailto:nicolas@apache.org">Nicolas De Loof</a>
  */
-public enum MetricData
-{
-    Hits
-    {
+public enum MetricData {
+    Hits {
         @Override
-        public double value( Metric metric )
-        {
-            return metric.getHits();
+        public double value(final Counter counter) {
+            return counter.getHits();
         }
     },
-    Max
-    {
+    Max {
         @Override
-        public double value( Metric metric )
-        {
-            return metric.getMax();
+        public double value(final Counter counter) {
+            return counter.getMax();
         }
     },
-    Mean
-    {
+    Mean {
         @Override
-        public double value( Metric metric )
-        {
-            return metric.getMean();
+        public double value(final Counter counter) {
+            return counter.getMean();
         }
     },
-    Min
-    {
+    Min {
         @Override
-        public double value( Metric metric )
-        {
-            return metric.getMin();
+        public double value(final Counter counter) {
+            return counter.getMin();
         }
     },
-    StandardDeviation
-    {
+    StandardDeviation {
         @Override
-        public double value( Metric metric )
-        {
-            return metric.getStandardDeviation();
+        public double value(final Counter counter) {
+            return counter.getStandardDeviation();
         }
     },
-    Sum
-    {
+    Sum {
         @Override
-        public double value( Metric metric )
-        {
-            return metric.getSum();
+        public double value(final Counter counter) {
+            return counter.getSum();
         }
     },
-    SumOfLogs
-    {
+    SumOfLogs {
         @Override
-        public double value( Metric metric )
-        {
-            return metric.getSumOfLogs();
+        public double value(final Counter counter) {
+            return counter.getSumOfLogs();
         }
     },
-    SumOfSquares
-    {
+    SumOfSquares {
         @Override
-        public double value( Metric metric )
-        {
-            return metric.getSumOfSquares();
+        public double value(final Counter counter) {
+            return counter.getSumOfSquares();
         }
     },
-    Variance
-    {
+    Variance {
         @Override
-        public double value( Metric metric )
-        {
-            return metric.getVariance();
+        public double value(final Counter counter) {
+            return counter.getVariance();
         }
     },
-    GeometricMean
-    {
+    GeometricMean {
         @Override
-        public double value( Metric metric )
-        {
-            return metric.getGeometricMean();
+        public double value(final Counter counter) {
+            return counter.getGeometricMean();
         }
     },
-    Value
-    {
+    Value {
         @Override
-        public double value( Metric metric )
-        {
-            if ( metric instanceof Gauge )
-            {
-                return ( (Gauge) metric ).getValue();
-            }
-            return metric.getSum();
+        public double value(final Counter counter) {
+            return counter.getSum();
+        }
+    },
+    MaxConcurrency {
+        @Override
+        public double value(final Counter counter) {
+            return counter.getMonitor().getMaxConcurrency();
         }
     };
-    public abstract double value( Metric metric );
+
+    public abstract double value(Counter counter);
 }
\ No newline at end of file

Added: commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/RenderingContext.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/RenderingContext.java?rev=1507950&view=auto
==============================================================================
--- commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/RenderingContext.java (added)
+++ commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/RenderingContext.java Mon Jul 29 06:20:54 2013
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.monitoring.reporting.format;
+
+public class RenderingContext {
+    private static final ThreadLocal<RenderingContext> CONTEXT = new ThreadLocal<RenderingContext>() {
+        @Override
+        public RenderingContext initialValue() {
+            return new RenderingContext();
+        }
+    };
+
+    private String base;
+
+    public static String getBase() {
+        return CONTEXT.get().base;
+    }
+
+    public static String setBase(final String base) {
+        return CONTEXT.get().base = base;
+    }
+
+    public static void clear() {
+        CONTEXT.remove();
+    }
+}

Added: commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/RoleFilter.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/RoleFilter.java?rev=1507950&view=auto
==============================================================================
--- commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/RoleFilter.java (added)
+++ commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/RoleFilter.java Mon Jul 29 06:20:54 2013
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.monitoring.reporting.format;
+
+import org.apache.commons.monitoring.Role;
+
+public interface RoleFilter {
+    boolean accept(Role role);
+
+    public static enum Defaults implements RoleFilter {
+        PERFORMANCES {
+            @Override
+            public boolean accept(final Role role) {
+                return role == Role.PERFORMANCES;
+            }
+        },
+        FAILURES{
+            @Override
+            public boolean accept(final Role role) {
+                return role == Role.FAILURES;
+            }
+        }
+    }
+}

Copied: commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/XMLFormat.java (from r1506987, commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/XMLFormat.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/XMLFormat.java?p2=commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/XMLFormat.java&p1=commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/XMLFormat.java&r1=1506987&r2=1507950&rev=1507950&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/XMLFormat.java (original)
+++ commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/XMLFormat.java Mon Jul 29 06:20:54 2013
@@ -15,112 +15,80 @@
  * limitations under the License.
  */
 
-package org.apache.commons.monitoring.reporting;
+package org.apache.commons.monitoring.reporting.format;
 
-import java.io.PrintWriter;
+import org.apache.commons.lang3.StringEscapeUtils;
+import org.apache.commons.monitoring.monitors.Monitor;
 
-import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.commons.monitoring.Monitor;
+import java.io.PrintWriter;
 
 /**
  * Format to XML, with optional indentation
- * 
+ *
  * @author <a href="mailto:nicolas@apache.org">Nicolas De Loof</a>
  */
-public class XMLFormat
-    implements Format
-{
-    public XMLFormat( boolean indent )
-    {
+public class XMLFormat implements Format {
+    public XMLFormat(boolean indent) {
         super();
         this.indent = indent;
     }
 
     private boolean indent;
 
-    public void repositoryStart( PrintWriter writer )
-    {
-        writer.append( "<repository>" );
+    public void repositoryStart(PrintWriter writer) {
+        writer.append("<repository>");
     }
 
-    public void repositoryEnd( PrintWriter writer )
-    {
-        if ( indent )
-        {
-            writer.append( "\n" );
+    public void repositoryEnd(PrintWriter writer) {
+        if (indent) {
+            writer.append("\n");
         }
-        writer.append( "</repository>" );
+        writer.append("</repository>");
     }
 
-    public void monitorStart( PrintWriter writer, Monitor monitor )
-    {
-        if ( indent )
-        {
-            writer.append( "\n  " );
+    public void monitorStart(PrintWriter writer, Monitor monitor) {
+        if (indent) {
+            writer.append("\n  ");
         }
-        writer.append( "<monitor" );
+        writer.append("<monitor");
         Monitor.Key key = monitor.getKey();
-        attribute( writer, "name", key.getName() );
-        attribute( writer, "category", key.getCategory() );
-        attribute( writer, "subsystem", key.getSubsystem() );
-        writer.append( '>' );
+        attribute(writer, "name", key.getName());
+        attribute(writer, "category", key.getCategory());
+        writer.append('>');
     }
 
-    public void monitorEnd( PrintWriter writer, String name )
-    {
-        if ( indent )
-        {
-            writer.append( "\n  " );
+    public void monitorEnd(PrintWriter writer, String name) {
+        if (indent) {
+            writer.append("\n  ");
         }
-        writer.append( "</monitor>" );
-    }
-
-    public void gaugeStart( PrintWriter writer, String name )
-    {
-        if ( indent )
-        {
-            writer.append( "\n    " );
-        }
-        writer.append( "<gauge" );
-        attribute( writer, "role", name );
-    }
-
-    public void gaugeEnd( PrintWriter writer, String name )
-    {
-        writer.append( "/>" );
+        writer.append("</monitor>");
     }
 
-    public void counterStart( PrintWriter writer, String name )
-    {
-        if ( indent )
-        {
-            writer.append( "\n    " );
+    public void counterStart(PrintWriter writer, String name) {
+        if (indent) {
+            writer.append("\n    ");
         }
-        writer.append( "<counter" );
-        attribute( writer, "role", name );
+        writer.append("<counter");
+        attribute(writer, "role", name);
     }
 
-    public void counterEnd( PrintWriter writer, String name )
-    {
-        writer.append( "/>" );
+    public void counterEnd(PrintWriter writer, String name) {
+        writer.append("/>");
     }
 
-    public void attribute( PrintWriter writer, String name, String value )
-    {
-        writer.append( " " )
-              .append( name )
-              .append( "=\"" );
-        escape( writer, value );
-        writer.append( "\"" );
+    public void attribute(PrintWriter writer, String name, String value) {
+        writer.append(" ")
+            .append(name)
+            .append("=\"");
+        escape(writer, value);
+        writer.append("\"");
     }
 
-    public void escape( PrintWriter writer, String string )
-    {
-        writer.append( StringEscapeUtils.escapeXml( string ) );
+    public void escape(PrintWriter writer, String string) {
+        writer.append(StringEscapeUtils.escapeXml(string));
     }
 
-    public void separator( PrintWriter writer )
-    {
+    public void separator(PrintWriter writer) {
         // Nop
     }
 }
\ No newline at end of file

Modified: commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/web/HttpUtils.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/web/HttpUtils.java?rev=1507950&r1=1507949&r2=1507950&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/web/HttpUtils.java (original)
+++ commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/web/HttpUtils.java Mon Jul 29 06:20:54 2013
@@ -17,54 +17,40 @@
 
 package org.apache.commons.monitoring.reporting.web;
 
-import java.util.Locale;
+public class HttpUtils {
 
-public class HttpUtils
-{
-
-    public static String parseAccept( String header )
-    {
-        return getPrefered( header );
+    public static String parseAccept(String header) {
+        return getPrefered(header);
     }
 
-    private static String getPrefered( String header )
-    {
-        if ( header == null )
-        {
+    private static String getPrefered(String header) {
+        if (header == null) {
             return null;
         }
-        String[] languages = header.split( "," );
-        String prefered;
+        final String[] languages = header.split(",");
+        String prefered = null;
         double preference = 0.0D;
-        for ( String language : languages )
-        {
-            int idx = language.indexOf( ';' );
-            if ( idx > 0 )
-            {
-                String paramString = language.substring( idx + 1 );
-                double d = getQuality( paramString );
-                if ( d > preference )
-                {
+        for (String language : languages) {
+            int idx = language.indexOf(';');
+            if (idx > 0) {
+                String paramString = language.substring(idx + 1);
+                double d = getQuality(paramString);
+                if (d > preference) {
                     preference = d;
-                    prefered = language.substring( 0, idx );
+                    prefered = language.substring(0, idx);
                 }
-            }
-            else
-            {
+            } else {
                 return language;
             }
         }
-        return null;
+        return prefered;
     }
 
-    private static double getQuality( String paramString )
-    {
-        String[] params = paramString.split( ";" );
-        for ( String param : params )
-        {
-            if ( param.startsWith( "q=" ) )
-            {
-                return Double.parseDouble( param.substring( 2 ) );
+    private static double getQuality(String paramString) {
+        final String[] params = paramString.split(";");
+        for (final String param : params) {
+            if (param.startsWith("q=")) {
+                return Double.parseDouble(param.substring(2));
             }
         }
         return 1;

Modified: commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/web/MonitoringServlet.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/web/MonitoringServlet.java?rev=1507950&r1=1507949&r2=1507950&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/web/MonitoringServlet.java (original)
+++ commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/web/MonitoringServlet.java Mon Jul 29 06:20:54 2013
@@ -17,65 +17,65 @@
 
 package org.apache.commons.monitoring.reporting.web;
 
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
+import org.apache.commons.monitoring.reporting.format.Format;
+import org.apache.commons.monitoring.reporting.format.FormattingVisitor;
+import org.apache.commons.monitoring.reporting.format.RenderingContext;
+import org.apache.commons.monitoring.repositories.Repository;
 
-import javax.servlet.ServletConfig;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
 
-import org.apache.commons.monitoring.Repository;
-import org.apache.commons.monitoring.Visitor;
-import org.apache.commons.monitoring.reporting.Format;
-import org.apache.commons.monitoring.reporting.FormattingVisitor;
-
-public class MonitoringServlet
-    extends HttpServlet
-{
-    private Repository repository;
-
-    @Override
-    public void init( ServletConfig config )
-        throws ServletException
-    {
-        repository = (Repository) config.getServletContext().getAttribute( Repository.class.getName() );
-    }
-
+public class MonitoringServlet extends HttpServlet {
+    private static Map<String, Format> extensions = new HashMap<String, Format>();
     private static Map<String, Format> formats = new HashMap<String, Format>();
-    static
-    {
-        formats.put( "application/json", Format.JSON );
-        formats.put( "text/javascript", Format.JSON );
-        formats.put( "application/xml", Format.XML );
-        formats.put( "text/xml", Format.XML );
-    }
 
-    private static Map<String, Format> extensions = new HashMap<String, Format>();
-    static
-    {
-        extensions.put( "json", Format.JSON );
-        extensions.put( "js", Format.JSON );
-        extensions.put( "xml", Format.XML );
+    static {
+        formats.put("application/json", Format.Defaults.JSON);
+        formats.put("text/javascript", Format.Defaults.JSON);
+        formats.put("application/xml", Format.Defaults.XML);
+        formats.put("text/xml", Format.Defaults.XML);
+        formats.put("text/plain", Format.Defaults.CSV);
+        formats.put("text/csv", Format.Defaults.CSV);
+        formats.put("text/html", Format.Defaults.HTML);
+
+        extensions.put("json", Format.Defaults.JSON);
+        extensions.put("js", Format.Defaults.JSON);
+        extensions.put("xml", Format.Defaults.XML);
+        extensions.put("csv", Format.Defaults.CSV);
+        extensions.put("html", Format.Defaults.HTML);
+        extensions.put("htm", Format.Defaults.HTML);
+        extensions.put("xhtml", Format.Defaults.HTML);
     }
 
     @Override
-    protected void doGet( HttpServletRequest req, HttpServletResponse resp )
-        throws ServletException, IOException
-    {
-        String mime = HttpUtils.parseAccept( req.getHeader( "Accept" ) );
-        Format format = formats.get( mime );
-           
-        if ( format == null )
-        {
-            String path = req.getRequestURI();
-            String extension = path.substring( path.lastIndexOf( '.' ) );
-            format = formats.get( extension );
+    protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException {
+        Format format = null;
+
+        final String path = req.getRequestURI();
+        final int dot = path.lastIndexOf('.');
+        if (dot >= 0) {
+            format = extensions.get(path.substring(dot + 1).toLowerCase(Locale.ENGLISH));
+        } else {
+            final String mime = HttpUtils.parseAccept(req.getHeader("Accept"));
+            if (mime != null) {
+                format = formats.get(mime);
+            }
+        }
+        if (format == null) {
+            format = Format.Defaults.CSV;
+        }
+
+        RenderingContext.setBase(req.getContextPath());
+        try {
+            Repository.INSTANCE.accept(new FormattingVisitor(format, resp.getWriter()));
+        } finally {
+            RenderingContext.clear();
         }
-        
-        Visitor visitor = new FormattingVisitor( format, resp.getWriter() );
-        repository.accept( visitor );
     }
 }

Added: commons/sandbox/monitoring/trunk/reporting/src/main/resources/META-INF/LICENSE.TXT
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/reporting/src/main/resources/META-INF/LICENSE.TXT?rev=1507950&view=auto
==============================================================================
--- commons/sandbox/monitoring/trunk/reporting/src/main/resources/META-INF/LICENSE.TXT (added)
+++ commons/sandbox/monitoring/trunk/reporting/src/main/resources/META-INF/LICENSE.TXT Mon Jul 29 06:20:54 2013
@@ -0,0 +1,24 @@
+MIT
+---
+
+The MIT License (MIT)
+
+Copyright (c) <year> <copyright holders>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.

Added: commons/sandbox/monitoring/trunk/reporting/src/main/resources/META-INF/NOTICE.txt
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/reporting/src/main/resources/META-INF/NOTICE.txt?rev=1507950&view=auto
==============================================================================
--- commons/sandbox/monitoring/trunk/reporting/src/main/resources/META-INF/NOTICE.txt (added)
+++ commons/sandbox/monitoring/trunk/reporting/src/main/resources/META-INF/NOTICE.txt Mon Jul 29 06:20:54 2013
@@ -0,0 +1,4 @@
+Table sorter
+
+website: https://github.com/Mottie/tablesorter
+licence: MIT
\ No newline at end of file

Added: commons/sandbox/monitoring/trunk/reporting/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/reporting/src/main/webapp/WEB-INF/web.xml?rev=1507950&view=auto
==============================================================================
--- commons/sandbox/monitoring/trunk/reporting/src/main/webapp/WEB-INF/web.xml (added)
+++ commons/sandbox/monitoring/trunk/reporting/src/main/webapp/WEB-INF/web.xml Mon Jul 29 06:20:54 2013
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+         version="2.5">
+
+  <servlet>
+    <servlet-name>Monitoring</servlet-name>
+    <servlet-class>org.apache.commons.monitoring.reporting.web.MonitoringServlet</servlet-class>
+  </servlet>
+
+  <servlet-mapping>
+    <servlet-name>Monitoring</servlet-name>
+    <url-pattern>/report.csv</url-pattern>
+  </servlet-mapping>
+  <servlet-mapping>
+    <servlet-name>Monitoring</servlet-name>
+    <url-pattern>/report.html</url-pattern>
+  </servlet-mapping>
+  <servlet-mapping>
+    <servlet-name>Monitoring</servlet-name>
+    <url-pattern>/report.json</url-pattern>
+  </servlet-mapping>
+  <servlet-mapping>
+    <servlet-name>Monitoring</servlet-name>
+    <url-pattern>/report.xml</url-pattern>
+  </servlet-mapping>
+</web-app>

Added: commons/sandbox/monitoring/trunk/reporting/src/main/webapp/css/theme.blue.css
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/reporting/src/main/webapp/css/theme.blue.css?rev=1507950&view=auto
==============================================================================
--- commons/sandbox/monitoring/trunk/reporting/src/main/webapp/css/theme.blue.css (added)
+++ commons/sandbox/monitoring/trunk/reporting/src/main/webapp/css/theme.blue.css Mon Jul 29 06:20:54 2013
@@ -0,0 +1,215 @@
+/*************
+  Blue Theme
+ *************/
+/* overall */
+.tablesorter-blue {
+	width: 100%;
+	background-color: #fff;
+	margin: 10px 0 15px;
+	text-align: left;
+	border-spacing: 0;
+	border: #cdcdcd 1px solid;
+	border-width: 1px 0 0 1px;
+}
+.tablesorter-blue th,
+.tablesorter-blue td {
+	border: #cdcdcd 1px solid;
+	border-width: 0 1px 1px 0;
+}
+
+/* header */
+.tablesorter-blue th,
+.tablesorter-blue thead td {
+	font: bold 12px/18px Arial, Sans-serif;
+	color: #000;
+	background-color: #99bfe6;
+	border-collapse: collapse;
+	padding: 4px;
+	text-shadow: 0 1px 0 rgba(204, 204, 204, 0.7);
+}
+.tablesorter-blue tbody td,
+.tablesorter-blue tfoot th,
+.tablesorter-blue tfoot td {
+	padding: 4px;
+	vertical-align: top;
+}
+.tablesorter-blue .header,
+.tablesorter-blue .tablesorter-header {
+	/* black (unsorted) double arrow */
+	background-image: url(data:image/gif;base64,R0lGODlhFQAJAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAkAAAIXjI+AywnaYnhUMoqt3gZXPmVg94yJVQAAOw==);
+	/* white (unsorted) double arrow */
+	/* background-image: url(data:image/gif;base64,R0lGODlhFQAJAIAAAP///////yH5BAEAAAEALAAAAAAVAAkAAAIXjI+AywnaYnhUMoqt3gZXPmVg94yJVQAAOw==); */
+	/* image */
+	/* background-image: url(images/black-unsorted.gif); */
+	background-repeat: no-repeat;
+	background-position: center right;
+	padding: 4px 18px 4px 4px;
+	white-space: normal;
+	cursor: pointer;
+}
+.tablesorter-blue .headerSortUp,
+.tablesorter-blue .tablesorter-headerSortUp,
+.tablesorter-blue .tablesorter-headerAsc {
+	background-color: #9fbfdf;
+	/* black asc arrow */
+	background-image: url(data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjI8Bya2wnINUMopZAQA7);
+	/* white asc arrow */
+	/* background-image: url(data:image/gif;base64,R0lGODlhFQAEAIAAAP///////yH5BAEAAAEALAAAAAAVAAQAAAINjI8Bya2wnINUMopZAQA7); */
+	/* image */
+	/* background-image: url(images/black-asc.gif); */
+}
+.tablesorter-blue .headerSortDown,
+.tablesorter-blue .tablesorter-headerSortDown,
+.tablesorter-blue .tablesorter-headerDesc {
+	background-color: #8cb3d9;
+	/* black desc arrow */
+	background-image: url(data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjB+gC+jP2ptn0WskLQA7);
+	/* white desc arrow */
+	/* background-image: url(data:image/gif;base64,R0lGODlhFQAEAIAAAP///////yH5BAEAAAEALAAAAAAVAAQAAAINjB+gC+jP2ptn0WskLQA7); */
+	/* image */
+	/* background-image: url(images/black-desc.gif); */
+}
+.tablesorter-blue thead .sorter-false {
+	background-image: none;
+	padding: 4px;
+}
+
+/* tfoot */
+.tablesorter-blue tfoot .tablesorter-headerSortUp,
+.tablesorter-blue tfoot .tablesorter-headerSortDown,
+.tablesorter-blue tfoot .tablesorter-headerAsc,
+.tablesorter-blue tfoot .tablesorter-headerDesc {
+	/* remove sort arrows from footer */
+	background-image: none;
+}
+
+/* tbody */
+.tablesorter-blue td {
+	color: #3d3d3d;
+	background-color: #fff;
+	padding: 4px;
+	vertical-align: top;
+}
+
+/* hovered row colors
+ you'll need to add additional lines for
+ rows with more than 2 child rows
+ */
+.tablesorter-blue tbody > tr:hover > td,
+.tablesorter-blue tbody > tr:hover + tr.tablesorter-childRow > td,
+.tablesorter-blue tbody > tr:hover + tr.tablesorter-childRow + tr.tablesorter-childRow > td,
+.tablesorter-blue tbody > tr.even:hover > td,
+.tablesorter-blue tbody > tr.even:hover + tr.tablesorter-childRow > td,
+.tablesorter-blue tbody > tr.even:hover + tr.tablesorter-childRow + tr.tablesorter-childRow > td {
+	background: #d9d9d9;
+}
+.tablesorter-blue tbody > tr.odd:hover > td,
+.tablesorter-blue tbody > tr.odd:hover + tr.tablesorter-childRow > td,
+.tablesorter-blue tbody > tr.odd:hover + tr.tablesorter-childRow + tr.tablesorter-childRow > td {
+	background: #bfbfbf;
+}
+
+/* table processing indicator */
+.tablesorter-blue .tablesorter-processing {
+	background-position: center center !important;
+	background-repeat: no-repeat !important;
+	/* background-image: url(../addons/pager/icons/loading.gif) !important; */
+	background-image: url('data:image/gif;base64,R0lGODlhFAAUAKEAAO7u7lpaWgAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQBCgACACwAAAAAFAAUAAACQZRvoIDtu1wLQUAlqKTVxqwhXIiBnDg6Y4eyx4lKW5XK7wrLeK3vbq8J2W4T4e1nMhpWrZCTt3xKZ8kgsggdJmUFACH5BAEKAAIALAcAAAALAAcAAAIUVB6ii7jajgCAuUmtovxtXnmdUAAAIfkEAQoAAgAsDQACAAcACwAAAhRUIpmHy/3gUVQAQO9NetuugCFWAAAh+QQBCgACACwNAAcABwALAAACE5QVcZjKbVo6ck2AF95m5/6BSwEAIfkEAQoAAgAsBwANAAsABwAAAhOUH3kr6QaAcSrGWe1VQl+mMUIBACH5BAEKAAIALAIADQALAAcAAAIUlICmh7ncTAgqijkruDiv7n2YUAAAIfkEAQoAAgAsAAAHAAcACwAAAhQUIGmHyedehIoqFXLKfPOAaZdWAAAh+QQFCgACACwAAAIABwALAAACFJQFcJiXb15zLYRl7cla8OtlGGgUADs=') !important;
+}
+
+/* Zebra Widget - row alternating colors */
+.tablesorter-blue tbody tr.odd td {
+	background-color: #ebf2fa;
+}
+.tablesorter-blue tbody tr.even td {
+	background-color: #fff;
+}
+
+/* Column Widget - column sort colors */
+.tablesorter-blue td.primary,
+.tablesorter-blue tr.odd td.primary {
+	background-color: #99b3e6;
+}
+.tablesorter-blue tr.even td.primary {
+	background-color: #c2d1f0;
+}
+.tablesorter-blue td.secondary,
+.tablesorter-blue tr.odd td.secondary {
+	background-color: #c2d1f0;
+}
+.tablesorter-blue tr.even td.secondary {
+	background-color: #d6e0f5;
+}
+.tablesorter-blue td.tertiary,
+.tablesorter-blue tr.odd td.tertiary {
+	background-color: #d6e0f5;
+}
+.tablesorter-blue tr.even td.tertiary {
+	background-color: #ebf0fa;
+}
+
+/* caption */
+caption {
+	background: #fff;
+}
+
+/* filter widget */
+.tablesorter-blue .tablesorter-filter-row td {
+	background: #eee;
+	line-height: normal;
+	text-align: center; /* center the input */
+	-webkit-transition: line-height 0.1s ease;
+	-moz-transition: line-height 0.1s ease;
+	-o-transition: line-height 0.1s ease;
+	transition: line-height 0.1s ease;
+}
+/* optional disabled input styling */
+.tablesorter-blue .tablesorter-filter-row .disabled {
+	opacity: 0.5;
+	filter: alpha(opacity=50);
+	cursor: not-allowed;
+}
+/* hidden filter row */
+.tablesorter-blue .tablesorter-filter-row.hideme td {
+	/*** *********************************************** ***/
+	/*** change this padding to modify the thickness     ***/
+	/*** of the closed filter row (height = padding x 2) ***/
+	padding: 2px;
+	/*** *********************************************** ***/
+	margin: 0;
+	line-height: 0;
+	cursor: pointer;
+}
+.tablesorter-blue .tablesorter-filter-row.hideme .tablesorter-filter {
+	height: 1px;
+	min-height: 0;
+	border: 0;
+	padding: 0;
+	margin: 0;
+	/* don't use visibility: hidden because it disables tabbing */
+	opacity: 0;
+	filter: alpha(opacity=0);
+}
+/* filters */
+.tablesorter-blue .tablesorter-filter {
+	width: 98%;
+	height: auto;
+	margin: 0;
+	padding: 4px;
+	background-color: #fff;
+	border: 1px solid #bbb;
+	color: #333;
+	-webkit-box-sizing: border-box;
+	-moz-box-sizing: border-box;
+	box-sizing: border-box;
+	-webkit-transition: height 0.1s ease;
+	-moz-transition: height 0.1s ease;
+	-o-transition: height 0.1s ease;
+	transition: height 0.1s ease;
+}
+
+/* ajax error row */
+.tablesorter .tablesorter-errorRow td {
+	cursor: pointer;
+	background-color: #e6bf99;
+}