01: /*
02: * ==============================================================================
03: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
04: * use this file except in compliance with the License. You may obtain a copy of
05: * the License at
06: *
07: * http://www.apache.org/licenses/LICENSE-2.0
08: *
09: * Unless required by applicable law or agreed to in writing, software
10: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12: * License for the specific language governing permissions and limitations under
13: * the License.
14: */
15: package wicket.jmx;
16:
17: import java.io.IOException;
18:
19: import wicket.protocol.http.WebApplication;
20:
21: /**
22: * Interface for exposing the request logger.
23: *
24: * @author eelcohillenius
25: */
26: public interface RequestLoggerMBean {
27: /**
28: * Total number of sessions ever created since the application was started.
29: * <p>
30: * Only available for {@link WebApplication web applications}.
31: * </p>
32: *
33: * @return the total number of sessions ever created since the application
34: * was started
35: * @throws IOException
36: */
37: Integer getNumberOfCreatedSessions() throws IOException;
38:
39: /**
40: * Gets the (recorded) number of currently live sessions.
41: * <p>
42: * Only available for {@link WebApplication web applications}.
43: * </p>
44: *
45: * @return current (recorded) number of live sessions
46: * @throws IOException
47: */
48: Integer getNumberOfLiveSessions() throws IOException;
49:
50: /**
51: * The largest number of concurrent sessions since the application was
52: * started.
53: * <p>
54: * Only available for {@link WebApplication web applications}.
55: * </p>
56: *
57: * @return the largest number of concurrent sessions since the application
58: * was started
59: * @throws IOException
60: */
61: Integer getPeakNumberOfSessions() throws IOException;
62:
63: /**
64: * Registers a new request logger at the application. You need a request
65: * logger for some functions of the session bean. Be aware that sessions
66: * will be logged from this time on, so they may not reflect the actual
67: * number of sessions. Also, if one was registered, it will be replaced by a
68: * new one, which then starts over counting, disregarding the current ones.
69: * <p>
70: * Only available for {@link WebApplication web applications}.
71: * </p>
72: *
73: * @throws IOException
74: */
75: void restart() throws IOException;
76:
77: /**
78: * Removes any set request logger from the application. You need a request
79: * logger for some functions of the session bean.
80: * <p>
81: * Only available for {@link WebApplication web applications}.
82: * </p>
83: *
84: * @throws IOException
85: */
86: void stop() throws IOException;
87: }
|