01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.objectserver.handler;
05:
06: import com.tc.async.api.AbstractEventHandler;
07: import com.tc.async.api.EventContext;
08: import com.tc.management.L2LockStatsManager;
09: import com.tc.net.groups.NodeID;
10: import com.tc.object.lockmanager.api.LockID;
11: import com.tc.object.msg.LockStatisticsResponseMessage;
12:
13: import java.util.List;
14:
15: public class ClientLockStatisticsHandler extends AbstractEventHandler {
16:
17: private L2LockStatsManager lockStatsManager;
18:
19: public ClientLockStatisticsHandler(
20: L2LockStatsManager lockStatsManager) {
21: this .lockStatsManager = lockStatsManager;
22: }
23:
24: public void handleEvent(EventContext context) {
25: LockStatisticsResponseMessage lsrm = (LockStatisticsResponseMessage) context;
26: NodeID nodeID = lsrm.getClientID();
27: LockID lockID = lsrm.getLockID();
28: List stackTraces = lsrm.getStackTraces();
29: lockStatsManager.recordStackTraces(lockID, nodeID, stackTraces);
30: }
31:
32: }
|