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.nonstop.concurrency;
18  
19  import net.sf.ehcache.constructs.nonstop.NonStopCacheException;
20  
21  /***
22   * Exception class signifying invalid lock state. This normally happens when locks are acquired using explicit lock api's in Ehcache and a
23   * rejoin happens. All locks are flushed/invalidated when a Terracotta client rejoins the cluster. This exception will be thrown, for
24   * example, when trying to unlock a lock that was acquired prior to a rejoin.
25   *
26   * @author Abhishek Sanoujam
27   *
28   */
29  public class InvalidLockStateAfterRejoinException extends NonStopCacheException {
30  
31      /***
32       * Default Constructor
33       */
34      public InvalidLockStateAfterRejoinException() {
35          this(null);
36      }
37  
38      /***
39       * Constructor accepting a root cause
40       */
41      public InvalidLockStateAfterRejoinException(Throwable cause) {
42          this("Invalid lock state as locks are flushed after rejoin. The cluster rejoined and locks were acquired before rejoin.", cause);
43      }
44  
45      /***
46       * Constructor accepting a root cause and a message
47       */
48      public InvalidLockStateAfterRejoinException(String message, Throwable cause) {
49          super(message, cause);
50      }
51  
52  }