[DOSGI-105] Improve greeter_rest demo to use HttpService and JAXB
authorSergey Beryozkin <sergeyb@apache.org>
Mon, 19 Dec 2011 11:22:13 +0000 (11:22 +0000)
committerSergey Beryozkin <sergeyb@apache.org>
Mon, 19 Dec 2011 11:22:13 +0000 (11:22 +0000)
git-svn-id: https://svn.apache.org/repos/asf/cxf/dosgi/trunk@1220695 13f79535-47bb-0310-9956-ffa450edef68

distribution/multi-bundle/src/main/resources/distro_bundles.xml
samples/greeter_rest/client/src/main/resources/OSGI-INF/remote-service/remote-services.xml
samples/greeter_rest/impl/src/main/java/org/apache/cxf/dosgi/samples/greeter/impl/rest/Activator.java
samples/greeter_rest/interface/pom.xml
samples/greeter_rest/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/rest/GreeterInfo.java
samples/greeter_rest/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/rest/GreetingPhrase.java

index bd1e3f7..b38de3a 100644 (file)
@@ -41,9 +41,9 @@
   <bundle>cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/org.apache.servicemix.bundles.joda-time-1.5.2_4.jar</bundle>
   <bundle>cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/org.apache.servicemix.bundles.opensaml-2.4.1_1.jar</bundle>
   <bundle>cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/cxf-bundle-minimal-${cxf.version}.jar</bundle>
-
   <bundle>cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/cxf-dosgi-ri-discovery-local-${project.version}.jar</bundle>
+  <bundle>cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/org.osgi.enterprise-${osgi.version}.jar</bundle>
   <bundle>cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/cxf-dosgi-ri-dsw-cxf-${project.version}.jar</bundle>
   <bundle>cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/cxf-dosgi-ri-topology-manager-${project.version}.jar</bundle>
-  <bundle>cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/org.osgi.enterprise-${osgi.version}.jar</bundle>
+  
 </bundles>
index be5010e..1b2ec65 100644 (file)
     <property name="service.exported.interfaces">*</property>
     <property name="service.exported.configs">org.apache.cxf.rs</property>
     <property name="service.exported.intents">HTTP</property>
-    <property name="org.apache.cxf.rs.address">http://localhost:9090/greeter</property>
-    <property name="org.apache.cxf.rs.databinding">aegis</property> 
+    <property name="org.apache.cxf.rs.address">http://localhost:8080/greeter</property>
   </service-description>
   <service-description>
     <provide interface="org.apache.cxf.dosgi.samples.greeter.rest.GreeterService2" />
     <property name="service.exported.interfaces">*</property>
     <property name="service.exported.configs">org.apache.cxf.rs</property>
     <property name="service.exported.intents">HTTP</property>
-    <property name="org.apache.cxf.rs.address">http://localhost:9091/greeter2</property>
-    <property name="org.apache.cxf.rs.databinding">aegis</property> 
+    <property name="org.apache.cxf.rs.address">http://localhost:8080/greeter2</property>
   </service-description>
 </service-descriptions>
index 4c51b09..dfee776 100644 (file)
@@ -33,11 +33,11 @@ public class Activator implements BundleActivator {
     private ServiceRegistration registration2;
 
     public void start(BundleContext bc) throws Exception {
-        Dictionary props = getProperties("http://localhost:9090/greeter");
+        Dictionary props = getProperties("/greeter");
         registration = bc.registerService(GreeterService.class.getName(), 
                                           new GreeterServiceImpl(), props);
         
-        props = getProperties("http://localhost:9091/greeter2");
+        props = getProperties("/greeter2");
         registration2 = bc.registerService(GreeterService2.class.getName(), 
                                           new GreeterServiceImpl2(), props);
         
@@ -50,8 +50,7 @@ public class Activator implements BundleActivator {
         props.put("service.exported.interfaces", "*");
         props.put("service.exported.configs", "org.apache.cxf.rs");
         props.put("service.exported.intents", "HTTP");
-        props.put("org.apache.cxf.rs.address", address);
-        props.put("org.apache.cxf.rs.databinding", "aegis");
+        props.put("org.apache.cxf.rs.httpservice.context", address);
         return props;
     }
     
index b784855..26cd5e5 100644 (file)
@@ -33,7 +33,7 @@
     </parent>
 
     <properties>
-        <bundle.import.package>javax.ws.rs,*</bundle.import.package>
+        <bundle.import.package>javax.ws.rs,javax.xml.bind.annotation,*</bundle.import.package>
         <bundle.export.package>org.apache.cxf.dosgi.samples.greeter.rest</bundle.export.package>
     </properties>
     
index c1c2a63..6dc9685 100644 (file)
@@ -21,6 +21,8 @@ package org.apache.cxf.dosgi.samples.greeter.rest;
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.xml.bind.annotation.XmlRootElement;
+@XmlRootElement
 public class GreeterInfo {
     private List<GreetingPhrase> greetings = new ArrayList<GreetingPhrase>();