View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.management.stats.printers;
8   
9   import java.io.OutputStream;
10  import java.io.Writer;
11  import java.util.Collection;
12  
13  /**
14   * <code>SimplePrinter</code> Default stats printer
15   */
16  public class SimplePrinter extends AbstractTablePrinter
17  {
18      public SimplePrinter(Writer out)
19      {
20          super(out);
21      }
22  
23      public SimplePrinter(OutputStream out)
24      {
25          super(out);
26      }
27  
28      public void print(Collection stats)
29      {
30          String[][] table = getTable(stats);
31          for (int i = 1; i < table.length; i++)
32          {
33              println();
34              println("---- Service Statistics ----");
35              for (int j = 0; j < table[0].length; j++)
36              {
37                  println(table[0][j] + ": " + table[i][j]);
38              }
39              println("---- End Service Statistics ----");
40          }
41      }
42  }