View Javadoc

1   /***
2    *  Copyright 2003-2010 Terracotta, Inc.
3    *
4    *  Licensed under the Apache License, Version 2.0 (the "License");
5    *  you may not use this file except in compliance with the License.
6    *  You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   *  Unless required by applicable law or agreed to in writing, software
11   *  distributed under the License is distributed on an "AS IS" BASIS,
12   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   *  See the License for the specific language governing permissions and
14   *  limitations under the License.
15   */
16  
17  package net.sf.ehcache.constructs.blocking;
18  
19  import net.sf.ehcache.CacheException;
20  
21  
22  /***
23   * Indicates that a timeout has occured while attempting to obtain a lock using
24   * {@link net.sf.ehcache.concurrent.ReadWriteLockSync#tryLock(net.sf.ehcache.concurrent.LockType, long)}
25   * <p/>
26   * This is a normal runtime exception which should be handled by calling code.
27   * It is possible that simply reattempting to obtain the lock may succeed.
28   * Timeouts are often caused by overloaded resources.
29   * <p/>
30   * The frequency of these Exceptions may be reduced by increasing the timeout
31   * if appropriate.
32   * @author Greg Luck
33   * @version $Id: LockTimeoutException.html 13146 2011-08-01 17:12:39Z oletizi $
34   */
35  public class LockTimeoutException extends CacheException {
36  
37      /***
38       * Constructs a new runtime exception with <code>null</code> as its
39       * detail message.  The cause is not initialized, and may subsequently be
40       * initialized by a call to {@link #initCause}.
41       */
42      public LockTimeoutException() {
43          super();
44      }
45  
46      /***
47       * Constructs a new runtime exception with the specified detail message.
48       * The cause is not initialized, and may subsequently be initialized by a
49       * call to {@link #initCause}.
50       *
51       * @param message the detail message. The detail message is saved for
52       *                later retrieval by the {@link #getMessage()} method.
53       */
54      public LockTimeoutException(String message) {
55          super(message);
56      }
57  
58  
59      /***
60       * Constructor for the LockTimeoutException object.
61       *
62       * @param message      the exception detail message
63       * @param cause        the cause of the exception
64       */
65      public LockTimeoutException(String message, Throwable cause) {
66          super(message, cause);
67      }
68  
69  
70  }