Package org.apache.tuscany.sca.interfacedef.java

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


        JavaImplementation type = javaImplementationFactory.createJavaImplementation();
        Constructor<Mixed> ctor1 = Mixed.class.getConstructor(String.class, String.class, String.class);
        processor.visitConstructor(ctor1, type);

        AssemblyFactory assemblyFactory = new DefaultAssemblyFactory();
        JavaInterfaceFactory javaFactory = new DefaultJavaInterfaceFactory();
        ReferenceProcessor referenceProcessor = new ReferenceProcessor(assemblyFactory, javaFactory);
        PropertyProcessor propertyProcessor = new PropertyProcessor(assemblyFactory);
        JavaParameterImpl[] parameters = type.getConstructor().getParameters();
        for (int i = 0; i < parameters.length; i++) {
            referenceProcessor.visitConstructorParameter(parameters[i], type);
View Full Code Here


                                                                    List.class,
                                                                    Set.class,
                                                                    String[].class);
        processor.visitConstructor(ctor1, type);
        AssemblyFactory assemblyFactory = new DefaultAssemblyFactory();
        JavaInterfaceFactory javaFactory = new DefaultJavaInterfaceFactory();
        ReferenceProcessor referenceProcessor = new ReferenceProcessor(assemblyFactory, javaFactory);
        PropertyProcessor propertyProcessor = new PropertyProcessor(assemblyFactory);
        JavaParameterImpl[] parameters = type.getConstructor().getParameters();
        for (int i = 0; i < parameters.length; i++) {
            referenceProcessor.visitConstructorParameter(parameters[i], type);
View Full Code Here

        Constructor<Mixed> ctor1 = Mixed.class.getConstructor(String.class, String.class, String.class);
        processor.visitConstructor(ctor1, type);

        ExtensionPointRegistry registry = new DefaultExtensionPointRegistry();
        AssemblyFactory assemblyFactory = new DefaultAssemblyFactory(registry);
        JavaInterfaceFactory javaFactory = new DefaultJavaInterfaceFactory(registry);
        ReferenceProcessor referenceProcessor = new ReferenceProcessor(assemblyFactory, javaFactory);
        PropertyProcessor propertyProcessor = new PropertyProcessor(registry);
        JavaParameterImpl[] parameters = type.getConstructor().getParameters();
        for (int i = 0; i < parameters.length; i++) {
            referenceProcessor.visitConstructorParameter(parameters[i], type);
View Full Code Here

                                                                    Set.class,
                                                                    String[].class);
        processor.visitConstructor(ctor1, type);
        ExtensionPointRegistry registry = new DefaultExtensionPointRegistry();
        AssemblyFactory assemblyFactory = new DefaultAssemblyFactory();
        JavaInterfaceFactory javaFactory = new DefaultJavaInterfaceFactory(registry);
        ReferenceProcessor referenceProcessor = new ReferenceProcessor(assemblyFactory, javaFactory);
        PropertyProcessor propertyProcessor = new PropertyProcessor(registry);
        JavaParameterImpl[] parameters = type.getConstructor().getParameters();
        for (int i = 0; i < parameters.length; i++) {
            referenceProcessor.visitConstructorParameter(parameters[i], type);
View Full Code Here

        ExtensionPointRegistry registry = new DefaultExtensionPointRegistry();
        org.apache.tuscany.sca.core.FactoryExtensionPoint modelFactories = new DefaultFactoryExtensionPoint(registry);
        WSDLFactory wsdlFactory = modelFactories.getFactory(WSDLFactory.class);
        XSDFactory xsdFactory = modelFactories.getFactory(XSDFactory.class);
        DocumentBuilderFactory documentBuilderFactory = modelFactories.getFactory(DocumentBuilderFactory.class);
        JavaInterfaceFactory factory = new DefaultJavaInterfaceFactory(registry);
        JavaInterfaceContract javaIC = factory.createJavaInterfaceContract();
        JavaInterface iface = factory.createJavaInterface(HelloWorld.class);
        DefaultDataBindingExtensionPoint dataBindings = new DefaultDataBindingExtensionPoint(registry);
        JAXWSFaultExceptionMapper faultExceptionMapper = new JAXWSFaultExceptionMapper(dataBindings, null);
        new JAXWSJavaInterfaceProcessor(registry).visitInterface(iface);
        new DataBindingJavaInterfaceProcessor(registry).visitInterface(iface);
        javaIC.setInterface(iface);
        WSDLInterfaceContract wsdlIC = BindingWSDLGenerator.createWSDLInterfaceContract(javaIC, false, new XSDModelResolver(null, null), dataBindings, wsdlFactory, xsdFactory, documentBuilderFactory, null);
        assertNotNull(wsdlIC);
        WSDLInterface wsdlInterface = (WSDLInterface)wsdlIC.getInterface();
        assertNotNull(wsdlInterface);
        assertEquals(1, wsdlInterface.getOperations().size());
        assertEquals("sayHello", wsdlInterface.getOperations().get(0).getName());
        assertNotNull(wsdlInterface.getPortType());
        JavaInterfaceContract javaIC2 = factory.createJavaInterfaceContract();
        JavaInterface iface2 = factory.createJavaInterface(TestJavaInterface.class);
        new JAXWSJavaInterfaceProcessor(registry).visitInterface(iface2);
        new DataBindingJavaInterfaceProcessor(registry).visitInterface(iface2);
        javaIC2.setInterface(iface2);
        WSDLInterfaceContract wsdlIC2 = BindingWSDLGenerator.createWSDLInterfaceContract(javaIC2, false, new XSDModelResolver(null, null), dataBindings, wsdlFactory, xsdFactory, documentBuilderFactory, null);
        assertNotNull(wsdlIC2);
View Full Code Here

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

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

     * Test method for
     * {@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);
View Full Code Here

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

    public void start(ExtensionPointRegistry registry) {

        // Create the CRUD implementation factory
        ModelFactoryExtensionPoint factories = registry.getExtensionPoint(ModelFactoryExtensionPoint.class);
        AssemblyFactory assemblyFactory = factories.getFactory(AssemblyFactory.class);
        JavaInterfaceFactory javaFactory = new DefaultJavaInterfaceFactory();
        JavaInterfaceIntrospectorExtensionPoint visitors = registry.getExtensionPoint(JavaInterfaceIntrospectorExtensionPoint.class);
        JavaInterfaceIntrospector introspector = new ExtensibleJavaInterfaceIntrospector(javaFactory, visitors);
        CRUDImplementationFactory crudFactory = new DefaultCRUDImplementationFactory(assemblyFactory, javaFactory, introspector);

        // Add the CRUD implementation extension to the StAXArtifactProcessor
View Full Code Here

    public void start(ExtensionPointRegistry registry) {

        // Create the test  implementation factory
        ModelFactoryExtensionPoint factories = registry.getExtensionPoint(ModelFactoryExtensionPoint.class);
        AssemblyFactory assemblyFactory = factories.getFactory(AssemblyFactory.class);
        JavaInterfaceFactory javaFactory = new DefaultJavaInterfaceFactory();
        TestImplementationFactory testFactory = new DefaultTestImplementationFactory(assemblyFactory, javaFactory);
        factories.addFactory(testFactory);

        // Add the test implementation extension to the StAXArtifactProcessor
        // extension point
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory

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.