Package org.apache.tuscany.sca.core.assembly.impl

Examples of org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl


    @Override
    public Endpoint createEndpoint() {
        // Create an instance of EndpointImpl that can be serialized/deserialized using the Tuscany
        // runtime extension points and extensions
        return new RuntimeEndpointImpl(registry);
    }
View Full Code Here


        Object[] args = JSONUtil.decodePayloadForOperation(jsonParams, operation);
        Message msg = new MessageImpl();
        msg.getHeaders().put(Constants.MESSAGE_ID, channel.getId());
        msg.setBody(args);
        EndpointReference re = new RuntimeEndpointReferenceImpl();
        RuntimeEndpointImpl callbackEndpoint = new RuntimeEndpointImpl();
        callbackEndpoint.setURI(request.getOperation());
        re.setCallbackEndpoint(callbackEndpoint);
        msg.setFrom(re);
        endpoint.invoke(operation, msg);
    }
View Full Code Here

        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());
View Full Code Here

    private Message createMessageWithMockedCometReference(Object[] args, String sessionId, String callbackMethod) {
        Message msg = new MessageImpl();
        msg.getHeaders().put(Constants.MESSAGE_ID, sessionId);
        msg.setBody(args);
        EndpointReference re = new RuntimeEndpointReferenceImpl();
        RuntimeEndpointImpl callbackEndpoint = new RuntimeEndpointImpl();
        callbackEndpoint.setURI(callbackMethod);
        re.setCallbackEndpoint(callbackEndpoint);
        msg.setFrom(re);
        return msg;
    }
View Full Code Here

        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());
View Full Code Here

                                                                       new Contribution("test", contributionLocation));
        node.start();
       
        try {           
           
            RuntimeEndpointImpl endpoint = (RuntimeEndpointImpl)node.getDomainComposite().getComponents().get(0).getServices().get(0).getEndpoints().get(0);
            WSDLInterface wsdlInterface = (WSDLInterface)endpoint.getBindingInterfaceContract().getInterface();
           
            WSDLDefinition wsdlDefinition = wsdlInterface.getWsdlDefinition();
            Definition definition = wsdlDefinition.getDefinition();
           
            // write out a flattened WSDL along with XSD
            ByteArrayOutputStream outStream = new ByteArrayOutputStream();
            try {
                WSDLWriter writer = WSDLFactory.newInstance().newWSDLWriter();
                String baseURI = null;
                if (wsdlDefinition.getLocation() != null) {
                    baseURI = wsdlDefinition.getLocation().toString();
                } else {
                    baseURI = "GeneratedWSDL";
                }
                outStream.write(baseURI.getBytes());
                outStream.write(separator);           
                writer.writeWSDL(definition, outStream);
                for (WSDLDefinition importedWSDLDefintion : wsdlDefinition.getImportedDefinitions()){
                    outStream.write(separator);
                    baseURI = importedWSDLDefintion.getLocation().toString();
                    outStream.write(baseURI.getBytes());
                    outStream.write(separator);
                    writer.writeWSDL(importedWSDLDefintion.getDefinition(), outStream);
                }
                for (XSDefinition xsdDefinition : wsdlDefinition.getXmlSchemas()){
                    // we store a reference to the schema schema. We don't need to write that out.
                    // also ignore schema that are extract from the original WSDL (have in their location)
                    if (!xsdDefinition.getNamespace().equals("http://www.w3.org/2001/XMLSchema") &&
                        xsdDefinition.getSchema() != null){
                        writeSchema(outStream, xsdDefinition.getSchema());
                    }
                }          
            } catch (Exception e){
                throw new RuntimeException(e);
            }
   
            String wsdlString = outStream.toString();
            //System.out.println(wsdlString);
           
            // Read the WSDL and XSD back in from the string
            String xmlArray[] = wsdlString.split("_X_");
            String topWSDLLocation = null;
            Map<String, XMLString> xmlMap = new HashMap<String, XMLString>();
           
            for (int i = 0; i < xmlArray.length; i = i + 2){
                String location = xmlArray[i];
                String xml = xmlArray[i+1];
                // strip the file name out of the location
                location = location.substring(location.lastIndexOf("/") + 1);
               
                if (location.endsWith(".wsdl")){
                    xmlMap.put(location,
                               new WSDLInfo(xmlArray[i],
                                              xml));
                   
                    if (topWSDLLocation == null){
                        topWSDLLocation = location;
                    }
                } else {
                    xmlMap.put(location,
                            new XSDInfo(xmlArray[i],
                                          xml));
                }
            }
           
            ExtensionPointRegistry registry = endpoint.getCompositeContext().getExtensionPointRegistry();
            FactoryExtensionPoint modelFactories = registry.getExtensionPoint(FactoryExtensionPoint.class);
            org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory wsdlFactory = modelFactories.getFactory(org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory.class);
            XSDFactory xsdFactory = modelFactories.getFactory(XSDFactory.class);
            XmlSchemaCollection schemaCollection = new XmlSchemaCollection();
            schemaCollection.setSchemaResolver(new XSDURIResolverImpl(xmlMap));
View Full Code Here

    @Override
    public Endpoint createEndpoint() {
        // Create an instance of EndpointImpl that can be serialized/deserialized using the Tuscany
        // runtime extension points and extensions
        return new RuntimeEndpointImpl(registry);
    }
View Full Code Here

    @Override
    public Endpoint createEndpoint() {
        // Create an instance of EndpointImpl that can be serialized/deserialized using the Tuscany
        // runtime extension points and extensions
        return new RuntimeEndpointImpl(registry);
    }
View Full Code Here

        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());
View Full Code Here

    @Override
    public Endpoint createEndpoint() {
        // Create an instance of EndpointImpl that can be serialized/deserialized using the Tuscany
        // runtime extension points and extensions
        return new RuntimeEndpointImpl(registry);
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl

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.