Package org.apache.tuscany.sca.interfacedef

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


    }

    protected void setXMLDataBinding(RuntimeComponentService service) {
        if (service.getInterfaceContract() != null) {
            try {
                InterfaceContract ic = (InterfaceContract)service.getInterfaceContract().clone();

                Interface ii = (Interface)ic.getInterface().clone();
                ii.resetDataBinding("org.apache.axiom.om.OMElement");
                ic.setInterface(ii);
                service.setInterfaceContract(ic);

            } catch (CloneNotSupportedException e) {
                throw new RuntimeException(e);
            }
View Full Code Here


    }

    protected void setXMLDataBinding(RuntimeComponentReference reference) {
        try {
            InterfaceContract ic = (InterfaceContract)reference.getInterfaceContract().clone();

            Interface ii = (Interface)ic.getInterface().clone();
            ii.resetDataBinding("org.apache.axiom.om.OMElement");
            ic.setInterface(ii);
            reference.setInterfaceContract(ic);

        } catch (CloneNotSupportedException e) {
            throw new RuntimeException(e);
        }
View Full Code Here

        componentReference.setCallback(service.getCallback());
        componentReference.getTargets().add(service);
        componentReference.getPolicySets().addAll(service.getPolicySets());
        componentReference.getRequiredIntents().addAll(service.getRequiredIntents());

        InterfaceContract interfaceContract = service.getInterfaceContract();
        Service componentTypeService = service.getService();
        if (componentTypeService != null && componentTypeService.getInterfaceContract() != null) {
            interfaceContract = componentTypeService.getInterfaceContract();
        }
        interfaceContract = getInterfaceContract(interfaceContract, businessInterface);
View Full Code Here

                                                            RuntimeComponentReference reference,
                                                            RuntimeComponent component,
                                                            RuntimeComponentService service)
        throws CloneNotSupportedException, InvalidInterfaceException {
        RuntimeComponentReference ref = (RuntimeComponentReference)reference.clone();
        InterfaceContract interfaceContract = reference.getInterfaceContract();
        Reference componentTypeReference = reference.getReference();
        if (componentTypeReference != null && componentTypeReference.getInterfaceContract() != null) {
            interfaceContract = componentTypeReference.getInterfaceContract();
        }
        InterfaceContract refInterfaceContract = getInterfaceContract(interfaceContract, businessInterface);
        if (refInterfaceContract != interfaceContract) {
            ref = (RuntimeComponentReference)reference.clone();
            ref.setInterfaceContract(interfaceContract);
        }
        ref.setComponent(component);
View Full Code Here

        this.reference = reference;
        this.binding = binding.getSCABinding();
        wsBinding = (new DefaultWebServiceBindingFactory()).createWebServiceBinding();
      
        // Turn the java interface contract into a wsdl interface contract
        InterfaceContract contract = reference.getInterfaceContract();
        if ((contract instanceof JavaInterfaceContract)) {
            contract = Java2WSDLHelper.createWSDLInterfaceContract((JavaInterfaceContract)contract);
        }
       
        // Set to use the Axiom data binding
        contract.getInterface().resetDataBinding(OMElement.class.getName());
       
        wsBinding.setBindingInterfaceContract(contract);
        wsBinding.setName(this.binding.getName());        
              
        axisReferenceBindingProvider = new Axis2ReferenceBindingProvider(component,
View Full Code Here

       this.nodeFactory = nodeFactory;
        this.binding = binding.getSCABinding();
        wsBinding = (new DefaultWebServiceBindingFactory()).createWebServiceBinding();
       
        // Turn the java interface contract into a wsdl interface contract
        InterfaceContract contract = service.getInterfaceContract();
        if ((contract instanceof JavaInterfaceContract)) {
            contract = Java2WSDLHelper.createWSDLInterfaceContract((JavaInterfaceContract)contract);
        }
       
        // Set to use the Axiom data binding
        contract.getInterface().resetDataBinding(OMElement.class.getName());
       
        wsBinding.setBindingInterfaceContract(contract);
        wsBinding.setName(this.binding.getName());
        wsBinding.setURI(this.binding.getURI());
       
View Full Code Here

                                         Binding refBinding,
                                         Component serviceComponent,
                                         ComponentService service,
                                         Binding serviceBinding) {
        RuntimeComponentReference runtimeRef = (RuntimeComponentReference)reference;
        InterfaceContract bindingContract = getInterfaceContract(reference, refBinding);

        // 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 wireSource =
            new EndpointReferenceImpl((RuntimeComponent)refComponent, reference, refBinding, sourceContract);
        ComponentService callbackService = reference.getCallbackService();
        if (callbackService != null) {
            // select a reference callback binding to pass with invocations on this wire
            Binding callbackBinding = null;
            for (Binding binding : callbackService.getBindings()) {
                // first look for a callback binding whose name matches the reference binding name
              if (refBinding.getName().startsWith(binding.getName())) {
                    callbackBinding = binding;
                    break;
                }
            }
            // if no callback binding found, try again based on reference binding type
            if (callbackBinding == null) {
                callbackBinding = callbackService.getBinding(refBinding.getClass());
            }
            InterfaceContract callbackContract = callbackService.getInterfaceContract();
            EndpointReference callbackEndpoint =
                new EndpointReferenceImpl((RuntimeComponent)refComponent, callbackService, callbackBinding,
                                          callbackContract);
            wireSource.setCallbackEndpoint(callbackEndpoint);
        }
View Full Code Here

     * @param reference
     * @param binding
     * @return
     */
    private InterfaceContract getInterfaceContract(ComponentReference reference, Binding binding) {
        InterfaceContract interfaceContract = reference.getInterfaceContract();
        ReferenceBindingProvider provider = ((RuntimeComponentReference)reference).getBindingProvider(binding);
        if (provider != null) {
            InterfaceContract bindingContract = provider.getBindingInterfaceContract();
            if (bindingContract != null) {
                interfaceContract = bindingContract;
            }
        }
        return interfaceContract.makeUnidirectional(false);
View Full Code Here

     * @param service
     * @param binding
     * @return
     */
    private InterfaceContract getInterfaceContract(ComponentService service, Binding binding) {
        InterfaceContract interfaceContract = service.getInterfaceContract();

        ServiceBindingProvider provider = ((RuntimeComponentService)service).getBindingProvider(binding);
        if (provider != null) {
            InterfaceContract bindingContract = provider.getBindingInterfaceContract();
            if (bindingContract != null) {
                interfaceContract = bindingContract;
            }
        }
        return interfaceContract.makeUnidirectional(false);
View Full Code Here

        // FIXME: [rfeng] We might need a better way to get the impl interface contract
        Service targetService = service.getService();
        if (targetService == null) {
            targetService = service;
        }
        InterfaceContract targetContract = targetService.getInterfaceContract().makeUnidirectional(false);

        InterfaceContract sourceContract = getInterfaceContract(service, serviceBinding);

        EndpointReference wireSource = new EndpointReferenceImpl(null, null, serviceBinding, sourceContract);

        EndpointReference wireTarget =
            new EndpointReferenceImpl((RuntimeComponent)serviceComponent, (RuntimeComponentService)service,
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.