summaryrefslogtreecommitdiffstats
path: root/jdisc_core/src/main/java/com/yahoo/jdisc/service/BindingSetNotFoundException.java
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@yahoo-inc.com>2016-06-15 23:09:44 +0200
committerJon Bratseth <bratseth@yahoo-inc.com>2016-06-15 23:09:44 +0200
commit72231250ed81e10d66bfe70701e64fa5fe50f712 (patch)
tree2728bba1131a6f6e5bdf95afec7d7ff9358dac50 /jdisc_core/src/main/java/com/yahoo/jdisc/service/BindingSetNotFoundException.java
Publish
Diffstat (limited to 'jdisc_core/src/main/java/com/yahoo/jdisc/service/BindingSetNotFoundException.java')
-rw-r--r--jdisc_core/src/main/java/com/yahoo/jdisc/service/BindingSetNotFoundException.java38
1 files changed, 38 insertions, 0 deletions
diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/service/BindingSetNotFoundException.java b/jdisc_core/src/main/java/com/yahoo/jdisc/service/BindingSetNotFoundException.java
new file mode 100644
index 00000000000..b02fab2eba8
--- /dev/null
+++ b/jdisc_core/src/main/java/com/yahoo/jdisc/service/BindingSetNotFoundException.java
@@ -0,0 +1,38 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package com.yahoo.jdisc.service;
+
+import com.yahoo.jdisc.application.BindingSet;
+
+import java.net.URI;
+
+/**
+ * This exception is used to signal that a named {@link BindingSet} was not found. An instance of this class will be
+ * thrown by the {@link CurrentContainer#newReference(URI)} method when a BindingSet with the specified name does not
+ * exist.
+ *
+ * @author <a href="mailto:simon@yahoo-inc.com">Simon Thoresen</a>
+ */
+public final class BindingSetNotFoundException extends RuntimeException {
+
+ private final String bindingSet;
+
+ /**
+ * Constructs a new instance of this class with a detail message that contains the name of the {@link BindingSet}
+ * that was not found.
+ *
+ * @param bindingSet The name of the {@link BindingSet} that was not found.
+ */
+ public BindingSetNotFoundException(String bindingSet) {
+ super("No binding set named '" + bindingSet + "'.");
+ this.bindingSet = bindingSet;
+ }
+
+ /**
+ * Returns the name of the {@link BindingSet} that was not found.
+ *
+ * @return The name of the BindingSet.
+ */
+ public String bindingSet() {
+ return bindingSet;
+ }
+}