KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > objectserver > DSOApplicationEvents


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.objectserver;
5
6 import com.tc.net.protocol.tcm.UnsupportedMessageTypeException;
7 import com.tc.object.appevent.NonPortableObjectEvent;
8 import com.tc.object.msg.JMXMessage;
9 import com.tc.stats.AbstractNotifyingMBean;
10 import com.tc.util.Assert;
11
12 import javax.management.NotCompliantMBeanException JavaDoc;
13
14 public class DSOApplicationEvents extends AbstractNotifyingMBean implements DSOApplicationEventsMBean {
15
16   public DSOApplicationEvents() throws NotCompliantMBeanException JavaDoc {
17     super(DSOApplicationEventsMBean.class);
18   }
19
20   public void addMessage(final JMXMessage msg) throws UnsupportedMessageTypeException {
21     Object JavaDoc obj = msg.getJMXObject();
22     // XXX: dispatch differently based on the type of the serialized object
23
Assert.assertTrue(obj instanceof NonPortableObjectEvent);
24     NonPortableObjectEvent event = (NonPortableObjectEvent) obj;
25     sendNotification(NON_PORTABLE_OBJECT_EVENT, event);
26   }
27   
28   public void reset() {
29     // nothing to reset
30
}
31
32 }
33
Popular Tags