Search in sources :

Example 1 with SimpleBeanDefinitionParser

use of org.apache.cxf.configuration.spring.SimpleBeanDefinitionParser in project cxf by apache.

the class NamespaceHandler method init.

@SuppressWarnings("deprecation")
public void init() {
    registerBeanDefinitionParser("bus", new BusDefinitionParser());
    registerBeanDefinitionParser("logging", new SimpleBeanDefinitionParser(org.apache.cxf.feature.LoggingFeature.class));
    registerBeanDefinitionParser("fastinfoset", new SimpleBeanDefinitionParser(FastInfosetFeature.class));
    registerBeanDefinitionParser("workqueue", new SimpleBeanDefinitionParser(AutomaticWorkQueueImpl.class) {

        @Override
        protected void processNameAttribute(Element element, ParserContext ctx, BeanDefinitionBuilder bean, String val) {
            bean.addPropertyValue("name", val);
            element.removeAttribute("name");
            if (!element.hasAttribute("id")) {
                element.setAttribute("id", "cxf.workqueue." + val);
            }
        }
    });
}
Also used : BeanDefinitionBuilder(org.springframework.beans.factory.support.BeanDefinitionBuilder) SimpleBeanDefinitionParser(org.apache.cxf.configuration.spring.SimpleBeanDefinitionParser) Element(org.w3c.dom.Element) AutomaticWorkQueueImpl(org.apache.cxf.workqueue.AutomaticWorkQueueImpl) ParserContext(org.springframework.beans.factory.xml.ParserContext) FastInfosetFeature(org.apache.cxf.feature.FastInfosetFeature)

Example 2 with SimpleBeanDefinitionParser

use of org.apache.cxf.configuration.spring.SimpleBeanDefinitionParser in project tomee by apache.

the class NamespaceHandler method init.

@SuppressWarnings("deprecation")
public void init() {
    registerBeanDefinitionParser("bus", new BusDefinitionParser());
    registerBeanDefinitionParser("logging", new SimpleBeanDefinitionParser(org.apache.cxf.feature.LoggingFeature.class));
    registerBeanDefinitionParser("fastinfoset", new SimpleBeanDefinitionParser(FastInfosetFeature.class));
    registerBeanDefinitionParser("workqueue", new SimpleBeanDefinitionParser(AutomaticWorkQueueImpl.class) {

        @Override
        protected void processNameAttribute(Element element, ParserContext ctx, BeanDefinitionBuilder bean, String val) {
            bean.addPropertyValue("name", val);
            element.removeAttribute("name");
            if (!element.hasAttribute("id")) {
                element.setAttribute("id", "cxf.workqueue." + val);
            }
        }
    });
}
Also used : BeanDefinitionBuilder(org.springframework.beans.factory.support.BeanDefinitionBuilder) SimpleBeanDefinitionParser(org.apache.cxf.configuration.spring.SimpleBeanDefinitionParser) Element(org.w3c.dom.Element) AutomaticWorkQueueImpl(org.apache.cxf.workqueue.AutomaticWorkQueueImpl) ParserContext(org.springframework.beans.factory.xml.ParserContext) FastInfosetFeature(org.apache.cxf.feature.FastInfosetFeature)

Aggregations

SimpleBeanDefinitionParser (org.apache.cxf.configuration.spring.SimpleBeanDefinitionParser)2 FastInfosetFeature (org.apache.cxf.feature.FastInfosetFeature)2 AutomaticWorkQueueImpl (org.apache.cxf.workqueue.AutomaticWorkQueueImpl)2 BeanDefinitionBuilder (org.springframework.beans.factory.support.BeanDefinitionBuilder)2 ParserContext (org.springframework.beans.factory.xml.ParserContext)2 Element (org.w3c.dom.Element)2