Package org.apache.tuscany.sca.implementation.spring.context

Examples of org.apache.tuscany.sca.implementation.spring.context.SCAGenericApplicationContext


public class ScaServiceBeanDefinitionParser implements BeanDefinitionParser {

    public BeanDefinition parse(Element element, ParserContext parserContext) {
        BeanDefinitionRegistry registry = parserContext.getRegistry();
        if (registry instanceof SCAGenericApplicationContext) {
            SCAGenericApplicationContext context = (SCAGenericApplicationContext)registry;
            SpringSCAServiceElement serviceElement =
                new SpringSCAServiceElement(getAttribute(element, "name"), getAttribute(element, "target"));
            serviceElement.setType(getAttribute(element, "type"));

            String requires = getAttribute(element, "requires");
            if (requires != null) {
                List<QName> qnames = ScaNamespaceHandler.resolve(element, requires);
                serviceElement.getIntentNames().addAll(qnames);
            }

            String policySets = getAttribute(element, "policySets");
            if (policySets != null) {
                List<QName> qnames = ScaNamespaceHandler.resolve(element, policySets);
                serviceElement.getPolicySetNames().addAll(qnames);
            }

            context.addSCAServiceElement(serviceElement);
        }
        // do nothing, handled by Tuscany
        return null;
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.implementation.spring.context.SCAGenericApplicationContext

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.