KickJava   Java API By Example, From Geeks To Geeks.

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


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.msg.AcknowledgeTransactionMessage;
11 import com.tc.object.tx.ClientTransactionManager;
12
13 /**
14  * @author steve
15  */

16 public class ReceiveTransactionCompleteHandler extends AbstractEventHandler {
17   private ClientTransactionManager transactionManager;
18
19   public void handleEvent(EventContext context) {
20     AcknowledgeTransactionMessage atm = (AcknowledgeTransactionMessage) context;
21     transactionManager.receivedAcknowledgement(atm.getLocalSessionID(), atm.getRequestID());
22   }
23
24   public void initialize(ConfigurationContext context) {
25     super.initialize(context);
26     ClientConfigurationContext cc = (ClientConfigurationContext) context;
27     transactionManager = cc.getTransactionManager();
28   }
29 }
Popular Tags