/* * 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.sca.interfacedef; /** * The InterfaceContractMapper is responsible to match interfaces * * @version $Rev$ $Date$ */ public interface InterfaceContractMapper { /** * Check the compatibility of the source and the target interface contracts. *
* A wire may only connect a source to a target if the target implements an * interface that is compatible with the interface required by the source. * The source and the target are compatible if:
** Please note this test is not symmetric: the success of isCompatible(A, B) * does NOT imply isCompatible(B, A) * * @param source The source interface contract * @param target The target interface contract * @return true if the source contract can be supported by the target * contract */ boolean isCompatible(InterfaceContract source, InterfaceContract target); /** * @param source * @param target * @param ignoreCallback * @param silent * @return * @throws IncompatibleInterfaceContractException */ boolean checkCompatibility(InterfaceContract source, InterfaceContract target, boolean ignoreCallback, boolean silent) throws IncompatibleInterfaceContractException; /** * Test if the source data type is compatible with the target data type. The * compatibility is defined as follows. *