KickJava   Java API By Example, From Geeks To Geeks.

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


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.BatchTransactionAcknowledgeMessage;
11 import com.tc.object.tx.ClientTransactionManager;
12
13 public class BatchTransactionAckHandler extends AbstractEventHandler {
14
15   private ClientTransactionManager transactionManager;
16
17   public void handleEvent(EventContext context) {
18     BatchTransactionAcknowledgeMessage msg = (BatchTransactionAcknowledgeMessage) context;
19     transactionManager.receivedBatchAcknowledgement(msg.getBatchID());
20   }
21
22   public void initialize(ConfigurationContext context) {
23     super.initialize(context);
24     ClientConfigurationContext cc = (ClientConfigurationContext) context;
25     transactionManager = cc.getTransactionManager();
26   }
27
28 }
29
Popular Tags