View Javadoc

1   /*
2    * $Id: SedaServiceStatistics.java 10529 2008-01-25 05:58:36Z dfeist $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  package org.mule.management.stats;
11  
12  /**
13   * TODO MULE-2233 Pooling functionality has been abstracted out of the SedaService. 
14   * This class should be updated accordingly.
15   */
16  public class SedaServiceStatistics extends ServiceStatistics
17  {
18      private int componentPoolMaxSize = 0;
19      private int componentPoolAbsoluteMaxSize = 0;
20      private int componentPoolSize = 0;
21  
22      public SedaServiceStatistics(String name, int threadPoolSize, int componentPoolsize)
23      {
24          super(name, threadPoolSize);
25          this.componentPoolMaxSize = componentPoolsize;
26          this.componentPoolAbsoluteMaxSize = componentPoolMaxSize;
27      }
28  
29      public synchronized void clear()
30      {
31          componentPoolSize = 0;
32          componentPoolAbsoluteMaxSize = 0;
33          super.clear();
34      }
35  
36      public int getComponentPoolMaxSize()
37      {
38          return componentPoolMaxSize;
39      }
40  
41      public int getComponentPoolAbsoluteMaxSize()
42      {
43          return componentPoolAbsoluteMaxSize;
44      }
45  
46      public int getComponentPoolSize()
47      {
48          return componentPoolSize;
49      }
50  
51      public synchronized void setComponentPoolSize(int componentPoolSize)
52      {
53          this.componentPoolSize = componentPoolSize;
54          if (componentPoolSize > componentPoolAbsoluteMaxSize)
55          {
56              componentPoolAbsoluteMaxSize = componentPoolSize;
57          }
58      }
59  }