Package org.apache.tuscany.sca.interfacedef

Examples of org.apache.tuscany.sca.interfacedef.Operation


   
        List<Operation> operations = serviceContract.getInterface().getOperations();
            //componentService.getBindingProvider(binding).getBindingInterfaceContract().getInterface().getOperations();

       
        Operation result = null;
        for (Operation o : operations) {
            if (o.getName().equalsIgnoreCase(method)) {
                result = o;
                break;
            }
View Full Code Here


                    policyProcessor.readPolicies(callback, reader);

                } else if (OPERATION_QNAME.equals(name)) {

                    // Read an <operation>
                    Operation operation = assemblyFactory.createOperation();
                    operation.setName(getString(reader, NAME));
                    operation.setUnresolved(true);
                    if (callback != null) {
                        policyProcessor.readPolicies(callback, operation,
                                reader);
                    } else {
                        policyProcessor.readPolicies(contract, operation,
View Full Code Here

     * @throws Exception Failed
     */
    @Test
    public void testServiceWithOnlyOneOperationScaOperationNameNotSpecified() throws Exception {
        // Create the operation we should match
        final Operation expectedOperation = newOperation("myOperation");

        // Create the list of operations for the Service
        final List<Operation> operations = new ArrayList<Operation>();
        operations.add(expectedOperation);

View Full Code Here

     * @throws Exception Failed
     */
    @Test
    public void testServiceWithOnlyOneOperationScaOperationNameMatches() throws Exception {
        // Create the operation we should match
        final Operation expectedOperation = newOperation("myOperation");

        // Create the list of operations for the Service
        final List<Operation> operations = new ArrayList<Operation>();
        operations.add(expectedOperation);

        // The name of the Operation in the JMS Message - matches operation name
        final String scaOperationName = expectedOperation.getName();

        // Do the test
        doTestJMSBinding(expectedOperation, operations, scaOperationName);
    }
View Full Code Here

     * @throws Exception Failed
     */
    @Test
    public void testServiceWithOnlyOneOperationScaOperationNameDifferent() throws Exception {
        // Create the operation we should match
        final Operation expectedOperation = newOperation("myOperation");

        // Create the list of operations for the Service
        final List<Operation> operations = new ArrayList<Operation>();
        operations.add(expectedOperation);

View Full Code Here

        for (int i = 0; i < 5; i++) {
            operations.add(newOperation("operation" + i));
        }

        // Add the onMessage operation to the Service Contract
        final Operation onMessageOperation = newOperation("onMessage");
        operations.add(onMessageOperation);

        // The name of the Operation in the JMS Message is not set so it will attempt
        // to invoke the onMessage() method
        final String scaOperationName = null;
View Full Code Here

        // Get the invokers for the supported operations
        RuntimeComponentService componentService = (RuntimeComponentService) service;
        RuntimeWire wire = componentService.getRuntimeWire(binding);
        Servlet servlet = null;
        for (InvocationChain invocationChain : wire.getInvocationChains()) {
            Operation operation = invocationChain.getTargetOperation();
            String operationName = operation.getName();
            if (operationName.equals("get")) {
                Invoker getInvoker = invocationChain.getHeadInvoker();
                servlet = new HTTPGetListenerServlet(getInvoker, messageFactory);
                break;
            } else if (operationName.equals("service")) {
View Full Code Here

    protected Service createDynamicService() {
        Service dynamicService = assemblyFactory.createService();
        dynamicService.setName("$dynamic$");
        InterfaceContract dynamicInterfaceContract = new InterfaceContractImpl() {};
        Interface dynamicInterface = new DynamicInterfaceImpl();
        Operation dynamicOperation = new OperationImpl();
        dynamicOperation.setDynamic(true);
        dynamicInterface.getOperations().add(dynamicOperation);
        dynamicInterfaceContract.setInterface(dynamicInterface);
        dynamicService.setInterfaceContract(dynamicInterfaceContract);

        return dynamicService;
View Full Code Here

        this.wire = wire;
        this.messageFactory = messageFactory;
        this.mediator = mediator;

        // Get the invokers for the supported operations
        Operation getOperation = null;
        for (InvocationChain invocationChain : this.wire.getInvocationChains()) {
            invocationChain.setAllowsPassByReference(true);
            Operation operation = invocationChain.getTargetOperation();
            String operationName = operation.getName();
            if (operationName.equals("getFeed")) {
                getFeedInvoker = invocationChain.getHeadInvoker();
            } else if (operationName.equals("getAll")) {
                getAllInvoker = invocationChain.getHeadInvoker();
            } else if (operationName.equals("query")) {
View Full Code Here

        String operationName = requestMessageProcessor.getOperationName(requestJMSMsg);
        Object requestPayload = requestMessageProcessor.extractPayloadFromJMSMessage(requestJMSMsg);

        List<Operation> opList = service.getInterfaceContract().getInterface().getOperations();

        Operation operation = null;

        if (opList.size() == 1) {
            // SCA JMS Binding Specification - Rule 1.5.1 line 203
            operation = opList.get(0);
        } else if (operationName != null) {
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.interfacedef.Operation

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.