KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > l2 > handler > L2StateChangeHandler


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

5 package com.tc.l2.handler;
6
7 import com.tc.async.api.AbstractEventHandler;
8 import com.tc.async.api.ConfigurationContext;
9 import com.tc.async.api.EventContext;
10 import com.tc.l2.context.StateChangedEvent;
11 import com.tc.l2.state.StateManager;
12 import com.tc.objectserver.core.api.ServerConfigurationContext;
13
14 public class L2StateChangeHandler extends AbstractEventHandler {
15
16   private StateManager stateManager;
17
18   public void handleEvent(EventContext context) {
19     StateChangedEvent sce = (StateChangedEvent) context;
20     stateManager.fireStateChangedEvent(sce);
21   }
22
23   public void initialize(ConfigurationContext context) {
24     super.initialize(context);
25     ServerConfigurationContext oscc = (ServerConfigurationContext) context;
26     this.stateManager = oscc.getL2Coordinator().getStateManager();
27   }
28
29 }
30
Popular Tags