KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > objectserver > handler > JMXEventsHandler


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.handler;
5
6 import com.tc.async.api.AbstractEventHandler;
7 import com.tc.async.api.EventContext;
8 import com.tc.object.msg.JMXMessage;
9 import com.tc.objectserver.DSOApplicationEvents;
10
11 public class JMXEventsHandler extends AbstractEventHandler {
12
13   private final DSOApplicationEvents appEvents;
14
15   public JMXEventsHandler(DSOApplicationEvents appEvents) {
16     this.appEvents = appEvents;
17   }
18
19   public void handleEvent(EventContext context) {
20     if (context instanceof JMXMessage) {
21       appEvents.addMessage((JMXMessage) context);
22     } else {
23       throw new AssertionError JavaDoc("Unknown event type: " + context);
24     }
25   }
26
27 }
28
Popular Tags