summaryrefslogtreecommitdiffstats
path: root/sca-java-1.x/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/IncompatibleInterfacesException.java
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-1.x/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/IncompatibleInterfacesException.java')
-rw-r--r--sca-java-1.x/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/IncompatibleInterfacesException.java93
1 files changed, 93 insertions, 0 deletions
diff --git a/sca-java-1.x/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/IncompatibleInterfacesException.java b/sca-java-1.x/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/IncompatibleInterfacesException.java
new file mode 100644
index 0000000000..4b94983c34
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/IncompatibleInterfacesException.java
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.core.builder;
+
+import org.apache.tuscany.spi.builder.WiringException;
+import org.apache.tuscany.spi.wire.InboundWire;
+import org.apache.tuscany.spi.wire.OutboundWire;
+
+/**
+ * Denotes an attempt to wire incompatible interfaces
+ *
+ * @version $Rev$ $Date$
+ */
+public class IncompatibleInterfacesException extends WiringException {
+
+
+ public IncompatibleInterfacesException(String message,
+ String sourceName,
+ String referenceName,
+ String targetName,
+ String targetServiceName) {
+ super(message);
+ setSourceName(sourceName);
+ setReferenceName(referenceName);
+ setTargetName(targetName);
+ setTargetServiceName(targetServiceName);
+ }
+
+ public IncompatibleInterfacesException(String message, String sourceName,
+ String referenceName,
+ String targetName,
+ String serviceName,
+ Throwable cause) {
+ super(message, cause);
+ setSourceName(sourceName);
+ setReferenceName(referenceName);
+ setTargetName(targetName);
+ setTargetServiceName(serviceName);
+ }
+
+ public IncompatibleInterfacesException(InboundWire source, OutboundWire target) {
+ super("Incompatible source and target interfaces");
+ setTargetServiceName(source.getServiceName());
+ if (source.getContainer() != null) {
+ setSourceName(source.getContainer().getName());
+ }
+ setReferenceName(target.getReferenceName());
+ if (target.getContainer() != null) {
+ setTargetName(target.getContainer().getName());
+ }
+ }
+
+ public IncompatibleInterfacesException(OutboundWire source, InboundWire target) {
+ super("Incompatible source and target interfaces");
+ setTargetServiceName(target.getServiceName());
+ if (source.getContainer() != null) {
+ setSourceName(source.getContainer().getName());
+ }
+ setReferenceName(source.getReferenceName());
+ if (target.getContainer() != null) {
+ setTargetName(target.getContainer().getName());
+ }
+ }
+
+ public IncompatibleInterfacesException(OutboundWire source, InboundWire target, Throwable throwable) {
+ super("Incompatible source and target interfaces", throwable);
+ setTargetServiceName(target.getServiceName());
+ if (source.getContainer() != null) {
+ setSourceName(source.getContainer().getName());
+ }
+ setReferenceName(source.getReferenceName());
+ if (target.getContainer() != null) {
+ setTargetName(target.getContainer().getName());
+ }
+ }
+
+}