cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1562550 - in /cxf/branches/2.7.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/blueprint/JAXRSServerFactoryBeanDefinitionParser.java rt/frontend/jaxrs/src/main/resources/schemas/blueprint/jaxrs.xsd
Date Wed, 29 Jan 2014 19:03:35 GMT
Author: sergeyb
Date: Wed Jan 29 19:03:34 2014
New Revision: 1562550

URL: http://svn.apache.org/r1562550
Log:
Merged revisions 1562548 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1562548 | sergeyb | 2014-01-29 18:59:15 +0000 (Wed, 29 Jan 2014) | 1 line
  
  [CXF-5528] Support for interfaces in jaxrs Blueprint endpoints, patch from Heath Kesler
applied
........

Modified:
    cxf/branches/2.7.x-fixes/   (props changed)
    cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/blueprint/JAXRSServerFactoryBeanDefinitionParser.java
    cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/resources/schemas/blueprint/jaxrs.xsd

Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/trunk:r1562548

Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/blueprint/JAXRSServerFactoryBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/blueprint/JAXRSServerFactoryBeanDefinitionParser.java?rev=1562550&r1=1562549&r2=1562550&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/blueprint/JAXRSServerFactoryBeanDefinitionParser.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/blueprint/JAXRSServerFactoryBeanDefinitionParser.java
Wed Jan 29 19:03:34 2014
@@ -18,6 +18,7 @@
  */
 package org.apache.cxf.jaxrs.blueprint;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.Callable;
 
@@ -31,6 +32,7 @@ import org.apache.aries.blueprint.mutabl
 import org.apache.aries.blueprint.mutable.MutablePassThroughMetadata;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.configuration.blueprint.SimpleBPBeanDefinitionParser;
+import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
 import org.apache.cxf.jaxrs.model.UserResource;
 import org.apache.cxf.jaxrs.utils.ResourceUtils;
@@ -97,6 +99,15 @@ public class JAXRSServerFactoryBeanDefin
             bean.addProperty(name, this.parseListData(ctx, bean, el));
         }  else if ("serviceFactories".equals(name)) {
             bean.addProperty("resourceProviders", this.parseListData(ctx, bean, el));
+        } else if ("resourceClasses".equals(name)) {
+            List<String> resources = getResourceClassesFromElement(el);
+            MutableCollectionMetadata list = ctx.createMetadata(MutableCollectionMetadata.class);
+            list.setCollectionClass(List.class);
+            for (String res : resources) {
+                MutableBeanMetadata objectOfClass = createObjectOfClass(ctx, res);
+                list.addValue(objectOfClass);
+            }
+            bean.addProperty("serviceBeans", list);
         } else if ("model".equals(name)) {
             List<UserResource> resources = ResourceUtils.getResourcesFromElement(el);
             MutableCollectionMetadata list = ctx.createMetadata(MutableCollectionMetadata.class);
@@ -146,4 +157,17 @@ public class JAXRSServerFactoryBeanDefin
         }
     }
 
+    private static List<String> getResourceClassesFromElement(Element modelEl) {
+        List<String> resources = new ArrayList<String>();
+        List<Element> resourceEls =
+            DOMUtils.findAllElementsByTagName(modelEl, "class");
+        for (Element e : resourceEls) {
+            resources.add(getResourceClassFromElement(e));
+        }
+        return resources;
+    }
+    
+    private static String getResourceClassFromElement(Element e) {
+        return e.getAttribute("name");
+    }
 }

Modified: cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/resources/schemas/blueprint/jaxrs.xsd
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/resources/schemas/blueprint/jaxrs.xsd?rev=1562550&r1=1562549&r2=1562550&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/resources/schemas/blueprint/jaxrs.xsd
(original)
+++ cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/resources/schemas/blueprint/jaxrs.xsd
Wed Jan 29 19:03:34 2014
@@ -47,6 +47,7 @@
             <xsd:element name="outFaultInterceptors" type="xsd:anyType" minOccurs="0"/>
             <xsd:element name="properties" type="beans:Tmap" minOccurs="0"/>
             <xsd:element name="serviceBeans" type="xsd:anyType" minOccurs="0"/>   
        
+            <xsd:element name="resourceClasses" type="xsd:anyType" minOccurs="0"/>
             <xsd:element name="modelBeans" type="xsd:anyType" minOccurs="0"/>
             <xsd:element name="model" type="model" minOccurs="0"/>
             <xsd:element name="providers" type="xsd:anyType" minOccurs="0"/>



Mime
View raw message