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

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


public class ScaPropertyBeanDefinitionParser implements BeanDefinitionParser {

    public BeanDefinition parse(Element element, ParserContext parserContext) {
        BeanDefinitionRegistry registry = parserContext.getRegistry();
        if (registry instanceof SCAGenericApplicationContext) {
            SCAGenericApplicationContext context = (SCAGenericApplicationContext)registry;
            SpringSCAPropertyElement propertyElement =
                new SpringSCAPropertyElement(element.getAttributeNS(null, "name"), element.getAttributeNS(null, "type"));
            context.addSCAPropertyElement(propertyElement);
        }
        // do nothing, this is handled by Tuscany
        return null;
    }
View Full Code Here


public class ScaReferenceBeanDefinitionParser implements BeanDefinitionParser {

    public BeanDefinition parse(Element element, ParserContext parserContext) {
        BeanDefinitionRegistry registry = parserContext.getRegistry();
        if (registry instanceof SCAGenericApplicationContext) {
            SCAGenericApplicationContext context = (SCAGenericApplicationContext)registry;
            SpringSCAReferenceElement referenceElement =
                new SpringSCAReferenceElement(getAttribute(element, "name"), getAttribute(element, "type"));
            referenceElement.setDefaultBean(getAttribute(element, "default"));

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

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

            context.addSCAReferenceElement(referenceElement);
        }

        // do nothing, this is handled by Tuscany
        return null;
    }
View Full Code Here

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

                                                                         List<URL> resources) {
        if (classLoader == null) {
            classLoader = Thread.currentThread().getContextClassLoader();
        }

        SCAGenericApplicationContext appCtx =
            new SCAGenericApplicationContext((ApplicationContext)scaParentContext, classLoader);
        XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(appCtx);

        // REVIEW: [rfeng] How do we control the schema validation
        xmlReader.setValidating(false);
View Full Code Here

                       List<SpringSCAReferenceElement> referenceElements,
                       List<SpringSCAPropertyElement> propertyElements,
                       List<SpringBeanElement> beanElements,
                       ProcessorContext context) {
        // FIXME: [rfeng] We should try to avoid parsing the Spring xml twice for the deployment and runtime
        SCAGenericApplicationContext applicationContext = createApplicationContext(null, null, resources);
        serviceElements.addAll(applicationContext.getServiceElements());
        referenceElements.addAll(applicationContext.getReferenceElements());
        propertyElements.addAll(applicationContext.getPropertyElements());
        beanElements.addAll(applicationContext.getBeanElements());
        return applicationContext;
    }
View Full Code Here

public class ScaPropertyBeanDefinitionParser implements BeanDefinitionParser {

    public BeanDefinition parse(Element element, ParserContext parserContext) {
        BeanDefinitionRegistry registry = parserContext.getRegistry();
        if (registry instanceof SCAGenericApplicationContext) {
            SCAGenericApplicationContext context = (SCAGenericApplicationContext)registry;
            SpringSCAPropertyElement propertyElement =
                new SpringSCAPropertyElement(element.getAttributeNS(null, "name"), element.getAttributeNS(null, "type"));
            context.addSCAPropertyElement(propertyElement);
        }
        // do nothing, this is handled by Tuscany
        return null;
    }
View Full Code Here

public class ScaReferenceBeanDefinitionParser implements BeanDefinitionParser {

    public BeanDefinition parse(Element element, ParserContext parserContext) {
        BeanDefinitionRegistry registry = parserContext.getRegistry();
        if (registry instanceof SCAGenericApplicationContext) {
            SCAGenericApplicationContext context = (SCAGenericApplicationContext)registry;
            SpringSCAReferenceElement referenceElement =
                new SpringSCAReferenceElement(getAttribute(element, "name"), getAttribute(element, "type"));
            referenceElement.setDefaultBean(getAttribute(element, "default"));

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

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

            context.addSCAReferenceElement(referenceElement);
        }

        // do nothing, this is handled by Tuscany
        return null;
    }
View Full Code Here

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

public class ScaPropertyBeanDefinitionParser implements BeanDefinitionParser {

    public BeanDefinition parse(Element element, ParserContext parserContext) {
        BeanDefinitionRegistry registry = parserContext.getRegistry();
        if (registry instanceof SCAGenericApplicationContext) {
            SCAGenericApplicationContext context = (SCAGenericApplicationContext)registry;
            SpringSCAPropertyElement propertyElement =
                new SpringSCAPropertyElement(element.getAttributeNS(null, "name"), element.getAttributeNS(null, "type"));
            context.addSCAPropertyElement(propertyElement);
        }
        // do nothing, this is handled by Tuscany
        return null;
    }
View Full Code Here

public class ScaReferenceBeanDefinitionParser implements BeanDefinitionParser {

    public BeanDefinition parse(Element element, ParserContext parserContext) {
        BeanDefinitionRegistry registry = parserContext.getRegistry();
        if (registry instanceof SCAGenericApplicationContext) {
            SCAGenericApplicationContext context = (SCAGenericApplicationContext)registry;
            SpringSCAReferenceElement referenceElement =
                new SpringSCAReferenceElement(getAttribute(element, "name"), getAttribute(element, "type"));
            referenceElement.setDefaultBean(getAttribute(element, "default"));

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

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

            context.addSCAReferenceElement(referenceElement);
        }

        // do nothing, this is 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.