01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.management.beans.sessions;
05:
06: import com.tc.management.TerracottaMBean;
07:
08: /**
09: * MBean for session monitoring of Terracotta-clustered sessions. This MBean tracks
10: * session creation, session destruction, and requests processed.
11: */
12: public interface SessionMonitorMBean extends TerracottaMBean {
13:
14: /**
15: * Interface to use when killing sessions
16: */
17: public static interface SessionsComptroller {
18: /**
19: * Kill the specified session
20: * @param sessionId Session to kill
21: * @return True if killed
22: */
23: boolean killSession(String sessionId);
24: }
25:
26: /**
27: * Get count of total requests in sample
28: * @return Total requests in sample
29: */
30: int getRequestCount();
31:
32: /**
33: * @return Requests per second in sample
34: */
35: int getRequestRatePerSecond();
36:
37: /**
38: * @return Sessions created in sample
39: */
40: int getCreatedSessionCount();
41:
42: /**
43: * @return Session creation rate in sample
44: */
45: int getSessionCreationRatePerMinute();
46:
47: /**
48: * @return Sessions destroyed in sample
49: */
50: int getDestroyedSessionCount();
51:
52: /**
53: * @return Sessions destroyed rate in sample
54: */
55: int getSessionDestructionRatePerMinute();
56:
57: /**
58: * Reset sampling
59: */
60: void reset();
61:
62: /**
63: * Force session to expire
64: * @param sessionId Session to expire
65: * @return True if expired
66: */
67: boolean expireSession(String sessionId);
68:
69: /**
70: * Register a sessions controller
71: * @param comptroller Sessions controller
72: */
73: void registerSessionsController(SessionsComptroller comptroller);
74:
75: /**
76: * Event indicating to mbean that a session was created.
77: */
78: void sessionCreated();
79:
80: /**
81: * Event indicating to mbean that a session was destroyed.
82: */
83: void sessionDestroyed();
84:
85: /**
86: * Event indicating to mbean that a request was processed.
87: */
88: void requestProcessed();
89:
90: }
|