KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > objectserver > lockmanager > api > LockHolder


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.lockmanager.api;
5
6 import com.tc.net.protocol.tcm.ChannelID;
7 import com.tc.object.lockmanager.api.LockLevel;
8 import com.tc.object.lockmanager.api.ThreadID;
9
10 import java.io.Serializable JavaDoc;
11
12 public class LockHolder implements Serializable JavaDoc {
13
14   private final ChannelID channelID;
15   private final ThreadID threadID;
16   private final long timeAcquired;
17   private final String JavaDoc lockLevel;
18   private final String JavaDoc channelAddr;
19
20   public LockHolder(ChannelID channelID, String JavaDoc channelAddr, ThreadID threadID, int level, long timeAcquired) {
21     this.channelID = channelID;
22     this.channelAddr = channelAddr;
23     this.threadID = threadID;
24     this.timeAcquired = timeAcquired;
25     this.lockLevel = LockLevel.toString(level);
26   }
27
28   public String JavaDoc getLockLevel() {
29     return this.lockLevel;
30   }
31
32   public ChannelID getChannelID() {
33     return channelID;
34   }
35
36   public String JavaDoc getChannelAddr() {
37     return this.channelAddr;
38   }
39
40   public long getTimeAcquired() {
41     return timeAcquired;
42   }
43
44   public ThreadID getThreadID() {
45     return threadID;
46   }
47 }
48
Popular Tags