01: package com.sun.portal.rproxy.monitoring;
02:
03: import com.sun.portal.monitoring.Subsystem;
04: import com.sun.portal.monitoring.statistics.*;
05: import com.sun.portal.util.SRAEvent;
06: import com.sun.portal.rproxy.monitoring.util.RProxyEvent;
07:
08: /**
09: * author: Noble Paul
10: * Date: Feb 9, 2005, 10:15:32 AM
11: */
12: public class ISNotificationsStatistic extends RProxyStatisticBase {
13: public static final String NOTIFICATION_TIME = "NotificationTime";
14: private static RollingAvgTimeStatisticImpl notificationTime = new RollingAvgTimeStatisticImpl();
15:
16: public static RollingAvgTimeStatisticImpl getNotificationTime() {
17: return notificationTime;
18: }
19:
20: public ISNotificationsStatistic(Subsystem subsystem) {
21: super (subsystem);
22: }
23:
24: public void updateISNotificationInfo() {
25: RProxyResponseInfo info = (RProxyResponseInfo) threadLocal
26: .get();
27: info.requestType = RProxyResponseInfo.IS_NOTIFICATION_TYPE;
28: }
29:
30: protected String getMbeanType() {
31: return "ISNotifications";
32: }
33:
34: protected String[] getMBeanNames() {
35: return new String[] { NOTIFICATION_TIME };
36: }
37:
38: protected StatisticImpl[] getStatistics() {
39: return new RollingAvgTimeStatisticImpl[] { notificationTime };
40: }
41:
42: protected StatisticWrapper getStatistic(String name) {
43: return getRAStatistic(name);
44: }
45:
46: public void handleEvent(SRAEvent event, Object obj) {
47: //TODO give proper implementation
48: }
49:
50: public SRAEvent[] getInterestedEvents() {
51: return new SRAEvent[] { SRAEvent.IS_NOTIFICATION };
52: }
53: }
|