KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > cache > lock > LockingException


1 // $Id: LockingException.java,v 1.2 2006/12/11 21:14:34 genman Exp $
2

3 /*
4  * JBoss, the OpenSource J2EE webOS
5  *
6  * Distributable under LGPL license.
7  * See terms of license at gnu.org.
8  */

9
10 package org.jboss.cache.lock;
11
12 import org.jboss.cache.CacheException;
13
14 import java.util.Map JavaDoc;
15
16
17 /**
18  * Used for all locking-related exceptions, e.g. when a lock could not be
19  * acquired within the timeout, or when a deadlock was detected.
20  *
21  * @author <a HREF="mailto:bela@jboss.org">Bela Ban</a>.
22  * @version $Revision: 1.2 $
23  * <p/>
24  * <p><b>Revisions:</b>
25  * <p/>
26  * <p>Dec 27 2002 Bela Ban: first implementation
27  */

28
29 public class LockingException extends CacheException
30 {
31
32    private static final long serialVersionUID = 5551396474793902133L;
33    
34    /**
35     * A list of all nodes that failed to acquire a lock
36     */

37    Map JavaDoc failed_lockers = null;
38
39    public LockingException()
40    {
41       super();
42    }
43
44    public LockingException(Map JavaDoc failed_lockers)
45    {
46       super();
47       this.failed_lockers = failed_lockers;
48    }
49
50    public LockingException(String JavaDoc msg)
51    {
52       super(msg);
53    }
54
55    public LockingException(String JavaDoc msg, Map JavaDoc failed_lockers)
56    {
57       super(msg);
58       this.failed_lockers = failed_lockers;
59    }
60
61    public LockingException(String JavaDoc msg, Throwable JavaDoc cause)
62    {
63       super(msg, cause);
64    }
65
66    public LockingException(String JavaDoc msg, Throwable JavaDoc cause, Map JavaDoc failed_lockers)
67    {
68       super(msg, cause);
69       this.failed_lockers = failed_lockers;
70    }
71
72    public String JavaDoc toString()
73    {
74       String JavaDoc retval = super.toString();
75       if (failed_lockers != null && failed_lockers.size() > 0)
76          retval = retval + ", failed lockers: " + failed_lockers;
77       return retval;
78    }
79
80 }
81
Popular Tags