KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > object > handler > ReceiveObjectHandler


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.object.handler;
5
6 import com.tc.async.api.AbstractEventHandler;
7 import com.tc.async.api.ConfigurationContext;
8 import com.tc.async.api.EventContext;
9 import com.tc.object.ClientConfigurationContext;
10 import com.tc.object.RemoteObjectManager;
11 import com.tc.object.msg.RequestManagedObjectResponseMessage;
12
13 /**
14  * @author steve
15  */

16 public class ReceiveObjectHandler extends AbstractEventHandler {
17   private RemoteObjectManager objectManager;
18
19   public void handleEvent(EventContext context) {
20     RequestManagedObjectResponseMessage m = (RequestManagedObjectResponseMessage) context;
21     objectManager.addAllObjects(m.getLocalSessionID(), m.getBatchID(), m.getObjects());
22   }
23
24   public void initialize(ConfigurationContext context) {
25     super.initialize(context);
26     ClientConfigurationContext ccc = (ClientConfigurationContext) context;
27     this.objectManager = ccc.getObjectManager();
28   }
29
30 }
Popular Tags