Package org.apache.tuscany.sca.interfacedef

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


        if (wire != null) {
            ReferenceParameters parameters = wire.getSource().getReferenceParameters();
            this.callbackID = parameters.getCallbackID();
            this.callbackObject = parameters.getCallbackReference();
            this.conversationID = parameters.getConversationID();
            InterfaceContract contract = wire.getSource().getInterfaceContract();
            this.conversational = contract.getInterface().isConversational();
        }
    }
View Full Code Here


        try {
            resolve()
           
            // Use the interface contract of the reference on the component type
            Reference componentTypeRef = reference.getReference();
            InterfaceContract sourceContract =
                componentTypeRef == null ? reference.getInterfaceContract() : componentTypeRef.getInterfaceContract();
            sourceContract = sourceContract.makeUnidirectional(false);
            EndpointReference epr = new EndpointReferenceImpl(component, reference, binding, sourceContract);
            ReferenceParameters parameters = getReferenceParameters();
            epr.setReferenceParameters(parameters);
            return epr;
        } catch (Exception e) {
View Full Code Here

        //FIXME: it would be better to do this for all WSDLs to explictly control the
        // service and port that Axis will use, rather than just hoping the user has
        // placed a suitable service and/or port first in the WSDL.
        WSDLDefinitionHelper helper = new WSDLDefinitionHelper();
        if (wsBinding.getBinding() == null) {
            InterfaceContract ic = wsBinding.getBindingInterfaceContract();
            WSDLInterface wi = (WSDLInterface)ic.getInterface();
            Service service = helper.createService(wsdlDefinition, wi.getPortType());
            Binding binding = helper.createBinding(wsdlDefinition, wi.getPortType());
           
            Port port = helper.createPort(wsdlDefinition, binding, service, wsBinding.getURI());
            wsBinding.setService(service);
View Full Code Here

                                         MessageFactory messageFactory,
                                         Map<ClassLoader, List<PolicyHandlerTuple>> policyHandlerClassnames) {

        this.wsBinding = wsBinding;

        InterfaceContract contract = wsBinding.getBindingInterfaceContract();
        if (contract == null) {
            contract = reference.getInterfaceContract().makeUnidirectional(false);
            if ((contract instanceof JavaInterfaceContract)) {
                contract = Java2WSDLHelper.createWSDLInterfaceContract((JavaInterfaceContract)contract, Axis2ServiceBindingProvider.requiresSOAP12(wsBinding));
            }
            wsBinding.setBindingInterfaceContract(contract);
        }
       
        // TODO - fix up the conversational flag and operation sequences in case the contract has come from WSDL
        // as we don't yet support requires="conversational" or sca:endConversation annotations
        // in WSDL interface descriptions (see section 1.5.4 of the assembly spec V1.0)
        if ( reference.getInterfaceContract().getInterface() != null ) {
            contract.getInterface().setConversational(reference.getInterfaceContract().getInterface().isConversational());
   
            for (Operation operation : contract.getInterface().getOperations()){
                Operation referenceOperation = null;
               
                for (Operation tmpOp : reference.getInterfaceContract().getInterface().getOperations()){
                    if ( operation.getName().equals(tmpOp.getName())) {
                        referenceOperation = tmpOp;
                        break;
                    }
                }
               
                if (referenceOperation != null ){
                    operation.setConversationSequence(referenceOperation.getConversationSequence());
                }
            }       
        }

        // Set to use the Axiom data binding
        contract.getInterface().resetDataBinding(OMElement.class.getName());

        axisClient = new Axis2ServiceClient(component, reference, wsBinding, servletHost, messageFactory, policyHandlerClassnames);
    }
View Full Code Here

        }
       
        // Process annotations on the service interfaces
        //TODO This will have to move to a JavaInterface introspector later
        for (Service service: type.getServices()) {
            InterfaceContract interfaceContract = service.getInterfaceContract();
            if (interfaceContract instanceof JavaInterfaceContract) {
                JavaInterfaceContract javaInterfaceContract = (JavaInterfaceContract)interfaceContract;

                // Read intents on the service interface
                if (javaInterfaceContract.getInterface() != null) {
View Full Code Here

                                       MessageFactory messageFactory,
                                       Map<ClassLoader, List<PolicyHandlerTuple>> policyHandlerClassnames) {

        this.wsBinding = wsBinding;

        InterfaceContract contract = wsBinding.getBindingInterfaceContract();
        if (contract == null) {
            contract = service.getInterfaceContract().makeUnidirectional(false);
            if ((contract instanceof JavaInterfaceContract)) {
                contract = Java2WSDLHelper.createWSDLInterfaceContract((JavaInterfaceContract)contract, requiresSOAP12(wsBinding));
            }
            wsBinding.setBindingInterfaceContract(contract);
        }
       
        // TODO - fix up the conversational flag and operation sequences in case the contract has come from WSDL
        // as we don't yet support requires="conversational" or sca:endConversation annotations
        // in WSDL interface descriptions (see section 1.5.4 of the assembly spec V1.0)
        if (service.getInterfaceContract().getInterface() != null ) {
            contract.getInterface().setConversational(service.getInterfaceContract().getInterface().isConversational());
           
            for (Operation operation : contract.getInterface().getOperations()){
                Operation serviceOperation = null;
               
                for (Operation tmpOp : service.getInterfaceContract().getInterface().getOperations()){
                    if ( operation.getName().equals(tmpOp.getName())) {
                        serviceOperation = tmpOp;
                        break;
                    }
                }
               
                if (serviceOperation != null ){
                    operation.setConversationSequence(serviceOperation.getConversationSequence());
                }
            }
        }

       
        // Set to use the Axiom data binding
        contract.getInterface().resetDataBinding(OMElement.class.getName());

        axisProvider = new Axis2ServiceProvider(component, service, wsBinding, servletHost, messageFactory, policyHandlerClassnames);
    }
View Full Code Here

            RuntimeComponentReference reference = (RuntimeComponentReference)assemblyFactory.createComponentReference();
            reference.setName("default");
            ModelFactoryExtensionPoint factories =
                runtime.getExtensionPointRegistry().getExtensionPoint(ModelFactoryExtensionPoint.class);
            JavaInterfaceFactory javaInterfaceFactory = factories.getFactory(JavaInterfaceFactory.class);
            InterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
            interfaceContract.setInterface(javaInterfaceFactory.createJavaInterface(businessInterface));
            reference.setInterfaceContract(interfaceContract);
            component.getReferences().add(reference);
            reference.setComponent(component);
            SCABindingFactory scaBindingFactory = factories.getFactory(SCABindingFactory.class);
            SCABinding binding = scaBindingFactory.createSCABinding();
View Full Code Here

        if (isCallback && callInterface == null)
            return this; // already a unidirectional callback interface contract

        // contract is bidrectional, so create a new unidirectional contract       
        try {
            InterfaceContract newContract = clone();
            if (!isCallback) {
                newContract.setCallbackInterface(null); // create unidirectional forward interface contract
            } else {
                newContract.setInterface(null); // create unidirectional callback interface contract
            }
            return newContract;
        } catch (CloneNotSupportedException e) {
            // will not happen
            return null;
View Full Code Here

            throw new ObjectCreationException(e);
        }

        // set the databinding and xmlhelper for wsdl interfaces
        for (Service service : rc.getServices()) {
            InterfaceContract ic = service.getInterfaceContract();
            if (ic instanceof WSDLInterfaceContract) {
                // Set to use the Axiom data binding
                ic.getInterface().resetDataBinding(OMElement.class.getName());
                xmlHelper = XMLHelper.getArgHelper(scriptEngine);
            }
        }
    }
View Full Code Here

public class ContractCompatibilityTestCase extends TestCase {

    private InterfaceContractMapper mapper = new InterfaceContractMapperImpl();

    public void testNoOperation() throws Exception {
        InterfaceContract source = new MockContract("FooContract");
        InterfaceContract target = new MockContract("FooContract");
        mapper.checkCompatibility(source, target, false, false);
    }
View Full Code Here

TOP

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

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.