KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > web > tomcat > tc6 > session > JBossManagerMBean


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2005, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */

22 package org.jboss.web.tomcat.tc6.session;
23
24 import org.jboss.web.tomcat.statistics.ReplicationStatistics;
25
26 /**
27  * The MBean-interface for the JBossManager
28  *
29  * @author Thomas Peuss <jboss@peuss.de>
30  * @author Brian Stansberry
31  *
32  * @version $Revision: 45726 $
33  */

34 public interface JBossManagerMBean
35 {
36    /**
37     * Gets the replication statistics for the sessions managed
38     * by this manager.
39     *
40     * @return the statistics
41     */

42    ReplicationStatistics getReplicationStatistics();
43
44    /**
45     * Resets all statistics.
46     */

47    void resetStats();
48
49    /**
50     * Gets the elapsed time since this manager was instantiated or the
51     * last call to resetStats()
52     */

53    long timeInSecondsSinceLastReset();
54
55    /**
56     * Gets the number of sessions active on this node. Does not include
57     * replicated sessions that have not been accessed on this node.
58     */

59    long getActiveSessionCount();
60
61    /**
62     * Gets the number of times session creation has failed because the
63     * number of active sessions exceeds
64     * {@link #getMaxActiveAllowed() maxActiveAllowed}
65     */

66    long getRejectedSessionCount();
67
68    /**
69     * Gets the number of sessions created on this node. Does not include
70     * sessions initially created on other nodes, even if those sessions
71     * were accessed on this node.
72     */

73    long getCreatedSessionCount();
74
75    /**
76     * Gets the number of sessions that have been expired on this node.
77     */

78    long getExpiredSessionCount();
79    
80    /**
81     * Gets the highest number of sessions concurrently active on this node.
82     * Does not include replicated sessions that have not been accessed on
83     * this node.
84     */

85    long getMaxActiveSessionCount();
86    
87    /**
88     * Gets the maximum number of active sessions that will concurrently be
89     * allowed on this node. Does not include replicated sessions that have
90     * not been accessed on this node.
91     */

92    int getMaxActiveAllowed();
93    
94    /**
95     * Sets the maximum number of active sessions that will concurrently be
96     * allowed on this node. Does not include replicated sessions that have
97     * not been accessed on this node.
98     *
99     * <p>
100     * Note that if sessions fail over to this node from other nodes, the max
101     * number of active sessions may exceed this value.
102     * </p>
103     *
104     * @param max the max number of sessions, or <code>-1</code> if there is
105     * no limit.
106     */

107    void setMaxActiveAllowed(int max);
108    
109    /**
110     * Gets the maximum time interval, in seconds, between client requests
111     * after which sessions created by this manager should be expired. A
112     * negative time indicates that the session should never time out.
113     */

114    int getMaxInactiveInterval();
115    
116    /**
117     * Sets the maximum time interval, in seconds, between client requests
118     * after which sessions created by this manager should be expired. A
119     * negative time indicates that the session should never time out.
120     *
121     * @param interval The new maximum interval
122     */

123    void setMaxInactiveInterval(int minutes);
124    
125    /**
126     * Gets whether this manager's sessions are distributable.
127     */

128    boolean getDistributable();
129    
130    /**
131     * Gets the cumulative number of milliseconds spent in the
132     * <code>Manager.backgroundProcess()</code> method.
133     */

134    long getProcessingTime();
135    
136    /**
137     * Outputs the replication statistics as an HTML table, with one row
138     * per session.
139     */

140    String JavaDoc reportReplicationStatistics();
141    
142    /**
143     * Outputs the replication statistics as a comma-separated-values, with one
144     * row per session. First row is a header listing field names.
145     */

146    String JavaDoc reportReplicationStatisticsCSV();
147
148    /**
149     * Outputs the replication statistics for the given session as a set of
150     * comma-separated-values. First row is a header listing field names.
151     */

152    String JavaDoc reportReplicationStatisticsCSV(String JavaDoc sessionId);
153    
154    /**
155     * Gets the number of characters used in creating a session id. Excludes
156     * any jvmRoute.
157     */

158    int getSessionIdLength();
159 }
160
Popular Tags