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.cluster;
18
19 import net.sf.ehcache.CacheException;
20
21 /***
22 * Exception type that is thrown when requesting for a certain type of ClusterScheme and its not available.
23 *
24 * @author Abhishek Sanoujam
25 *
26 */
27 public class ClusterSchemeNotAvailableException extends CacheException {
28
29 private final ClusterScheme unavailableClusterScheme;
30
31 /***
32 * Constructor accepting the {@link ClusterScheme} that is unavailable
33 */
34 public ClusterSchemeNotAvailableException(ClusterScheme unavailableClusterScheme) {
35 super();
36 this.unavailableClusterScheme = unavailableClusterScheme;
37 }
38
39 /***
40 * Constructor accepting the {@link ClusterScheme} that is unavailable, message and root cause
41 *
42 * @param message
43 * @param cause
44 */
45 public ClusterSchemeNotAvailableException(ClusterScheme unavailableClusterScheme, String message, Throwable cause) {
46 super(message, cause);
47 this.unavailableClusterScheme = unavailableClusterScheme;
48 }
49
50 /***
51 * Constructor accepting the {@link ClusterScheme} that is unavailable and message
52 *
53 * @param message
54 */
55 public ClusterSchemeNotAvailableException(ClusterScheme unavailableClusterScheme, String message) {
56 super(message);
57 this.unavailableClusterScheme = unavailableClusterScheme;
58 }
59
60 /***
61 * Constructor accepting the {@link ClusterScheme} that is unavailable and root cause
62 *
63 * @param cause
64 */
65 public ClusterSchemeNotAvailableException(ClusterScheme unavailableClusterScheme, Throwable cause) {
66 super(cause);
67 this.unavailableClusterScheme = unavailableClusterScheme;
68 }
69
70 /***
71 * Return the unavailable ClusterScheme this instance is associated with
72 *
73 * @return Returns the unavailable ClusterScheme this instance is associated with
74 */
75 public ClusterScheme getUnavailableClusterScheme() {
76 return unavailableClusterScheme;
77 }
78
79 }