View Javadoc

1   /*
2    * EL4J, the Extension Library for the J2EE, adds incremental enhancements to
3    * the spring framework, http://el4j.sf.net
4    * Copyright (C) 2009 by ELCA Informatique SA, Av. de la Harpe 22-24,
5    * 1000 Lausanne, Switzerland, http://www.elca.ch
6    *
7    * EL4J is published under the GNU Lesser General Public License (LGPL)
8    * Version 2.1. See http://www.gnu.org/licenses/
9    *
10   * This program is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13   * GNU Lesser General Public License for more details.
14   *
15   * For alternative licensing, please contact info@elca.ch
16   */
17  package ch.elca.el4j.util.socketstatistics;
18  
19  import java.util.Set;
20  
21  /**
22   * MBean Interface to SocketStatistics. 
23   * This MBean provides the possibility to monitor open / closed socket connections
24   * and their properties.
25   *
26   * @svnLink $Revision: 3929 $;$Date: 2009-09-25 16:38:41 +0200 (Fr, 25. Sep 2009) $;$Author: jonasha $;$URL: https://el4j.svn.sourceforge.net/svnroot/el4j/branches/el4j_3_1/el4j/framework/modules/socketstatistics/src/main/java/ch/elca/el4j/util/socketstatistics/SocketStatisticsMXBean.java $
27   *
28   * @author Jonas Hauenstein (JHN)
29   */
30  public interface SocketStatisticsMXBean {
31  
32  	/**
33  	 * Get number of already closed sockets.
34  	 * 
35  	 * @return number of closed sockets
36  	 */
37  	public long getClosedSocketsCount();
38  
39  	/**
40  	 * Get number of open sockets.
41  	 * 
42  	 * @return number of open sockets
43  	 */
44  	public long getOpenSocketsCount();
45  
46  	/**
47  	 * Get a Set of all present ConnectionStatics for open and already closed sockets.
48  	 * 
49  	 * @return set of all tracked ConnectionStatatics
50  	 */
51  	public Set<ConnectionStatistics> getConnectionStatistics();
52  
53  	/**
54  	 * Getter for the keepStats property which defines how many seconds stats of closed sockets are kept.
55  	 * 
56  	 * @return how many seconds closed sockets are kept in statistics
57  	 */
58  	public int getKeepStats();
59  
60  	/**
61  	 * Setter for the keepStats property which defines how many seconds stats of closed sockets are kept.
62  	 * 
63  	 * @param ks how many seconds closed sockets will be kept in statistics
64  	 */
65  	public void setKeepStats(int ks);
66  
67  	/**
68  	 * Generate a csv of all gathered statistics and save it on the passed path/filename.
69  	 * 
70  	 * @param filepath
71  	 *            path and filename of the csv output
72  	 */
73  	public void exportStatisticsCSV(String filepath);
74  
75  	/**
76  	 * Delete all gathered statistics.
77  	 */
78  	public void deleteStatistics();
79  
80  }