Package org.apache.tuscany.sca.interfacedef

Examples of org.apache.tuscany.sca.interfacedef.Operation


    private static class MockInterface extends InterfaceImpl implements Interface {
    }

    private static Operation newOperation(String name) {
        Operation operation = new OperationImpl();
        operation.setName(name);
        return operation;
    }
View Full Code Here


    public InvocationChain getInvocationChain(Operation operation) {
        InvocationChain cached = invocationChainMap.get(operation);
        if (cached == null) {
            for (InvocationChain chain : getInvocationChains()) {
                Operation op = chain.getSourceOperation();
               
                // We used to check compatibility here but this is now validated when the
                // chain is created. As the chain operations are the real interface types
                // they may be incompatible just because they are described in different
                // IDLs
                if (operation.getName().equals(op.getName())) {
                    invocationChainMap.put(operation, chain);
                    return chain;
                }
            }
            invocationChainMap.put(operation, null);
View Full Code Here

        List<InvocationChain> chainList = new ArrayList<InvocationChain>();
        if(sourceContract != null && targetContract != null) {
            RuntimeComponentReference reference = (RuntimeComponentReference)getReference();
            for (Operation operation : sourceContract.getInterface().getOperations()) {
                Operation targetOperation = interfaceContractMapper.map(targetContract.getInterface(), operation);
                if (targetOperation == null) {
                    throw new ServiceRuntimeException("No matching operation for " + operation.getName()
                        + " is found in reference "
                        + getComponent().getURI()
                        + "#"
View Full Code Here

    public void resetInterfaceInputTypes(Interface newInterface){
        for (int i = 0; i < getOperations().size(); i++) {
            // only remote interfaces only have a data type model defined
            // and in this case operations cannot be overloaded so match
            // operations by name
            Operation oldOperation = getOperations().get(i);
            Operation newOperation = null;

            for (Operation tmpOperation : newInterface.getOperations()){
                if (tmpOperation.getName().equals(oldOperation.getName())){
                    newOperation = tmpOperation;
                }
            }

            if (newOperation == null){
                break;
            }

            // set input types
            oldOperation.setInputType(newOperation.getInputType());

            // set wrapper
            if (newOperation.isWrapperStyle()) {
                oldOperation.setWrapperStyle(true);
                oldOperation.setWrapper(newOperation.getWrapper());
            }
        }
    }
View Full Code Here

    public void resetInterfaceOutputTypes(Interface newInterface){
        for (int i = 0; i < getOperations().size(); i++) {
            // only remote interfaces only have a data type model defined
            // and in this case operations cannot be overloaded so match
            // operations by name
            Operation oldOperation = getOperations().get(i);
            Operation newOperation = null;

            for (Operation tmpOperation : newInterface.getOperations()){
                if (tmpOperation.getName().equals(oldOperation.getName())){
                    newOperation = tmpOperation;
                }
            }

            if (newOperation == null){
                break;
            }

            // set output types
            oldOperation.setOutputType(newOperation.getOutputType());

            // set fault types
            oldOperation.setFaultTypes(newOperation.getFaultTypes());

            // set wrapper
            if (newOperation.isWrapperStyle()) {
                oldOperation.setWrapperStyle(true);
                oldOperation.setWrapper(newOperation.getWrapper());
            }
        }
    }
View Full Code Here

    @Override
    public Object clone() throws CloneNotSupportedException {
        InterfaceImpl copy = (InterfaceImpl)super.clone();
        copy.operations = new OperationList();
        for (Operation operation : this.operations) {
            Operation clonedOperation = (Operation)operation.clone();
            copy.operations.add(clonedOperation);
        }
        copy.attributes = new ConcurrentHashMap<Object, Object>();
        copy.attributes.putAll(attributes);
        return copy;
View Full Code Here

        if (source.getOperations().size() != target.getOperations().size()) {
            return false;
        }

        for (Operation operation : source.getOperations()) {
            Operation targetOperation = getOperation(target.getOperations(), operation.getName());
            if (targetOperation == null) {
                return false;
            }
            if (!isCompatible(operation, targetOperation, Compatibility.SUBSET)) {
                return false;
View Full Code Here

                return false;
            }
        }

        for (Operation operation : source.getInterface().getOperations()) {
            Operation targetOperation = map(target.getInterface(), operation);
            if (targetOperation == null) {
                if (!silent) {
                    audit.append("Operation " + operation.getName()+ " not found on target");
                    audit.appendSeperator();
                    throw new IncompatibleInterfaceContractException(
View Full Code Here

                return false;
            }
        }

        for (Operation operation : source.getCallbackInterface().getOperations()) {
            Operation targetOperation =
                getOperation(target.getCallbackInterface().getOperations(), operation.getName());
            if (targetOperation == null) {
                if (!silent) {
                    throw new IncompatibleInterfaceContractException("Callback operation not found on target", source,
                                                                     target, null, targetOperation);
View Full Code Here

        if (source.isRemotable() != target.isRemotable()) {
            return false;
        }

        for (Operation operation : source.getOperations()) {
            Operation targetOperation = getOperation(target.getOperations(), operation.getName());
            if (targetOperation == null) {
                return false;
            }
            if (!isCompatible(operation, targetOperation, Compatibility.SUBSET)) {
                return false;
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.interfacedef.Operation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.