1 29 30 31 package com.caucho.server.session; 32 33 import com.caucho.management.server.AbstractManagedObject; 34 import com.caucho.management.server.PersistentStoreMXBean; 35 import com.caucho.management.server.SessionManagerMXBean; 36 import com.caucho.management.server.WebAppMXBean; 37 import com.caucho.server.cluster.Store; 38 39 import java.util.logging.Logger ; 40 41 44 public class SessionManagerAdmin extends AbstractManagedObject 45 implements SessionManagerMXBean 46 { 47 private static final Logger log 48 = Logger.getLogger(SessionManagerAdmin.class.getName()); 49 50 private final SessionManager _manager; 51 52 public SessionManagerAdmin(SessionManager manager) 53 { 54 _manager = manager; 55 56 registerSelf(); 57 } 58 59 62 public String getName() 63 { 64 return null; 65 } 66 67 70 public WebAppMXBean getWebApp() 71 { 72 return _manager.getWebApp().getAdmin(); 73 } 74 75 79 83 public boolean isAlwaysSaveSession() 84 { 85 return _manager.getAlwaysSaveSession(); 86 } 87 88 91 public boolean isCookieAppendServerIndex() 92 { 93 return _manager.isCookieAppendServerIndex(); 94 } 95 96 99 public String getCookieDomain() 100 { 101 return _manager.getCookieDomain(); 102 } 103 104 107 public boolean isCookieHttpOnly() 108 { 109 return _manager.isCookieHttpOnly(); 110 } 111 112 115 public long getCookieLength() 116 { 117 return _manager.getCookieLength(); 118 } 119 120 123 public long getCookieMaxAge() 124 { 125 return _manager.getCookieMaxAge(); 126 } 127 128 131 public String getCookieName() 132 { 133 return _manager.getCookieName(); 134 } 135 136 139 public String getCookiePort() 140 { 141 return _manager.getCookiePort(); 142 } 143 144 147 public boolean isCookieSecure() 148 { 149 return _manager.getCookieSecure(); 150 } 151 152 155 public int getCookieVersion() 156 { 157 return _manager.getCookieVersion(); 158 } 159 160 163 public boolean isEnableCookies() 164 { 165 return _manager.enableSessionCookies(); 166 } 167 168 171 public boolean isEnableURLRewriting() 172 { 173 return _manager.enableSessionUrls(); 174 } 175 176 179 public boolean isIgnoreSerializationErrors() 180 { 181 return _manager.getIgnoreSerializationErrors(); 182 } 183 184 187 public boolean isInvalidateAfterListener() 188 { 189 return _manager.isInvalidateAfterListener(); 190 } 191 192 195 public boolean isReuseSessionId() 196 { 197 return _manager.getReuseSessionId() != 0; 198 } 199 200 203 public String getSaveMode() 204 { 205 return _manager.getSaveMode(); 206 } 207 208 211 public int getSessionMax() 212 { 213 return _manager.getSessionMax(); 214 } 215 216 219 public long getSessionTimeout() 220 { 221 return _manager.getSessionTimeout(); 222 } 223 224 227 public PersistentStoreMXBean getPersistentStore() 228 { 229 return null; 230 } 231 232 235 public int getActiveSessionCount() 236 { 237 return _manager.getActiveSessionCount(); 238 } 239 240 243 public long getSessionActiveCount() 244 { 245 return _manager.getSessionActiveCount(); 246 } 247 248 251 public long getSessionCreateCountTotal() 252 { 253 return _manager.getSessionCreateCount(); 254 } 255 256 259 public long getSessionInvalidateCountTotal() 260 { 261 return _manager.getSessionInvalidateCount(); 262 } 263 264 267 public long getSessionTimeoutCountTotal() 268 { 269 return _manager.getSessionTimeoutCount(); 270 } 271 272 275 public String getSessionStoreType() 276 { 277 Store store = _manager.getSessionStore(); 278 279 if (store == null) 280 return null; 281 282 String className = store.getStoreManager().getClass().getName(); 283 284 int p = className.lastIndexOf('.'); 285 286 return className.substring(p + 1); 287 } 288 289 292 public void unregister() 293 { 294 unregisterSelf(); 295 } 296 297 public String toString() 298 { 299 return "SessionManagerAdmin[" + getObjectName() + "]"; 300 } 301 } 302 | Popular Tags |