01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.objectserver.handler;
05:
06: import com.tc.async.api.AbstractEventHandler;
07: import com.tc.async.api.EventContext;
08: import com.tc.object.msg.JMXMessage;
09: 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("Unknown event type: " + context);
24: }
25: }
26:
27: }
|