Examples of JavaInterface


Examples of org.apache.tuscany.sca.interfacedef.java.JavaInterface

    }

    @Test
    public void testWrapper() throws Exception {
        DefaultJavaInterfaceFactory iFactory = new DefaultJavaInterfaceFactory(registry);
        JavaInterface contract = iFactory.createJavaInterface(StockExceptionTest.class);

        // interfaceProcessor.visitInterface(contract);
        Operation op = contract.getOperations().get(0);
        Assert.assertTrue(!op.isWrapperStyle());
        Assert.assertEquals(new QName("http://www.example.com/stock", "stockQuoteOffer"), op.getWrapper().getInputWrapperElement().getQName());
        Assert.assertEquals(new QName("http://www.example.com/stock", "stockQuoteOfferResponse"), op.getWrapper().getOutputWrapperElement().getQName());
    }
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.java.JavaInterface

     * {@link org.apache.tuscany.sca.interfacedef.java.jaxws.JAXWSJavaInterfaceProcessor#visitInterface(JavaInterface)}.
     */
    @Test
    public final void testProcessor() throws Exception {
        DefaultJavaInterfaceFactory iFactory = new DefaultJavaInterfaceFactory(registry);
        JavaInterface contract = iFactory.createJavaInterface(WebServiceInterfaceWithoutAnnotation.class);

        // interfaceProcessor.visitInterface(contract);
        assertFalse(contract.isRemotable());

        contract = iFactory.createJavaInterface(WebServiceInterfaceWithAnnotation.class);
        // interfaceProcessor.visitInterface(contract);
        assertTrue(contract.isRemotable());

        Operation op1 = contract.getOperations().get(0);
        Operation op2 = contract.getOperations().get(1);

        Operation op = null;
        if ("m1".equals(op1.getName())) {
            op = op1;
        } else {
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.java.JavaInterface

        RuntimeComponentService service = (RuntimeComponentService) to.getContract();
        RuntimeComponentReference callbackReference = (RuntimeComponentReference)service.getCallbackReference();
        if (callbackReference == null) {
            return null;
        }
        JavaInterface javaInterface = (JavaInterface) callbackReference.getInterfaceContract().getInterface();
        Class<CB> javaClass = (Class<CB>)javaInterface.getJavaClass();
        List<RuntimeWire> wires = callbackReference.getRuntimeWires();
        CallbackReferenceImpl ref = new CallbackReferenceImpl(javaClass, proxyFactory, wires);
        ref.resolveTarget();
        ReferenceParameters parameters = msgContext.getFrom().getReferenceParameters();
        ref.attachCallbackID(parameters.getCallbackID());
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.java.JavaInterface

        // Set the name for the service
        service.setName(name);

        // Set the call interface and, if present, the callback interface
        JavaInterface callInterface = javaFactory.createJavaInterface(interfaze);
        //setDataBindingForInterface(callInterface, DataObject.class.getName());
        service.getInterfaceContract().setInterface(callInterface);
        if (callInterface.getCallbackClass() != null) {
            JavaInterface callbackInterface = javaFactory.createJavaInterface(callInterface.getCallbackClass());
            //setDataBindingForInterface(callbackInterface, DataObject.class.getName());
            service.getInterfaceContract().setCallbackInterface(callbackInterface);
        }
        return service;
    } // end method createService
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.java.JavaInterface

        // to 1..1 - for XQuery implementations, this is the only multiplicity supported
        reference.setName(name);
        reference.setMultiplicity(Multiplicity.ONE_ONE);

        // Set the call interface and, if present, the callback interface
        JavaInterface callInterface = javaFactory.createJavaInterface(interfaze);
        reference.getInterfaceContract().setInterface(callInterface);
        if (callInterface.getCallbackClass() != null) {
            JavaInterface callbackInterface = javaFactory.createJavaInterface(callInterface.getCallbackClass());
            reference.getInterfaceContract().setCallbackInterface(callbackInterface);
        }

        return reference;
    }
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.java.JavaInterface

public class JavaInterfaceProcessorRegistryImplTestCase extends TestCase {
    private JavaInterfaceFactory factory;

    @SuppressWarnings("unchecked")
    public void testSimpleInterface() throws InvalidInterfaceException {
        JavaInterface intf = factory.createJavaInterface(Simple.class);

        assertEquals(Simple.class, intf.getJavaClass());
        List<Operation> operations = intf.getOperations();
        assertEquals(1, operations.size());
        Operation baseInt = operations.get(0);
        assertEquals("baseInt", baseInt.getName());

        QName element = new QName("http://impl.introspection.java.interfacedef.sca.tuscany.apache.org/", "return");
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.java.JavaInterface

        interfaceProcessor = new JAXWSJavaInterfaceProcessor(db, new JAXWSFaultExceptionMapper(db, xa), xa);
    }

    public void testWrapper() throws Exception {
        DefaultJavaInterfaceFactory iFactory = new DefaultJavaInterfaceFactory();
        JavaInterface contract = iFactory.createJavaInterface(StockExceptionTest.class);

        interfaceProcessor.visitInterface(contract);
        Operation op = contract.getOperations().get(0);
        Assert.assertTrue(!op.isWrapperStyle());
        Assert.assertEquals(new QName("http://www.example.com/stock", "stockQuoteOffer"), op.getWrapper().getInputWrapperElement().getQName());
        Assert.assertEquals(new QName("http://www.example.com/stock", "stockQuoteOfferResponse"), op.getWrapper().getOutputWrapperElement().getQName());
    }
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.java.JavaInterface

     * Test method for
     * {@link org.apache.tuscany.sca.interfacedef.java.jaxws.JAXWSJavaInterfaceProcessor#visitInterface(JavaInterface)}.
     */
    public final void testProcessor() throws Exception {
        DefaultJavaInterfaceFactory iFactory = new DefaultJavaInterfaceFactory();
        JavaInterface contract = iFactory.createJavaInterface(WebServiceInterfaceWithoutAnnotation.class);

        interfaceProcessor.visitInterface(contract);
        assertFalse(contract.isRemotable());

        contract = iFactory.createJavaInterface(WebServiceInterfaceWithAnnotation.class);
        interfaceProcessor.visitInterface(contract);
        assertTrue(contract.isRemotable());

        Operation op1 = contract.getOperations().get(0);
        Operation op2 = contract.getOperations().get(1);

        Operation op = null;
        if ("m1".equals(op1.getName())) {
            op = op1;
        } else {
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.java.JavaInterface

            return null;
        }
        if (interfaze instanceof WSDLInterface) {
            return ((WSDLInterface)interfaze).getWsdlDefinition().getDefinition();
        }
        JavaInterface iface = (JavaInterface)interfaze;
        if (!interfaze.isRemotable()) {
            fatal("InterfaceNotRemotable", interfaze, iface.getName());
        }
        QName name = getQName(iface);
        Definition definition = factory.newDefinition();
        if (requiresSOAP12) {
            definition.addNamespace("soap12", "http://schemas.xmlsoap.org/wsdl/soap12/");
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.java.JavaInterface

        // document.setDocumentURI("http://");
        return document;
    }

    protected QName getQName(Interface interfaze) {
        JavaInterface iface = (JavaInterface)interfaze;
        QName qname = iface.getQName();
        if (qname != null) {
            return qname;
        } else {
            Class<?> javaClass = iface.getJavaClass();
            return new QName(JavaXMLMapper.getNamespace(javaClass), javaClass.getSimpleName(), "tns");
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.