Package org.apache.tuscany.sca.assembly

Examples of org.apache.tuscany.sca.assembly.Binding


            //by calling the getInvocationChain
            ((RuntimeEndpointReference) epr).getInvocationChains();
            targetEndpoint = epr.getTargetEndpoint();
        }

        Binding binding = targetEndpoint.getBinding();

        URI targetURI = URI.create(binding.getURI());
        String targetPath = targetURI.getPath();

        return "tuscany.AtomService(\"" + targetPath + "\")";
    }
View Full Code Here


                    // otherwise take a copy of all the bindings on the forward service
                    // at runtime a callback binding will be selected based on the forward call
                    List<Binding> serviceBindings = service.getBindings();
                    for ( Binding serviceBinding: serviceBindings ) {
                      try {
              Binding referenceBinding = (Binding)serviceBinding.clone();
              referenceBinding.setURI(null);
              callbackReference.getBindings().add(referenceBinding);
            } catch (CloneNotSupportedException e) {
              // will not happen
            } // end try
                    } // end for
View Full Code Here

                    callbackService.getBindings().addAll(reference.getCallback().getBindings());
                } else if (reference.getBindings().size() > 0) {
                    // use any bindings explicitly declared on the forward reference
                    for (Binding binding : reference.getBindings()) {
                        try {
                            Binding clonedBinding = (Binding)binding.clone();
                            // binding uri will be calculated during runtime build
                            clonedBinding.setURI(null);
                            callbackService.getBindings().add(clonedBinding);
                        } catch (CloneNotSupportedException ex) {

                        }
                    }
View Full Code Here

        }

        try {
            if (processor != null) {
                // Futher check if the provider is present
                Binding bindingTemplate = createDelegatingBinding(binding);
                ProviderFactory<?> providerFactory = providerFactories.getProviderFactory(bindingTemplate.getClass());
                if (providerFactory == null) {
                    // logger.warning("Mapped binding for binding.sca is not supported: " + binding);
                    processor = null;
                    return false;
                }
View Full Code Here

            ep = (RuntimeEndpoint)endpoint.clone();
        } catch (Exception ex) {
            // we know we can clone endpoint references
        }

        Binding binding = map(endpoint.getBinding(), bindingType);
        ep.setBinding(binding);
        BindingBuilder builder = getBindingBuilder(bindingType);
        if (builder != null) {
            builder.build(ep.getComponent(), ep.getService(), binding, new BuilderContext(registry), false);
        }
View Full Code Here

            epr = (RuntimeEndpointReference)endpointReference.clone();
        } catch (Exception ex) {
            // we know we can clone endpoint references
        }

        Binding binding = map(endpointReference.getBinding(), bindingType);
        epr.setBinding(binding);

        // epr.setTargetEndpoint(map((RuntimeEndpoint)epr.getTargetEndpoint()));

        BindingBuilder builder = getBindingBuilder(bindingType);
View Full Code Here

        return epr;
    }

    protected Binding map(Binding scaBinding, QName newBindingType) {
        try {
            Binding binding = createDelegatingBinding(newBindingType);
            binding.setName(scaBinding.getName());
            binding.setURI(scaBinding.getURI());
            binding.setOperationSelector(scaBinding.getOperationSelector());
            binding.setRequestWireFormat(scaBinding.getRequestWireFormat());
            binding.setResponseWireFormat(scaBinding.getResponseWireFormat());
            if (binding instanceof PolicySubject && scaBinding instanceof PolicySubject) {
                PolicySubject subject1 = (PolicySubject)binding;
                PolicySubject subject2 = (PolicySubject)scaBinding;
                subject1.getPolicySets().addAll(subject2.getPolicySets());
                subject1.getRequiredIntents().addAll(subject2.getRequiredIntents());
View Full Code Here

            .append("\"/>");

        StAXHelper staxHelper = StAXHelper.getInstance(registry);
        XMLStreamReader reader = staxHelper.createXMLStreamReader(new StringReader(xml.toString()));
        reader.nextTag();
        Binding binding = (Binding)processor.read(reader, new ProcessorContext(registry));

        return binding;
    }
View Full Code Here

        Map<String, Binding> componentTypeContractBindings = new HashMap<String, Binding>();
        for (Binding binding : componentTypeContract.getBindings()) {
            componentTypeContractBindings.put(binding.getName(), binding);
        }
        for (Binding binding : componentContract.getBindings()) {
            Binding componentTypeBinding = componentTypeContractBindings.get(binding.getName());
            if (binding instanceof PolicySubject &&
                componentTypeBinding instanceof PolicySubject) {
                configure((PolicySubject)binding, (PolicySubject)componentTypeBinding, Intent.Type.interaction, context);
            }
        }
View Full Code Here

   
        // System.out.println("MATCH AUDIT:" + matchAudit.toString());
    }      
       
    private void processUnknownEndpoint(EndpointReference endpointReference, Audit matchAudit){
        Binding b = null;
        if (unknownEndpointHandler != null) {
            b = unknownEndpointHandler.handleUnknownEndpoint(endpointReference);
        }
        if (b != null) {
            Endpoint matchedEndpoint = new RuntimeEndpointImpl(extensionPoints);
            matchedEndpoint.setBinding(b);
            matchedEndpoint.setRemote(true);
            endpointReference.setTargetEndpoint(matchedEndpoint);
            endpointReference.setBinding(b);
            endpointReference.setUnresolved(false);
            endpointReference.setStatus(EndpointReference.Status.WIRED_TARGET_FOUND_AND_MATCHED);
            matchAudit.append("Match because the UnknownEndpointHandler provided a binding: " + b.getType() + " uri: " + b.getURI());
            matchAudit.appendSeperator();
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.assembly.Binding

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.