01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright
03: * notice. All rights reserved.
04: */
05: package com.tc.objectserver;
06:
07: import com.tc.net.protocol.tcm.UnsupportedMessageTypeException;
08: import com.tc.object.appevent.NonPortableObjectEvent;
09: import com.tc.object.appevent.ReadOnlyObjectEvent;
10: import com.tc.object.appevent.UnlockedSharedObjectEvent;
11: import com.tc.object.msg.JMXMessage;
12: import com.tc.stats.AbstractNotifyingMBean;
13:
14: import javax.management.NotCompliantMBeanException;
15:
16: public class DSOApplicationEvents extends AbstractNotifyingMBean
17: implements DSOApplicationEventsMBean {
18:
19: public DSOApplicationEvents() throws NotCompliantMBeanException {
20: super (DSOApplicationEventsMBean.class);
21: }
22:
23: public void addMessage(final JMXMessage msg)
24: throws UnsupportedMessageTypeException {
25: Object obj = msg.getJMXObject();
26: String notifyType = null;
27:
28: if (obj instanceof NonPortableObjectEvent) {
29: notifyType = NON_PORTABLE_OBJECT_EVENT;
30: } else if (obj instanceof UnlockedSharedObjectEvent) {
31: notifyType = UNLOCKED_SHARED_OBJECT_EVENT;
32: } else if (obj instanceof ReadOnlyObjectEvent) {
33: notifyType = READ_ONLY_OBJECT_EVENT;
34: }
35:
36: if (notifyType != null) {
37: sendNotification(notifyType, obj);
38: }
39: }
40:
41: public void reset() {
42: // nothing to reset
43: }
44:
45: }
|