01: package com.protomatter.util;
02:
03: /**
04: * {{{ The Protomatter Software License, Version 1.0
05: * derived from The Apache Software License, Version 1.1
06: *
07: * Copyright (c) 1998-2002 Nate Sammons. All rights reserved.
08: *
09: * Redistribution and use in source and binary forms, with or without
10: * modification, are permitted provided that the following conditions
11: * are met:
12: *
13: * 1. Redistributions of source code must retain the above copyright
14: * notice, this list of conditions and the following disclaimer.
15: *
16: * 2. Redistributions in binary form must reproduce the above copyright
17: * notice, this list of conditions and the following disclaimer in
18: * the documentation and/or other materials provided with the
19: * distribution.
20: *
21: * 3. The end-user documentation included with the redistribution,
22: * if any, must include the following acknowledgment:
23: * "This product includes software developed for the
24: * Protomatter Software Project
25: * (http://protomatter.sourceforge.net/)."
26: * Alternately, this acknowledgment may appear in the software itself,
27: * if and wherever such third-party acknowledgments normally appear.
28: *
29: * 4. The names "Protomatter" and "Protomatter Software Project" must
30: * not be used to endorse or promote products derived from this
31: * software without prior written permission. For written
32: * permission, please contact support@protomatter.com.
33: *
34: * 5. Products derived from this software may not be called "Protomatter",
35: * nor may "Protomatter" appear in their name, without prior written
36: * permission of the Protomatter Software Project
37: * (support@protomatter.com).
38: *
39: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
40: * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
41: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
42: * DISCLAIMED. IN NO EVENT SHALL THE PROTOMATTER SOFTWARE PROJECT OR
43: * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
45: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
46: * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
47: * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
48: * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
49: * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
50: * SUCH DAMAGE. }}}
51: */
52:
53: import java.util.*;
54: import com.protomatter.pool.*;
55: import com.protomatter.syslog.Syslog;
56:
57: /**
58: * A token showing ownership of a Mutex lock.
59: *
60: * @see Mutex
61: */
62: class MutexToken implements ObjectPoolObject {
63: /**
64: * Non-public constructor since only the MutexObject should
65: * be creating these.
66: */
67: MutexToken() {
68: super ();
69: }
70:
71: /**
72: * Used internally by the Mutex.
73: */
74: public void deleteObjectPoolObject() {
75: // not much to do here.
76: }
77:
78: /**
79: * Used internally by the Mutex.
80: */
81: public boolean isObjectPoolObjectValid() {
82: return true;
83: }
84:
85: /**
86: * Used internally by the Mutex.
87: */
88: public void beforeObjectPoolObjectCheckout() {
89: // not really much to do here.
90: }
91:
92: /**
93: * Used internally by the Mutex.
94: */
95: public void afterObjectPoolObjectCheckin() {
96: // not much to do here.
97: }
98: }
|