commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nico...@apache.org
Subject svn commit: r637926 - in /commons/sandbox/monitoring/trunk/src: main/java/org/apache/commons/monitoring/reporting/ main/java/org/apache/commons/monitoring/reporting/web/ main/java/org/apache/commons/monitoring/servlet/ main/java/org/apache/commons/moni...
Date Mon, 17 Mar 2008 15:02:15 GMT
Author: nicolas
Date: Mon Mar 17 08:02:10 2008
New Revision: 637926

URL: http://svn.apache.org/viewvc?rev=637926&view=rev
Log:
fix unexpected columns when monitors hold heterogenous statvalues

Added:
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/Context.java   (with props)
Modified:
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/AbstractRenderer.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/HtmlRenderer.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/JsonRenderer.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/OptionsSupport.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/Renderer.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/TxtRenderer.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/XmlRenderer.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/web/MonitoringServlet.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/web/NiceHtmlRenderer.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/servlet/MonitoringListener.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/support/java13/java/util/_Collections.java
    commons/sandbox/monitoring/trunk/src/test/java/org/apache/commons/monitoring/reporting/RendererTest.java
    commons/sandbox/monitoring/trunk/src/test/java/org/apache/commons/monitoring/reporting/SelectorTest.java

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/AbstractRenderer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/AbstractRenderer.java?rev=637926&r1=637925&r2=637926&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/AbstractRenderer.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/AbstractRenderer.java Mon Mar 17 08:02:10 2008
@@ -17,13 +17,15 @@
 
 package org.apache.commons.monitoring.reporting;
 
-import java.io.PrintWriter;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Set;
 
 import org.apache.commons.monitoring.Counter;
 import org.apache.commons.monitoring.Monitor;
@@ -39,54 +41,88 @@
 public abstract class AbstractRenderer
     implements Renderer
 {
-    public final void render( PrintWriter writer, Collection<Monitor> monitors )
+    public final void render( Context ctx, Collection<Monitor> monitors )
     {
-        render( writer, monitors, new OptionsSupport() );
+        render( ctx, monitors, new OptionsSupport() );
     }
 
-    public void render( PrintWriter writer, Collection<Monitor> monitors, Options options )
+    public void render( Context ctx, Collection<Monitor> monitors, Options options )
     {
         int count = 0;
+        prepareRendering( ctx, monitors, options );
         for ( Monitor monitor : monitors )
         {
             if ( options.render( monitor ) )
             {
                 if ( count > 0 )
                 {
-                    hasNext( writer, Monitor.class );
+                    hasNext( ctx, Monitor.class );
                 }
-                render( writer, monitor, options );
+                render( ctx, monitor, options );
                 count++;
             }
         }
     }
 
-    protected void hasNext( PrintWriter writer, Class<?> type )
+    protected void prepareRendering( Context ctx, Collection<Monitor> monitors, Options options )
+    {
+        List<String> roles = getRoles( monitors, options );
+        ctx.put( "roles", roles );
+        ctx.put( "monitors", monitors );
+    }
+
+    protected void hasNext( Context ctx, Class<?> type )
     {
         // Nop
     }
 
-    protected void render( PrintWriter writer, Monitor monitor, Options options )
+    protected void render( Context ctx, Monitor monitor, Options options, List<String> roles )
+    {
+        render( ctx, monitor, options );
+    }
+
+    protected void render( Context ctx, Monitor monitor, Options options )
     {
-        render( writer, monitor.getKey() );
-        renderStatValues( writer, monitor, options );
+        render( ctx, monitor.getKey() );
+        renderStatValues( ctx, monitor, options );
     }
 
-    protected int renderStatValues( PrintWriter writer, Monitor monitor, Options options )
+    protected void renderStatValues( Context ctx, Monitor monitor, Options options, List<String> roles )
     {
+        renderStatValues( ctx, monitor, options );
+    }
 
-        // Sort values by role to ensure predictable result
-        List<StatValue> values = getOrderedStatValues( monitor, options );
-        for ( Iterator<StatValue> iterator = values.iterator(); iterator.hasNext(); )
+    @SuppressWarnings("unchecked")
+    protected void renderStatValues( Context ctx, Monitor monitor, Options options )
+    {
+        List<String> roles = (List<String>) ctx.get( "roles" );
+        for ( Iterator<String> iterator = roles.iterator(); iterator.hasNext(); )
         {
-            StatValue value = (StatValue) iterator.next();
-            render( writer, value, options );
+            String role = iterator.next();
+            StatValue value = monitor.getValue( role );
+            if (value != null)
+            {
+                render( ctx, value, options );
+            }
+            else
+            {
+                renderMissingValue( ctx, role );
+            }
             if ( iterator.hasNext() )
             {
-                hasNext( writer, StatValue.class );
+                hasNext( ctx, StatValue.class );
             }
         }
-        return values.size();
+    }
+
+    /**
+     * Render an expected value not supported by the current monitor
+     * @param ctx
+     * @param role
+     */
+    protected void renderMissingValue( Context ctx, String role )
+    {
+        // Nop
     }
 
     protected List<StatValue> getOrderedStatValues( Monitor monitor, Options options )
@@ -95,7 +131,7 @@
         for ( Iterator<StatValue> iterator = values.iterator(); iterator.hasNext(); )
         {
             StatValue value = (StatValue) iterator.next();
-            if ( !options.render( value ) )
+            if ( !options.renderRole( value.getRole() ) )
             {
                 iterator.remove();
             }
@@ -110,73 +146,73 @@
         return values;
     }
 
-    protected void render( PrintWriter writer, StatValue value, Options options )
+    protected void render( Context ctx, StatValue value, Options options )
     {
         if ( value instanceof Counter )
         {
             Counter counter = (Counter) value;
             if ( options.render( value, "hits" ) )
             {
-                render( writer, value, "hits", counter.getHits(), options, 0 );
+                render( ctx, value, "hits", counter.getHits(), options, 0 );
             }
             if ( options.render( value, "sum" ) )
             {
-                render( writer, value, "sum", counter.getSum(), options );
+                render( ctx, value, "sum", counter.getSum(), options );
             }
         }
         if ( options.render( value, "min" ) )
         {
-            render( writer, value, "min", value.getMin(), options );
+            render( ctx, value, "min", value.getMin(), options );
         }
         if ( options.render( value, "max" ) )
         {
-            render( writer, value, "max", value.getMax(), options );
+            render( ctx, value, "max", value.getMax(), options );
         }
         if ( options.render( value, "mean" ) )
         {
-            render( writer, value, "mean", value.getMean(), options );
+            render( ctx, value, "mean", value.getMean(), options );
         }
         if ( options.render( value, "deviation" ) )
         {
-            render( writer, value, "deviation", value.getStandardDeviation(), options, 1 );
+            render( ctx, value, "deviation", value.getStandardDeviation(), options, 1 );
         }
         if ( options.render( value, "value" ) )
         {
-            render( writer, value, "value", value.get(), options, 1 );
+            render( ctx, value, "value", value.get(), options, 1 );
         }
     }
 
-    protected abstract void render( PrintWriter writer, Key key );
+    protected abstract void render( Context ctx, Key key );
 
-    protected void render( PrintWriter writer, StatValue value, String attribute, Number number, Options options )
+    protected void render( Context ctx, StatValue value, String attribute, Number number, Options options )
     {
-        render( writer, value, attribute, number, options, 1 );
+        render( ctx, value, attribute, number, options, 1 );
     }
 
     /**
      * Render a StatValue attribute
      *
-     * @param writer output
+     * @param ctx output
      * @param value the StatValue that hold data to be rendered
      * @param attribute the StatValue attribute name to be rendered
      * @param number the the StatValue attribute value to be rendered
      * @param ratio the ratio between attribute unit and statValue unit (in power of 10)
      * @param options the rendering options
      */
-    protected void render( PrintWriter writer, StatValue value, String attribute, Number number, Options options,
+    protected void render( Context ctx, StatValue value, String attribute, Number number, Options options,
                            int ratio )
     {
         if ( number instanceof Double )
         {
-            renderInternal( writer, value, attribute, number.doubleValue(), options, ratio );
+            renderInternal( ctx, value, attribute, number.doubleValue(), options, ratio );
         }
         else
         {
-            renderInternal( writer, value, attribute, number.longValue(), options, ratio );
+            renderInternal( ctx, value, attribute, number.longValue(), options, ratio );
         }
     }
 
-    private void renderInternal( PrintWriter writer, StatValue value, String attribute, long l, Options options,
+    private void renderInternal( Context ctx, StatValue value, String attribute, long l, Options options,
                                  int ratio )
     {
         Unit unit = options.unitFor( value );
@@ -188,15 +224,15 @@
             }
         }
 
-        writer.append( options.getNumberFormat().format( l ) );
+        ctx.print( options.getNumberFormat().format( l ) );
     }
 
-    private void renderInternal( PrintWriter writer, StatValue value, String attribute, double d, Options options,
+    private void renderInternal( Context ctx, StatValue value, String attribute, double d, Options options,
                                  int ratio )
     {
         if ( Double.isNaN( d ) )
         {
-            writer.append( "-" );
+            ctx.print( "-" );
             return;
         }
         Unit unit = options.unitFor( value );
@@ -208,6 +244,31 @@
             }
         }
 
-        writer.append( options.getDecimalFormat().format( d ) );
+        ctx.print( options.getDecimalFormat().format( d ) );
+    }
+
+    /**
+     * @param monitors
+     * @return
+     */
+    protected List<String> getRoles( Collection<Monitor> monitors, Options options )
+    {
+        Set<String> roles = new HashSet<String>();
+        for ( Monitor monitor : monitors )
+        {
+            if (options.render( monitor ))
+            {
+                for ( String role : monitor.getRoles() )
+                {
+                    if (options.renderRole( role ))
+                    {
+                        roles.add( role );
+                    }
+                }
+            }
+        }
+        List<String> sorted = new ArrayList<String>( roles );
+        Collections.sort( sorted );
+        return sorted;
     }
 }

Added: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/Context.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/Context.java?rev=637926&view=auto
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/Context.java (added)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/Context.java Mon Mar 17 08:02:10 2008
@@ -0,0 +1,51 @@
+/*
+ * 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;
+
+import java.io.PrintWriter;
+import java.util.HashMap;
+
+/**
+ * A context for rendering process. Allow appending data to output using
+ * <code>print</code> methods and to store/retrieve contextual data.
+ *
+ * @author <a href="mailto:nicolas@apache.org">Nicolas De Loof</a>
+ */
+@SuppressWarnings( "serial" )
+public class Context
+    extends HashMap<String, Object>
+{
+    private PrintWriter writer;
+
+    public Context( PrintWriter writer )
+    {
+        super();
+        this.writer = writer;
+    }
+
+    public void print( String s )
+    {
+        writer.print( s );
+    }
+
+    public void println( String s )
+    {
+        writer.println( s );
+    }
+
+}

Propchange: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/Context.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/Context.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/Context.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/HtmlRenderer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/HtmlRenderer.java?rev=637926&r1=637925&r2=637926&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/HtmlRenderer.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/HtmlRenderer.java Mon Mar 17 08:02:10 2008
@@ -17,10 +17,9 @@
 
 package org.apache.commons.monitoring.reporting;
 
-import java.io.PrintWriter;
 import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
+import java.util.HashMap;
+import java.util.Map;
 
 import org.apache.commons.monitoring.Counter;
 import org.apache.commons.monitoring.Monitor;
@@ -38,170 +37,206 @@
     /**
      * {@inheritDoc}
      *
-     * @see org.apache.commons.monitoring.reporting.AbstractRenderer#render(java.io.PrintWriter,
+     * @see org.apache.commons.monitoring.reporting.AbstractRenderer#render(java.io.Context,
      * java.util.Collection,
      * org.apache.commons.monitoring.reporting.Renderer.Options)
      */
     @Override
-    public void render( PrintWriter writer, Collection<Monitor> monitors, Options options )
+    public void render( Context ctx, Collection<Monitor> monitors, Options options )
     {
-        documentHead( writer );
-        tableStartTag( writer );
-        tableHead( writer, monitors, options );
-        tabelBody( writer, monitors, options );
-        tableEndTag( writer );
-        documentFoot( writer );
+        prepareRendering( ctx, monitors, options );
+        documentHead( ctx );
+        tableStartTag( ctx );
+        tableHead( ctx, monitors, options );
+        tabelBody( ctx, monitors, options );
+        tableEndTag( ctx );
+        documentFoot( ctx );
     }
 
-    protected void tabelBody( PrintWriter writer, Collection<Monitor> monitors, Options options )
+    protected void tabelBody( Context ctx, Collection<Monitor> monitors, Options options )
     {
-        writer.println( "<tbody><tr>" );
-        super.render( writer, monitors, options );
-        writer.println( "</tr></tbody>" );
+        ctx.println( "<tbody><tr>" );
+        super.render( ctx, monitors, options );
+        ctx.println( "</tr></tbody>" );
     }
 
     /**
-     * @param writer
+     * @param ctx
      */
-    protected void tableStartTag( PrintWriter writer )
+    protected void tableStartTag( Context ctx )
     {
-        writer.print( "<table border='1'>" );
+        ctx.print( "<table border='1'>" );
     }
 
     /**
-     * @param writer
+     * @param ctx
      */
-    protected void tableEndTag( PrintWriter writer )
+    protected void tableEndTag( Context ctx )
     {
-        writer.println( "</table>" );
+        ctx.println( "</table>" );
     }
 
     /**
-     * @param writer
+     * @param ctx
      */
-    protected void documentHead( PrintWriter writer )
+    protected void documentHead( Context ctx )
     {
-        writer.println( "<html><body>" );
+        ctx.println( "<html><body>" );
     }
 
-    protected void tableHead( PrintWriter writer, Collection<Monitor> monitors, Options options )
+    @SuppressWarnings( "unchecked" )
+    protected void tableHead( Context ctx, Collection<Monitor> monitors, Options options )
     {
-        Iterator<Monitor> it = monitors.iterator();
-        if ( it.hasNext() )
+        Collection<String> roles = (Collection<String>) ctx.get( "roles" );
+        Map<String, Integer> columns = new HashMap<String, Integer>();
+
+        ctx.println( "<thead><tr><th rowspan='2'>name</th>" );
+        ctx.println( "<th rowspan='2'>category</th>" );
+        ctx.println( "<th rowspan='2'>subsystem</th>" );
+        for ( String role : roles )
         {
-            Monitor monitor = it.next();
-            writer
-                .println( "<thead><tr><th rowspan='2'>name</th><th rowspan='2'>category</th><th rowspan='2'>subsystem</th>" );
-            List<StatValue> values = getOrderedStatValues( monitor, options );
-            for ( StatValue value : values )
+            // Search the first monitor that has a StatValue for the role...
+            for ( Monitor monitor : monitors )
             {
-                int span = 0;
-                if ( value instanceof Counter )
-                {
-                    span += options.render( value, "hits" ) ? 1 : 0;
-                    span += options.render( value, "sum" ) ? 1 : 0;
-                }
-                span += options.render( value, "min" ) ? 1 : 0;
-                span += options.render( value, "max" ) ? 1 : 0;
-                span += options.render( value, "mean" ) ? 1 : 0;
-                span += options.render( value, "deviation" ) ? 1 : 0;
-                span += options.render( value, "value" ) ? 1 : 0;
-
-                writer.print( "<td colspan='" );
-                writer.print( String.valueOf( span ) );
-                writer.print( "'>" );
-                writer.print( value.getRole() );
-                Unit unit = options.unitFor( value );
-                if ( unit != null && unit.getName().length() > 0 )
+                StatValue value = monitor.getValue( role );
+                if ( value != null )
                 {
-                    renderUnit( writer, unit );
+                    int span = 0;
+                    if ( value instanceof Counter )
+                    {
+                        span += options.render( value, "hits" ) ? 1 : 0;
+                        span += options.render( value, "sum" ) ? 1 : 0;
+                    }
+                    span += options.render( value, "min" ) ? 1 : 0;
+                    span += options.render( value, "max" ) ? 1 : 0;
+                    span += options.render( value, "mean" ) ? 1 : 0;
+                    span += options.render( value, "deviation" ) ? 1 : 0;
+                    span += options.render( value, "value" ) ? 1 : 0;
+
+                    ctx.print( "<td colspan='" );
+                    ctx.print( String.valueOf( span ) );
+                    ctx.print( "'>" );
+                    ctx.print( value.getRole() );
+                    Unit unit = options.unitFor( value );
+                    if ( unit != null && unit.getName().length() > 0 )
+                    {
+                        renderUnit( ctx, unit );
+                    }
+                    ctx.print( "</td>" );
+                    columns.put( role, span );
+                    break;
                 }
-                writer.print( "</td>" );
             }
-            writer.print( "</tr>" );
-            writer.print( "<tr>" );
-            for ( StatValue value : values )
+        }
+        ctx.print( "</tr>" );
+        ctx.print( "<tr>" );
+
+        for ( String role : roles )
+        {
+            for ( Monitor monitor : monitors )
             {
-                if ( value instanceof Counter )
+                StatValue value = monitor.getValue( role );
+                if ( value != null )
                 {
-                    writeColumnHead( writer, options, value, "hits" );
-                    writeColumnHead( writer, options, value, "sum" );
+                    if ( value instanceof Counter )
+                    {
+                        writeColumnHead( ctx, options, value, "hits" );
+                        writeColumnHead( ctx, options, value, "sum" );
+                    }
+                    writeColumnHead( ctx, options, value, "min" );
+                    writeColumnHead( ctx, options, value, "max" );
+                    writeColumnHead( ctx, options, value, "mean" );
+                    writeColumnHead( ctx, options, value, "deviation" );
+                    writeColumnHead( ctx, options, value, "value" );
+                    break;
                 }
-                writeColumnHead( writer, options, value, "min" );
-                writeColumnHead( writer, options, value, "max" );
-                writeColumnHead( writer, options, value, "mean" );
-                writeColumnHead( writer, options, value, "deviation" );
-                writeColumnHead( writer, options, value, "value" );
             }
-            writer.println( "</tr></thead>" );
         }
+        ctx.println( "</tr></thead>" );
+        ctx.put( "columns", columns );
     }
 
-    protected void writeColumnHead( PrintWriter writer, Options options, StatValue value, String attribute )
+    protected void writeColumnHead( Context ctx, Options options, StatValue value, String attribute )
     {
         if ( options.render( value, attribute ) )
         {
-            writer.print( "<th>" );
-            writer.print( attribute );
-            writer.print( "</th>" );
+            ctx.print( "<th>" );
+            ctx.print( attribute );
+            ctx.print( "</th>" );
         }
     }
 
-    protected void renderUnit( PrintWriter writer, Unit unit )
+    protected void renderUnit( Context ctx, Unit unit )
     {
-        writer.print( " (" );
-        writer.print( unit.getName() );
-        writer.print( ")" );
+        ctx.print( " (" );
+        ctx.print( unit.getName() );
+        ctx.print( ")" );
     }
 
     @Override
-    protected void render( PrintWriter writer, StatValue value, String attribute, Number number, Options options, int ratio )
+    protected void render( Context ctx, StatValue value, String attribute, Number number, Options options, int ratio )
     {
-        writer.print( "<td>" );
-        super.render( writer, value, attribute, number, options, ratio );
-        writer.print( "</td>" );
+        ctx.print( "<td>" );
+        super.render( ctx, value, attribute, number, options, ratio );
+        ctx.print( "</td>" );
     }
 
     @Override
-    protected void render( PrintWriter writer, Key key )
+    protected void render( Context ctx, Key key )
     {
-        writer.print( "<td>" );
-        writer.print( key.getName() );
-        writer.print( "</td><td>" );
+        ctx.print( "<td>" );
+        ctx.print( key.getName() );
+        ctx.print( "</td><td>" );
         if ( key.getCategory() != null )
         {
-            writer.print( key.getCategory() );
+            ctx.print( key.getCategory() );
         }
-        writer.print( "</td><td>" );
+        ctx.print( "</td><td>" );
         if ( key.getSubsystem() != null )
         {
-            writer.print( key.getSubsystem() );
+            ctx.print( key.getSubsystem() );
         }
-        writer.print( "</td>" );
+        ctx.print( "</td>" );
+    }
+
+    /**
+     * {@inheritDoc}
+     *
+     * @see org.apache.commons.monitoring.reporting.AbstractRenderer#renderMissingValue(org.apache.commons.monitoring.reporting.Context,
+     * java.lang.String)
+     */
+    @SuppressWarnings("unchecked")
+    @Override
+    protected void renderMissingValue( Context ctx, String role )
+    {
+        Map<String, Integer> columns = (Map<String, Integer>) ctx.get( "columns" );
+        ctx.print( "<td colspan='" );
+        ctx.print( String.valueOf( columns.get( role ) ) );
+        ctx.print( "'>-</td>" );
     }
 
     /**
      * {@inheritDoc}
      *
-     * @see org.apache.commons.monitoring.reporting.AbstractRenderer#hasNext(java.io.PrintWriter,
+     * @see org.apache.commons.monitoring.reporting.AbstractRenderer#hasNext(java.io.Context,
      * java.lang.Class)
      */
     @Override
-    protected void hasNext( PrintWriter writer, Class<?> type )
+    protected void hasNext( Context ctx, Class<?> type )
     {
         if ( type == Monitor.class )
         {
-            writer.println( "</tr>" );
-            writer.println( "<tr>" );
+            ctx.println( "</tr>" );
+            ctx.println( "<tr>" );
         }
     }
 
     /**
-     * @param writer
+     * @param ctx
      */
-    protected void documentFoot( PrintWriter writer )
+    protected void documentFoot( Context ctx )
     {
-        writer.print( "</body></html>" );
+        ctx.print( "</body></html>" );
     }
 
 }

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/JsonRenderer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/JsonRenderer.java?rev=637926&r1=637925&r2=637926&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/JsonRenderer.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/JsonRenderer.java Mon Mar 17 08:02:10 2008
@@ -17,8 +17,8 @@
 
 package org.apache.commons.monitoring.reporting;
 
-import java.io.PrintWriter;
 import java.util.Collection;
+import java.util.List;
 
 import org.apache.commons.monitoring.Monitor;
 import org.apache.commons.monitoring.StatValue;
@@ -28,80 +28,86 @@
     extends AbstractRenderer
 {
     @Override
-    public void render( PrintWriter writer, Collection<Monitor> monitors, Options options )
+    public void render( Context ctx, Collection<Monitor> monitors, Options options )
     {
-        writer.print( "[" );
-        super.render( writer, monitors, options );
-        writer.print( "]" );
+        ctx.print( "[" );
+        super.render( ctx, monitors, options );
+        ctx.print( "]" );
     }
 
     @Override
     @SuppressWarnings("unchecked")
-    protected void hasNext( PrintWriter writer, Class type )
+    protected void hasNext( Context ctx, Class type )
     {
-        writer.print( ',' );
+        ctx.print( "," );
     }
 
     @Override
-    public void render( PrintWriter writer, Monitor monitor, Options options )
+    public void render( Context ctx, Monitor monitor, Options options, List<String> roles )
     {
-        writer.print( "{" );
-        if ( renderStatValues( writer, monitor, options ) > 0 )
+        render( ctx, monitor, options );
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public void render( Context ctx, Monitor monitor, Options options )
+    {
+        ctx.print( "{" );
+        renderStatValues( ctx, monitor, options );
+        Collection<String> roles = (Collection<String>) ctx.get( "roles" );
+        if ( roles.size() > 0 )
         {
-            writer.print( "," );
+            ctx.print( "," );
         }
-        render( writer, monitor.getKey() );
-        writer.print( "}" );
+        render( ctx, monitor.getKey() );
+        ctx.print( "}" );
     }
 
     @Override
-    public void render( PrintWriter writer, Key key )
+    public void render( Context ctx, Key key )
     {
-        writer.print( "key:{name:\"" );
-        writer.print( key.getName() );
+        ctx.print( "key:{name:\"" );
+        ctx.print( key.getName() );
         if ( key.getCategory() != null )
         {
-            writer.print( "\",category:\"" );
-            writer.print( key.getCategory() );
+            ctx.print( "\",category:\"" );
+            ctx.print( key.getCategory() );
         }
         if ( key.getSubsystem() != null )
         {
-            writer.print( "\",subsystem:\"" );
-            writer.print( key.getSubsystem() );
+            ctx.print( "\",subsystem:\"" );
+            ctx.print( key.getSubsystem() );
         }
-        writer.print( "\"}" );
+        ctx.print( "\"}" );
     }
 
     @Override
-    public void render( PrintWriter writer, StatValue value, Options options )
+    public void render( Context ctx, StatValue value, Options options )
     {
-        writer.print( value.getRole() );
-        writer.print( ":{" );
-        super.render( writer, value, options );
-        writer.print( "}" );
+        ctx.print( value.getRole() );
+        ctx.print( ":{" );
+        super.render( ctx, value, options );
+        ctx.print( "}" );
     }
 
-    /** Current rendering state */
-    private StatValue currentValue;
-    private boolean firstAttribute;
-
     @Override
-    protected void render( PrintWriter writer, StatValue value, String attribute, Number number, Options options, int ratio )
+    protected void render( Context ctx, StatValue value, String attribute, Number number, Options options, int ratio )
     {
+        StatValue currentValue = (StatValue) ctx.get( "currentValue" );
         if (currentValue != value)
         {
-            currentValue = value;
-            firstAttribute = true;
+            ctx.put( "currentValue", value );
+            ctx.put( "firstAttribute", Boolean.TRUE );
         }
-
-        if (!firstAttribute)
+        Boolean firstAttribute = (Boolean) ctx.get( "firstAttribute" );
+        if (!firstAttribute.booleanValue())
         {
-            writer.print( ',' );
+            ctx.print( "," );
         }
-        writer.print( attribute );
-        writer.print( ":\"" );
-        super.render( writer, value, attribute, number, options, ratio );
-        writer.print( '\"' );
-        firstAttribute = false;
+        ctx.print( attribute );
+        ctx.print( ":\"" );
+        super.render( ctx, value, attribute, number, options, ratio );
+        ctx.print( "\"" );
+        ctx.put( "firstAttribute", Boolean.FALSE );
     }
 }

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/OptionsSupport.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/OptionsSupport.java?rev=637926&r1=637925&r2=637926&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/OptionsSupport.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/OptionsSupport.java Mon Mar 17 08:02:10 2008
@@ -21,6 +21,7 @@
 import java.text.DecimalFormatSymbols;
 import java.text.NumberFormat;
 
+import org.apache.commons.monitoring.Monitor;
 import org.apache.commons.monitoring.StatValue;
 import org.apache.commons.monitoring.Unit;
 
@@ -32,12 +33,17 @@
 public class OptionsSupport
     implements Renderer.Options
 {
-    public boolean render( Object object )
+    public boolean render( Monitor monitor )
     {
         return true;
     }
 
     public boolean render( StatValue value, String attribute )
+    {
+        return true;
+    }
+
+    public boolean renderRole( String role )
     {
         return true;
     }

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/Renderer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/Renderer.java?rev=637926&r1=637925&r2=637926&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/Renderer.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/Renderer.java Mon Mar 17 08:02:10 2008
@@ -17,7 +17,6 @@
 
 package org.apache.commons.monitoring.reporting;
 
-import java.io.PrintWriter;
 import java.text.NumberFormat;
 import java.util.Arrays;
 import java.util.Collection;
@@ -35,15 +34,17 @@
 {
     Collection<String> DEFAULT_ROLES = Arrays.asList( new String[] { Monitor.CONCURRENCY, Monitor.PERFORMANCES } );
 
-    void render( PrintWriter writer, Collection<Monitor> monitors );
+    void render( Context ctx, Collection<Monitor> monitors );
 
-    void render( PrintWriter writer, Collection<Monitor> monitors, Options options );
+    void render( Context ctx, Collection<Monitor> monitors, Options options );
 
     interface Options
     {
-        boolean render( Object object );
+        boolean render( Monitor object );
 
         boolean render( StatValue value, String attribute );
+
+        boolean renderRole( String role );
 
         Unit unitFor( StatValue value );
 

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/TxtRenderer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/TxtRenderer.java?rev=637926&r1=637925&r2=637926&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/TxtRenderer.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/TxtRenderer.java Mon Mar 17 08:02:10 2008
@@ -17,8 +17,6 @@
 
 package org.apache.commons.monitoring.reporting;
 
-import java.io.PrintWriter;
-
 import org.apache.commons.monitoring.StatValue;
 import org.apache.commons.monitoring.Monitor.Key;
 
@@ -34,24 +32,24 @@
 
     /**
      * {@inheritDoc}
-     * @see org.apache.commons.monitoring.reporting.AbstractRenderer#render(org.apache.commons.monitoring.StatValue, java.lang.String)
+     * @see org.apache.commons.monitoring.reporting.AbstractRenderer#render(Context, java.lang.String)
      */
     @Override
-    public void render( PrintWriter writer, StatValue value, Options options )
+    public void render( Context ctx, StatValue value, Options options )
     {
-        writer.println( value.getRole() );
-        super.render( writer, value, options );
-        writer.println();
+        ctx.println( value.getRole() );
+        super.render( ctx, value, options );
+        ctx.println( "" );
     }
 
     @Override
-    protected void render( PrintWriter writer, StatValue value, String attribute, Number number, Options options, int ratio )
+    protected void render( Context ctx, StatValue value, String attribute, Number number, Options options, int ratio )
     {
-        writer.print( "    " );
-        writer.print( attribute );
-        writer.print( " : " );
-        super.render( writer, value, attribute, number, options, ratio );
-        writer.println();
+        ctx.print( "    " );
+        ctx.print( attribute );
+        ctx.print( " : " );
+        super.render( ctx, value, attribute, number, options, ratio );
+        ctx.println( "" );
     }
 
     /**
@@ -59,11 +57,11 @@
      * @see org.apache.commons.monitoring.reporting.AbstractRenderer#render(org.apache.commons.monitoring.Monitor.Key)
      */
     @Override
-    public void render( PrintWriter writer, Key key )
+    public void render( Context ctx, Key key )
     {
-        writer.println( HR );
-        writer.println( key.toString() );
-        writer.println( HR );
+        ctx.println( HR );
+        ctx.println( key.toString() );
+        ctx.println( HR );
     }
 
 }

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/XmlRenderer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/XmlRenderer.java?rev=637926&r1=637925&r2=637926&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/XmlRenderer.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/XmlRenderer.java Mon Mar 17 08:02:10 2008
@@ -17,8 +17,8 @@
 
 package org.apache.commons.monitoring.reporting;
 
-import java.io.PrintWriter;
 import java.util.Collection;
+import java.util.List;
 
 import org.apache.commons.monitoring.Monitor;
 import org.apache.commons.monitoring.StatValue;
@@ -30,60 +30,66 @@
 
     /**
      * {@inheritDoc}
-     * @see org.apache.commons.monitoring.reporting.AbstractRenderer#render(java.io.PrintWriter, java.util.Collection, org.apache.commons.monitoring.reporting.Renderer.Options)
+     * @see org.apache.commons.monitoring.reporting.AbstractRenderer#render(java.io.Context, java.util.Collection, org.apache.commons.monitoring.reporting.Renderer.Options)
      */
     @Override
-    public void render( PrintWriter writer, Collection<Monitor> monitors, Options options )
+    public void render( Context ctx, Collection<Monitor> monitors, Options options )
     {
-        writer.print( "<monitors>" );
-        super.render( writer, monitors, options );
-        writer.print( "</monitors>" );
+        ctx.print( "<monitors>" );
+        super.render( ctx, monitors, options );
+        ctx.print( "</monitors>" );
     }
 
     @Override
-    public void render( PrintWriter writer, Monitor monitor, Options options )
+    public void render( Context ctx, Monitor monitor, Options options, List<String> roles )
     {
-        writer.print( "<monitor " );
-        super.render( writer, monitor, options );
-        writer.print( "</monitor>" );
+        render( ctx, monitor, options );
     }
 
     @Override
-    public void render( PrintWriter writer, Key key )
+    public void render( Context ctx, Monitor monitor, Options options )
     {
-        writer.print( "name=\"" );
-        writer.print( key.getName() );
+        ctx.print( "<monitor " );
+        super.render( ctx, monitor, options );
+        ctx.print( "</monitor>" );
+    }
+
+    @Override
+    public void render( Context ctx, Key key )
+    {
+        ctx.print( "name=\"" );
+        ctx.print( key.getName() );
         if ( key.getCategory() != null )
         {
-            writer.print( "\" category=\"" );
-            writer.print( key.getCategory() );
+            ctx.print( "\" category=\"" );
+            ctx.print( key.getCategory() );
         }
         if ( key.getSubsystem() != null )
         {
-            writer.print( "\" subsystem=\"" );
-            writer.print( key.getSubsystem() );
+            ctx.print( "\" subsystem=\"" );
+            ctx.print( key.getSubsystem() );
         }
-        writer.print( "\">" );
+        ctx.print( "\">" );
     }
 
 
     @Override
-    public void render( PrintWriter writer, StatValue value, Options options )
+    public void render( Context ctx, StatValue value, Options options )
     {
-        writer.print( "<" );
-        writer.print( value.getRole() );
-        super.render( writer, value, options );
-        writer.print( "/>" );
+        ctx.print( "<" );
+        ctx.print( value.getRole() );
+        super.render( ctx, value, options );
+        ctx.print( "/>" );
     }
 
     @Override
-    protected void render( PrintWriter writer, StatValue value, String attribute, Number number, Options options, int ratio )
+    protected void render( Context ctx, StatValue value, String attribute, Number number, Options options, int ratio )
     {
-        writer.print( ' ' );
-        writer.print( attribute );
-        writer.print( "=\"" );
-        super.render( writer, value, attribute, number, options, ratio );
-        writer.print( '\"' );
+        ctx.print( " " );
+        ctx.print( attribute );
+        ctx.print( "=\"" );
+        super.render( ctx, value, attribute, number, options, ratio );
+        ctx.print( "\"" );
     }
 
 }

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/web/MonitoringServlet.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/web/MonitoringServlet.java?rev=637926&r1=637925&r2=637926&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/web/MonitoringServlet.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/web/MonitoringServlet.java Mon Mar 17 08:02:10 2008
@@ -37,6 +37,7 @@
 import org.apache.commons.monitoring.StatValue;
 import org.apache.commons.monitoring.Unit;
 import org.apache.commons.monitoring.Monitor.Key;
+import org.apache.commons.monitoring.reporting.Context;
 import org.apache.commons.monitoring.reporting.HtmlRenderer;
 import org.apache.commons.monitoring.reporting.JsonRenderer;
 import org.apache.commons.monitoring.reporting.OptionsSupport;
@@ -107,7 +108,7 @@
             String path = request.getPathInfo();
             Collection<Monitor> monitors = (Collection<Monitor>) new Selector( path ).select( repository );
             Renderer.Options options = getOptions( request );
-            renderer.render( response.getWriter(), monitors, options );
+            renderer.render( new Context( response.getWriter() ), monitors, options );
             return;
         }
     }
@@ -192,19 +193,11 @@
             subsystems = values != null ? Arrays.asList( values ) : Collections.<String> emptyList();
         }
 
-        public boolean render( Object object )
+        public boolean render( Monitor monitor )
         {
-            if ( object instanceof StatValue )
-            {
-                return roles.isEmpty() || roles.contains( ( (StatValue) object ).getRole() );
-            }
-            if ( object instanceof Monitor )
-            {
-                Key key = ( (Monitor) object ).getKey();
-                return ( categories.isEmpty() || categories.contains( key.getCategory() ) )
-                    && ( subsystems.isEmpty() || subsystems.contains( key.getSubsystem() ) );
-            }
-            return true;
+            Key key = monitor.getKey();
+            return ( categories.isEmpty() || categories.contains( key.getCategory() ) )
+                && ( subsystems.isEmpty() || subsystems.contains( key.getSubsystem() ) );
         }
 
         public boolean render( StatValue value, String attribute )

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/web/NiceHtmlRenderer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/web/NiceHtmlRenderer.java?rev=637926&r1=637925&r2=637926&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/web/NiceHtmlRenderer.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/web/NiceHtmlRenderer.java Mon Mar 17 08:02:10 2008
@@ -17,9 +17,8 @@
 
 package org.apache.commons.monitoring.reporting.web;
 
-import java.io.PrintWriter;
-
 import org.apache.commons.monitoring.Unit;
+import org.apache.commons.monitoring.reporting.Context;
 import org.apache.commons.monitoring.reporting.HtmlRenderer;
 
 /**
@@ -53,10 +52,10 @@
     /**
      * {@inheritDoc}
      *
-     * @see org.apache.commons.monitoring.reporting.HtmlRenderer#documentHead(java.io.PrintWriter)
+     * @see org.apache.commons.monitoring.reporting.HtmlRenderer#documentHead(java.io.Context)
      */
     @Override
-    protected void documentHead( PrintWriter writer )
+    protected void documentHead( Context writer )
     {
         writer.println( "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" " );
         writer.println( "  \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">" );
@@ -92,7 +91,7 @@
     }
 
     @Override
-    protected void renderUnit( PrintWriter writer, Unit unit )
+    protected void renderUnit( Context writer, Unit unit )
     {
         writer.print( " <span class='unit'>(" );
         writer.print( unit.getName() );
@@ -102,10 +101,10 @@
     /**
      * {@inheritDoc}
      *
-     * @see org.apache.commons.monitoring.reporting.HtmlRenderer#tableStartTag(java.io.PrintWriter)
+     * @see org.apache.commons.monitoring.reporting.HtmlRenderer#tableStartTag(java.io.Context)
      */
     @Override
-    protected void tableStartTag( PrintWriter writer )
+    protected void tableStartTag( Context writer )
     {
         writer.println( "<table border='1' id='monitoring' cellspacing='1'>" );
     }

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/servlet/MonitoringListener.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/servlet/MonitoringListener.java?rev=637926&r1=637925&r2=637926&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/servlet/MonitoringListener.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/servlet/MonitoringListener.java Mon Mar 17 08:02:10 2008
@@ -46,6 +46,7 @@
         {
             try
             {
+                @SuppressWarnings("unchecked")
                 Class repositoryClass = Class.forName( name );
                 if ( !Repository.class.isAssignableFrom( repositoryClass ) )
                 {

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/support/java13/java/util/_Collections.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/support/java13/java/util/_Collections.java?rev=637926&r1=637925&r2=637926&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/support/java13/java/util/_Collections.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/support/java13/java/util/_Collections.java Mon Mar 17 08:02:10 2008
@@ -26,6 +26,7 @@
  */
 public class _Collections
 {
+    @SuppressWarnings("unchecked")
     public static List emptyList()
     {
         return Collections.EMPTY_LIST;

Modified: commons/sandbox/monitoring/trunk/src/test/java/org/apache/commons/monitoring/reporting/RendererTest.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/test/java/org/apache/commons/monitoring/reporting/RendererTest.java?rev=637926&r1=637925&r2=637926&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/test/java/org/apache/commons/monitoring/reporting/RendererTest.java (original)
+++ commons/sandbox/monitoring/trunk/src/test/java/org/apache/commons/monitoring/reporting/RendererTest.java Mon Mar 17 08:02:10 2008
@@ -95,7 +95,8 @@
         counter.add( 1, Unit.MILLIS );
         counter.add( 1, Unit.MICROS );
         StringWriter writer = new StringWriter();
-        renderer.render( new PrintWriter( writer ), counter, "mean", counter.getMean(), options );
+        Context ctx = new Context( new PrintWriter( writer ) );
+        renderer.render( ctx, counter, "mean", counter.getMean(), options );
         assertEquals( " mean=\"500.50\"", writer.toString() );
     }
 
@@ -103,7 +104,8 @@
         throws Exception
     {
         StringWriter out = new StringWriter();
-        renderer.render( new PrintWriter( out ), monitors );
+        Context ctx = new Context( new PrintWriter( out ) );
+        renderer.render( ctx, monitors );
         String actual = out.toString();
         actual = StringUtils.remove( StringUtils.remove( actual, "\n" ), "\r" );
 

Modified: commons/sandbox/monitoring/trunk/src/test/java/org/apache/commons/monitoring/reporting/SelectorTest.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/test/java/org/apache/commons/monitoring/reporting/SelectorTest.java?rev=637926&r1=637925&r2=637926&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/test/java/org/apache/commons/monitoring/reporting/SelectorTest.java (original)
+++ commons/sandbox/monitoring/trunk/src/test/java/org/apache/commons/monitoring/reporting/SelectorTest.java Mon Mar 17 08:02:10 2008
@@ -47,6 +47,7 @@
         assertEquals( 1234L, counter.get() );
     }
 
+    @SuppressWarnings("unchecked")
     public void testCollectionPath()
         throws Exception
     {
@@ -74,6 +75,7 @@
         assertEquals( "1234", value.toString() );
     }
 
+    @SuppressWarnings("unchecked")
     public void testMultiplePath()
     {
         Repository repository = new DefaultRepository();



Mime
View raw message