KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > objectserver > handler > TransactionAcknowledgementHandler


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.objectserver.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.msg.AcknowledgeTransactionMessage;
10 import com.tc.objectserver.core.api.ServerConfigurationContext;
11 import com.tc.objectserver.tx.ServerTransactionManager;
12
13 /**
14  * @author steve
15  */

16 public class TransactionAcknowledgementHandler extends AbstractEventHandler {
17   private ServerTransactionManager transactionManager;
18
19   public void handleEvent(EventContext context) {
20     AcknowledgeTransactionMessage atm = (AcknowledgeTransactionMessage) context;
21     transactionManager.acknowledgement(atm.getRequesterID(), atm.getRequestID(), atm.getChannelID());
22   }
23
24   public void initialize(ConfigurationContext context) {
25     super.initialize(context);
26     ServerConfigurationContext scc = (ServerConfigurationContext) context;
27     this.transactionManager = scc.getTransactionManager();
28   }
29
30 }
Popular Tags