Package org.apache.tuscany.sca.assembly

Examples of org.apache.tuscany.sca.assembly.ConfiguredOperation


                                                 service.getRequiredIntents(),
                                                 service.getPolicySets());

                        // Read intents on the service interface methods
                        Method[] methods = javaInterface.getJavaClass().getMethods();
                        ConfiguredOperation confOp = null;
                        for (Method method: methods) {
                            if ( method.getAnnotation(Requires.class) != null  ||   
                                method.getAnnotation(PolicySets.class) != null ) {
                                confOp = assemblyFactory.createConfiguredOperation();
                                confOp.setName(method.getName());
                                confOp.setContractName(service.getName());
                           
                                service.getConfiguredOperations().add(confOp);
                                readIntents(method.getAnnotation(Requires.class), confOp.getRequiredIntents());
                                readPolicySets(method.getAnnotation(PolicySets.class), confOp.getPolicySets());
                            }
                        }
                    }
                   
                }
               
                // Read intents on the callback interface
                if (javaInterfaceContract.getCallbackInterface() != null) {
                    JavaInterface javaCallbackInterface = (JavaInterface)javaInterfaceContract.getCallbackInterface();
                    if (javaCallbackInterface.getJavaClass() != null) {
                        Callback callback = service.getCallback();
                        if (callback == null) {
                            callback = assemblyFactory.createCallback();
                            service.setCallback(callback);
                        }
                        readIntentsAndPolicySets(javaCallbackInterface.getJavaClass(),
                                                 callback.getRequiredIntents(),
                                                 callback.getPolicySets());

                        // Read intents on the callback interface methods
                        Method[] methods = javaCallbackInterface.getJavaClass().getMethods();
                        ConfiguredOperation confOp = null;
                        for (Method method: methods) {
                            confOp = assemblyFactory.createConfiguredOperation();
                            confOp.setName(method.getName());
                            callback.getConfiguredOperations().add(confOp);
                            readIntents(method.getAnnotation(Requires.class), confOp.getRequiredIntents());
                            readPolicySets(method.getAnnotation(PolicySets.class), confOp.getPolicySets());
                        }
                    }
                }
            }
        }
View Full Code Here


            if ( type instanceof OperationsConfigurator ) {
                //Read the intents specified on the given implementation method
                if ( (method.getAnnotation(Requires.class) != null ||
                        method.getAnnotation(PolicySets.class) != null ) &&
                            (type instanceof PolicySetAttachPoint )) {
                    ConfiguredOperation confOp = assemblyFactory.createConfiguredOperation();
                    confOp.setName(method.getName());
                    ((OperationsConfigurator)type).getConfiguredOperations().add(confOp);
           
               
                    readIntents(method.getAnnotation(Requires.class), confOp.getRequiredIntents());
                    readPolicySets(method.getAnnotation(PolicySets.class), confOp.getPolicySets());
                }
            }
        }
    }
View Full Code Here

        }

        // Read wsdlLocation
        wsBinding.setLocation(reader.getAttributeValue(WSDLI_NS, WSDL_LOCATION));

        ConfiguredOperation confOp = null;
        // Skip to end element
        while (reader.hasNext()) {
            int event = reader.next();
            switch (event) {
                case START_ELEMENT: {
View Full Code Here

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

        this.policyFactory = modelFactories.getFactory(PolicyFactory.class);
        this.policyProcessor = new PolicySubjectProcessor(policyFactory);
    }

    public ConfiguredOperation read(XMLStreamReader reader, ProcessorContext context) throws ContributionReadException, XMLStreamException {
        ConfiguredOperation  configuredOp = assemblyFactory.createConfiguredOperation();

        //Read an <operation>
        configuredOp.setName(reader.getAttributeValue(null, NAME));
        configuredOp.setContractName(reader.getAttributeValue(null, SERVICE));
        configuredOp.setUnresolved(true);

        // Read policies
        policyProcessor.readPolicies(configuredOp, reader);

        //Skip to end element
View Full Code Here

                    } else if ("operationProperties".equals(elementName)) {
                        parseOperationProperties(reader, jmsBinding, monitor);
                    } else if ("messageSelection".equals(elementName)) {
                        parseSubscriptionHeaders(reader, jmsBinding);
                    } else if (Constants.OPERATION_QNAME.equals(reader.getName())) {
                        ConfiguredOperation confOp = configuredOperationProcessor.read(reader, context);
                        if (confOp != null) {
                            ((OperationsConfigurator)jmsBinding).getConfiguredOperations().add(confOp);
                        }
                    } else {
                        Object extension = extensionProcessor.read(reader, context);
View Full Code Here

        }

        // Read wsdlLocation
        wsBinding.setLocation(reader.getAttributeValue(WSDLI_NS, WSDL_LOCATION));

        ConfiguredOperation confOp = null;
        // Skip to end element
        while (reader.hasNext()) {
            int event = reader.next();
            switch (event) {
                case START_ELEMENT  : {
View Full Code Here

                }
            }
        }


        ConfiguredOperation confOp = null;
        // Skip to end element
        while (reader.hasNext()) {
            int event = reader.next();
            switch (event) {
                case START_ELEMENT: {
View Full Code Here

     */
    private List<LDAPRealmAuthenticationPolicy> findAuthenticationPolicies(Operation op) {
        List<LDAPRealmAuthenticationPolicy> polices = new ArrayList<LDAPRealmAuthenticationPolicy>();

        // check explicity added policies first
        ConfiguredOperation configuredOperation = findOperation(op);
        if (configuredOperation!= null && configuredOperation.getPolicySets().size() > 0) {
            for ( PolicySet ps : configuredOperation.getPolicySets()) {
                for (Object p : ps.getPolicies()) {
                    if (p instanceof LDAPRealmAuthenticationPolicy) {
                        polices.add((LDAPRealmAuthenticationPolicy)p);
                    }
                }
View Full Code Here

     */
    private List<AuthorizationPolicy> findAuthorizationPolicies(Operation op) {
        List<AuthorizationPolicy> polices = new ArrayList<AuthorizationPolicy>();
       
        // check explicity added policies first
        ConfiguredOperation configuredOperation = findOperation(op);
        if (configuredOperation!= null && configuredOperation.getPolicySets().size() > 0) {
            for ( PolicySet ps : configuredOperation.getPolicySets()) {
                for (Object p : ps.getPolicies()) {
                    if (p instanceof AuthorizationPolicy) {
                        polices.add((AuthorizationPolicy)p);
                    }
                }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.assembly.ConfiguredOperation

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.