01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright
03: * notice. All rights reserved.
04: */
05: package com.tc.objectserver.lockmanager.impl;
06:
07: import com.tc.object.lockmanager.api.LockID;
08: import com.tc.objectserver.lockmanager.api.LockHolder;
09: import com.tc.objectserver.lockmanager.api.LockMBean;
10: import com.tc.objectserver.lockmanager.api.ServerLockRequest;
11: import com.tc.objectserver.lockmanager.api.Waiter;
12:
13: import java.io.Serializable;
14:
15: public class LockMBeanImpl implements LockMBean, Serializable {
16:
17: private final String lockName;
18: private final LockHolder[] holders;
19: private final ServerLockRequest[] pendingRequests;
20: private final Waiter[] waiters;
21:
22: public LockMBeanImpl(LockID lockID, LockHolder[] holders,
23: ServerLockRequest[] requests, Waiter[] waiters) {
24: this .lockName = lockID.asString();
25: this .holders = holders;
26: this .pendingRequests = requests;
27: this .waiters = waiters;
28: }
29:
30: public String getLockName() {
31: return this .lockName;
32: }
33:
34: public LockHolder[] getHolders() {
35: return this .holders;
36: }
37:
38: public ServerLockRequest[] getPendingRequests() {
39: return this .pendingRequests;
40: }
41:
42: public Waiter[] getWaiters() {
43: return this .waiters;
44: }
45:
46: public String toString() {
47: return getLockName();
48: }
49:
50: }
|