KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > management > server > SessionManagerMXBean


1 /*
2  * Copyright (c) 1998-2006 Caucho Technology -- all rights reserved
3  *
4  * This file is part of Resin(R) Open Source
5  *
6  * Each copy or derived work must preserve the copyright notice and this
7  * notice unmodified.
8  *
9  * Resin Open Source is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * Resin Open Source is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17  * of NON-INFRINGEMENT. See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with Resin Open Source; if not, write to the
22  *
23  * Free Software Foundation, Inc.
24  * 59 Temple Place, Suite 330
25  * Boston, MA 02111-1307 USA
26  *
27  * @author Scott Ferguson
28  */

29
30 package com.caucho.management.server;
31
32 import com.caucho.jmx.Description;
33 import com.caucho.jmx.Units;
34
35 /**
36  * Administration for the SessionManager for a WebApp.
37  *
38  * The JMX name looks like:
39  * <pre>
40  * resin:type=SessionManager,WebApp=/wiki,Host=caucho.com
41  * </pre>
42  */

43 @Description("The session manager for a web-app")
44 public interface SessionManagerMXBean extends ManagedObjectMXBean
45 {
46   //
47
// Hierarchy Attributes
48
//
49

50   /**
51    * Returns the owning WebApp.
52    */

53   @Description("The owning WebApp for this session manager")
54   public WebAppMXBean getWebApp();
55
56   /**
57    * Returns the persistent store.
58    */

59   @Description("The persistent store")
60   public PersistentStoreMXBean getPersistentStore();
61
62   //
63
// Configuration attributes
64
//
65

66   /**
67    * True if the session should be serialized for storage, even if
68    * no attributes in the session have been set.
69    */

70   @Description("The configured value, if true serialize the session on each request, even if no attributes have been set")
71   public boolean isAlwaysSaveSession();
72
73   /**
74    * If true, the server's cluster index is appended to the cookie value.
75    */

76   @Description("The configured value, if true append the server's cluster index to the cookie value")
77   public boolean isCookieAppendServerIndex();
78
79   /**
80    * The host domain used for session cookies
81    */

82   @Description("The configured host domain used for session cookies")
83   public String JavaDoc getCookieDomain();
84
85   /**
86    * True if the cookie should only be used for http, not https requests.
87    */

88   @Description("The configured value, if true the cookie should only be used for http, not https requests")
89   public boolean isCookieHttpOnly();
90
91   /**
92    * The length of the generated cookie
93    */

94   @Description("The configured length of the generated cookie")
95   public long getCookieLength();
96
97   /**
98    * The session cookie max-age sent to the browser.
99    */

100   @Description("The configured session cookie max-age in milliseconds sent to the browser")
101   @Units("milliseconds")
102   public long getCookieMaxAge();
103
104   /**
105    * The cookie name used for sessions.
106    */

107   @Description("The configured cookie name for servlet sessions")
108   public String JavaDoc getCookieName();
109
110   /**
111    * The session cookie port sent to the client browser.
112    */

113   @Description("The configured session cookie port sent to the browser")
114   public String JavaDoc getCookiePort();
115
116   /**
117    * True if the session cookie should only be sent on a secure connection.
118    */

119   @Description("The configured value, if true the session cookie should only be sent on a secure connection")
120   public boolean isCookieSecure();
121
122   /**
123    * The cookie version sent to the browser.
124    */

125   @Description("The configured cookie version sent to the browser")
126   public int getCookieVersion();
127
128   /**
129    * True if the server reads and writes cookies
130    */

131   @Description("The configured value, if true session cookies are enabled")
132   public boolean isEnableCookies();
133
134   /**
135    * (discouraged). True if the URL-rewriting is enabled.
136    * In general, URL-rewriting should be avoided as a security risk.
137    */

138   @Description("The configured value, if true (discouraged) URL-rewriting is enabled. URL-rewriting should be avoided as a security risk.")
139   public boolean isEnableURLRewriting();
140
141   /**
142    * True if persistent sessions should ignore serialization errors.
143    */

144   @Description("The configured value, if true persistent sessions should ignore serialization errors.")
145   public boolean isIgnoreSerializationErrors();
146
147   /**
148    * True if the session should be invalidated only after listeners are
149    * called.
150    */

151   @Description("The configured value, if true the session should be invalidated only after listeners are called")
152   public boolean isInvalidateAfterListener();
153
154   /**
155    * True if session-id should be reused if no session exists. This
156    * should generally be true for web-app consistence.
157    */

158   @Description("The configured value, if true the session-id should be reused if no session exists to match the cookie. This should generally be true to ensure web-app session consistency")
159   public boolean isReuseSessionId();
160     
161   /**
162    * Returns the session save-mode.
163    */

164   @Description("The configured session persistence mode. The session save-mode is one of: " +
165            "before-headers, after-request, on-shutdown")
166   public String JavaDoc getSaveMode();
167     
168   /**
169    * The maximum number of sessions in memory. The number
170    * of persistent sessions may be larger.
171    */

172   @Description("The configured maximum number of sessions in memory. The number of persistent sessions may be larger")
173   public int getSessionMax();
174     
175   /**
176    * The maximum time an idle session will be saved. session-timeout affects
177    * persistent sessions.
178    */

179   @Description("The configured time in milliseconds before an idle session is destroyed")
180   @Units("milliseconds")
181   public long getSessionTimeout();
182
183   //
184
// statistics
185
//
186

187   /**
188    * Returns the count of active sessions.
189    */

190   @Description("The current number of active sessions")
191   public long getSessionActiveCount();
192
193   /**
194    * Returns the count of sessions created
195    */

196   @Description("The total number of sessions that have been created")
197   public long getSessionCreateCountTotal();
198
199   /**
200    * Returns the count of sessions invalidated
201    */

202   @Description("The total number of sessions that have been invalidated")
203   public long getSessionInvalidateCountTotal();
204
205   /**
206    * Returns the count of sessions timeout
207    */

208   @Description("The total number of times a session has timed out")
209   public long getSessionTimeoutCountTotal();
210 }
211
Popular Tags