Package org.switchyard.metadata

Examples of org.switchyard.metadata.ServiceOperation


    public void testJavaClassExtendsClass() throws Exception {
        JavaService js = JavaService.fromClass(JavaClassExtendsClass.class);
        // There should be one operation
        Assert.assertEquals(1, js.getOperations().size());
        // meh() is InOnly
        ServiceOperation method = js.getOperation("blorg");
        Assert.assertNotNull(method);
    }
View Full Code Here


        final Class<?> intClass = JavaService.parseType(missingPrefix);
        Assert.assertEquals(null, intClass);
    }

    private void testOperationTypes(String opName, JavaService service, QName in, QName out, QName fault) {
        ServiceOperation operation = service.getOperation(opName);
        Assert.assertEquals(in, operation.getInputType());
        Assert.assertEquals(out, operation.getOutputType());
        Assert.assertEquals(fault, operation.getFaultType());
    }
View Full Code Here

        // There should be two operations
        Assert.assertEquals(2, wsdlService.getOperations().size());

        // method1 is InOnly
        ServiceOperation method1 = wsdlService.getOperation("helloWS");
        Assert.assertNotNull(method1);
        Assert.assertEquals(method1.getInputType(), METHOD1_INPUT);
        Assert.assertEquals(method1.getExchangePattern(), ExchangePattern.IN_ONLY);

        //method2 is InOut
        ServiceOperation method2 = wsdlService.getOperation("sayHello");
        Assert.assertNotNull(method2);
        Assert.assertEquals(method2.getInputType(), METHOD2_INPUT);
        Assert.assertEquals(method2.getOutputType(), METHOD2_OUTPUT);
        Assert.assertEquals(method2.getExchangePattern(), ExchangePattern.IN_OUT);
    }
View Full Code Here

        Assert.assertEquals("{urn:switchyard-metadata-wsdl}HelloWebService", wsdlService.getPortType().toString());
        // There should be two operations
        Assert.assertEquals(2, wsdlService.getOperations().size());

        // method is InOnly
        ServiceOperation method1 = wsdlService.getOperation("helloWS");
        Assert.assertNotNull(method1);
        Assert.assertEquals(METHOD3_INPUT, method1.getInputType());
        Assert.assertEquals(ExchangePattern.IN_ONLY, method1.getExchangePattern());
    }
View Full Code Here

        Assert.assertEquals("{urn:switchyard-metadata-wsdl}HelloWebService", wsdlService.getPortType().toString());
        // There should be two operations
        Assert.assertEquals(2, wsdlService.getOperations().size());

        // method is InOnly
        ServiceOperation method1 = wsdlService.getOperation("helloWS");
        Assert.assertNotNull(method1);
        Assert.assertEquals(METHOD3_INPUT, method1.getInputType());
        Assert.assertEquals(ExchangePattern.IN_ONLY, method1.getExchangePattern());
    }
View Full Code Here

        return createExchange(null, handler);
    }

    private Exchange createExchange(ExchangePattern pattern, ExchangeHandler handler) {
       
        ServiceOperation operation = _serviceOperation;
        ServiceReference reference;
       
        if (operation == null) {
            if (ExchangePattern.IN_ONLY.equals(pattern)) {
                operation = new InOnlyOperation(_operationName, _inputType);
View Full Code Here

        JavaService js = JavaService.fromClass(JavaInterface.class);
        // There should be two operations
        Assert.assertEquals(2, js.getOperations().size());
       
        // method1 is InOnly
        ServiceOperation method1 = js.getOperation("method1");
        Assert.assertNotNull(method1);
        Assert.assertEquals(method1.getInputType(), METHOD1_INPUT);
        Assert.assertEquals(method1.getExchangePattern(), ExchangePattern.IN_ONLY);
       
        //method2 is InOut
        ServiceOperation method2 = js.getOperation("method2");
        Assert.assertNotNull(method2);
        Assert.assertEquals(method2.getInputType(), METHOD2_INPUT);
        Assert.assertEquals(method2.getOutputType(), METHOD2_OUTPUT);
        Assert.assertEquals(method2.getExchangePattern(), ExchangePattern.IN_OUT);
    }
View Full Code Here

        }

        // At this stage, just pick the first service implementation we find and go with
        // it.  In the future, it would be nice if we could make this pluggable.
        Service service = services.get(0);
        ServiceOperation consumerOp = exchange.getContract().getConsumerOperation();
        ServiceOperation providerOp = service.getInterface().getOperation(consumerOp.getName());
       
        if (providerOp == null) {
            // try for a default operation
            if (service.getInterface().getOperations().size() == 1) {
                providerOp = service.getInterface().getOperations().iterator().next();
View Full Code Here

        }
    }
   
    private void initFaultTransformSequence(Exchange exchange) {
        QName exceptionTypeName = null;
        ServiceOperation providerOperation = exchange.getContract().getProviderOperation();
        ServiceOperation consumerOperation = exchange.getContract().getConsumerOperation();
        QName invokerFaultTypeName = consumerOperation.getFaultType();

        if (providerOperation != null) {
            exceptionTypeName = providerOperation.getFaultType();
        }
View Full Code Here

        return createExchange(operation, _handler);
    }

    @Override
    public Exchange createExchange(String operation, ExchangeHandler handler) {
        ServiceOperation op = _interface.getOperation(operation);
        if (op == null) {
            // try for a default operation
            if (ServiceInterface.DEFAULT_TYPE.equals(_interface.getType())) {
                op = _interface.getOperations().iterator().next();
            } else {
                throw RuntimeMessages.MESSAGES.operationDoesNotExistForService(operation,
                        _name.toString());
            }
        }

        Exchange ex = _dispatcher.createExchange(handler, op.getExchangePattern());
        ex.consumer(this, op);

        // propagate the security context
        _securityContextManager.propagateContext(ex);
View Full Code Here

TOP

Related Classes of org.switchyard.metadata.ServiceOperation

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.