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;
8   
9   /**
10   * TODO MULE-2233 Pooling functionality has been abstracted out of the SedaService. 
11   * This class should be updated accordingly.
12   */
13  public class SedaServiceStatistics extends ServiceStatistics
14  {
15      private int componentPoolMaxSize = 0;
16      private int componentPoolAbsoluteMaxSize = 0;
17      private int componentPoolSize = 0;
18  
19      public SedaServiceStatistics(String name, int threadPoolSize, int componentPoolsize)
20      {
21          super(name, threadPoolSize);
22          this.componentPoolMaxSize = componentPoolsize;
23          this.componentPoolAbsoluteMaxSize = componentPoolMaxSize;
24      }
25  
26      public synchronized void clear()
27      {
28          componentPoolSize = 0;
29          componentPoolAbsoluteMaxSize = 0;
30          super.clear();
31      }
32  
33      public int getComponentPoolMaxSize()
34      {
35          return componentPoolMaxSize;
36      }
37  
38      public int getComponentPoolAbsoluteMaxSize()
39      {
40          return componentPoolAbsoluteMaxSize;
41      }
42  
43      public int getComponentPoolSize()
44      {
45          return componentPoolSize;
46      }
47  
48      public synchronized void setComponentPoolSize(int componentPoolSize)
49      {
50          this.componentPoolSize = componentPoolSize;
51          if (componentPoolSize > componentPoolAbsoluteMaxSize)
52          {
53              componentPoolAbsoluteMaxSize = componentPoolSize;
54          }
55      }
56  }