You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by cs...@apache.org on 2016/08/12 16:07:03 UTC
[1/2] cxf-dosgi git commit: [DOSGI-249] Redesign examples
Repository: cxf-dosgi
Updated Branches:
refs/heads/master abdd7419f -> 37cf7d355
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/rest/README.md
----------------------------------------------------------------------
diff --git a/samples/rest/README.md b/samples/rest/README.md
new file mode 100644
index 0000000..0c74070
--- /dev/null
+++ b/samples/rest/README.md
@@ -0,0 +1,42 @@
+# CXF DOSGi example REST
+
+This example shows how to expose and use a REST service using declarative services.
+
+The API module defines the TaskResource interface which is annotated using JAXRS annotations.
+
+The impl module implements the TaskService using a simple HashMap internally. It allows to manage Task objects which represent items of a to do list.
+
+
+## Installation
+
+Unpack karaf 4 into a server and client directory.
+
+### Install server
+
+Start the server karaf
+
+```
+feature:repo-add cxf-dosgi-samples 2.0-SNAPSHOT
+feature:install cxf-dosgi-sample-rest-impl
+rsa:endpoints
+```
+
+The last command should show one endpoint with a URI as id. You should be able to open the url in the browser. The browser should show the predefined tasks as xml.
+
+### Install client
+
+Start the client karaf
+
+```
+feature:repo-add cxf-dosgi-samples 2.0-SNAPSHOT
+feature:install cxf-dosgi-sample-rest-client
+```
+Use commands to test
+
+```
+rsa:endpoints
+task:list
+task:add 4 Mytask
+task:list
+```
+
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/rest/api/bnd.bnd
----------------------------------------------------------------------
diff --git a/samples/rest/api/bnd.bnd b/samples/rest/api/bnd.bnd
new file mode 100644
index 0000000..d81f90b
--- /dev/null
+++ b/samples/rest/api/bnd.bnd
@@ -0,0 +1 @@
+Export-Package: org.apache.cxf.dosgi.samples.rest
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/rest/api/pom.xml
----------------------------------------------------------------------
diff --git a/samples/rest/api/pom.xml b/samples/rest/api/pom.xml
new file mode 100644
index 0000000..3c91d30
--- /dev/null
+++ b/samples/rest/api/pom.xml
@@ -0,0 +1,51 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.cxf.dosgi.samples</groupId>
+ <artifactId>cxf-dosgi-samples-rest-api</artifactId>
+ <packaging>bundle</packaging>
+ <name>CXF DOSGi samples REST API</name>
+
+ <parent>
+ <groupId>org.apache.cxf.dosgi</groupId>
+ <artifactId>cxf-dosgi-ri-parent</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../../../parent/pom.xml</relativePath>
+ </parent>
+
+ <properties>
+ <topDirectoryLocation>../../..</topDirectoryLocation>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.servicemix.specs</groupId>
+ <artifactId>org.apache.servicemix.specs.jsr339-api-m10</artifactId>
+ <version>${servicemix.specs.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix.specs</groupId>
+ <artifactId>org.apache.servicemix.specs.jaxb-api-2.1</artifactId>
+ <version>${servicemix.specs.version}</version>
+ </dependency>
+ </dependencies>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/rest/api/src/main/java/org/apache/cxf/dosgi/samples/rest/Task.java
----------------------------------------------------------------------
diff --git a/samples/rest/api/src/main/java/org/apache/cxf/dosgi/samples/rest/Task.java b/samples/rest/api/src/main/java/org/apache/cxf/dosgi/samples/rest/Task.java
new file mode 100644
index 0000000..6ae15a1
--- /dev/null
+++ b/samples/rest/api/src/main/java/org/apache/cxf/dosgi/samples/rest/Task.java
@@ -0,0 +1,83 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.dosgi.samples.rest;
+
+import java.util.Date;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class Task {
+ Integer id;
+ String title;
+ String description;
+ Date dueDate;
+ boolean finished;
+
+ public Task() {
+ }
+
+ public Task(Integer id, String title, String description) {
+ super();
+ this.id = id;
+ this.title = title;
+ this.description = description;
+ }
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = new Integer(id);
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Date getDueDate() {
+ return dueDate;
+ }
+
+ public void setDueDate(Date dueDate) {
+ this.dueDate = dueDate;
+ }
+
+ public boolean isFinished() {
+ return finished;
+ }
+
+ public void setFinished(boolean finished) {
+ this.finished = finished;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/rest/api/src/main/java/org/apache/cxf/dosgi/samples/rest/TaskResource.java
----------------------------------------------------------------------
diff --git a/samples/rest/api/src/main/java/org/apache/cxf/dosgi/samples/rest/TaskResource.java b/samples/rest/api/src/main/java/org/apache/cxf/dosgi/samples/rest/TaskResource.java
new file mode 100644
index 0000000..e4a6798
--- /dev/null
+++ b/samples/rest/api/src/main/java/org/apache/cxf/dosgi/samples/rest/TaskResource.java
@@ -0,0 +1,44 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.dosgi.samples.rest;
+
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+
+@Path("")
+@Produces("application/xml")
+public interface TaskResource {
+ @GET
+ @Path("/{id}")
+ Task get(@PathParam("id") Integer id);
+
+ @PUT
+ void addOrUpdate(Task task);
+
+ @DELETE
+ @Path("/{id}")
+ void delete(Integer id);
+
+ @GET
+ Task[] getAll();
+}
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/rest/api/src/main/resources/OSGI-INF/cxf/jaxrs/GreeterService2-model.xml
----------------------------------------------------------------------
diff --git a/samples/rest/api/src/main/resources/OSGI-INF/cxf/jaxrs/GreeterService2-model.xml b/samples/rest/api/src/main/resources/OSGI-INF/cxf/jaxrs/GreeterService2-model.xml
new file mode 100644
index 0000000..2c4da17
--- /dev/null
+++ b/samples/rest/api/src/main/resources/OSGI-INF/cxf/jaxrs/GreeterService2-model.xml
@@ -0,0 +1,7 @@
+<model xmlns="http://cxf.apache.org/jaxrs">
+ <resource name="org.apache.cxf.dosgi.samples.greeter.rest.GreeterService2" path="greeter">
+ <operation name="greetMe" verb="GET" path="greeting/{name}">
+ <param name="name" type="PATH"/>
+ </operation>
+ </resource>
+</model>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/rest/client/pom.xml
----------------------------------------------------------------------
diff --git a/samples/rest/client/pom.xml b/samples/rest/client/pom.xml
new file mode 100644
index 0000000..bacde9d
--- /dev/null
+++ b/samples/rest/client/pom.xml
@@ -0,0 +1,38 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+ license agreements. See the NOTICE file distributed with this work for additional
+ information regarding copyright ownership. The ASF licenses this file to
+ you under the Apache License, Version 2.0 (the "License"); you may not use
+ this file except in compliance with the License. You may obtain a copy of
+ the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+ by applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ OF ANY KIND, either express or implied. See the License for the specific
+ language governing permissions and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>cxf-dosgi-samples-rest-client</artifactId>
+ <packaging>bundle</packaging>
+ <name>CXF DOSGi samples REST Client</name>
+
+ <parent>
+ <groupId>org.apache.cxf.dosgi.samples</groupId>
+ <artifactId>cxf-dosgi-samples-rest-parent</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <properties>
+ <topDirectoryLocation>../..</topDirectoryLocation>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.cxf.dosgi.samples</groupId>
+ <artifactId>cxf-dosgi-samples-rest-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/rest/client/src/main/java/org/apache/cxf/dosgi/samples/rest/client/TaskResourceCommand.java
----------------------------------------------------------------------
diff --git a/samples/rest/client/src/main/java/org/apache/cxf/dosgi/samples/rest/client/TaskResourceCommand.java b/samples/rest/client/src/main/java/org/apache/cxf/dosgi/samples/rest/client/TaskResourceCommand.java
new file mode 100644
index 0000000..9e13a52
--- /dev/null
+++ b/samples/rest/client/src/main/java/org/apache/cxf/dosgi/samples/rest/client/TaskResourceCommand.java
@@ -0,0 +1,63 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.dosgi.samples.rest.client;
+
+import org.apache.cxf.dosgi.samples.rest.Task;
+import org.apache.cxf.dosgi.samples.rest.TaskResource;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
+
+@Component//
+(//
+ service = TaskResourceCommand.class,
+ property = //
+ {
+ "osgi.command.scope=task", //
+ "osgi.command.function=list", //
+ "osgi.command.function=add", //
+ "osgi.command.function=delete"
+ }//
+)
+public class TaskResourceCommand {
+
+ private TaskResource taskService;
+
+ public void list() {
+ System.out.println("Open tasks:");
+ Task[] tasks = taskService.getAll();
+ for (Task task : tasks) {
+ String line = String.format("%d %s", task.getId(), task.getTitle());
+ System.out.println(line);
+ }
+ }
+
+ public void add(Integer id, String title) {
+ Task task = new Task(id, title, "");
+ taskService.addOrUpdate(task);
+ }
+
+ public void delete(Integer id) {
+ taskService.delete(id);
+ }
+
+ @Reference
+ public void setTaskService(TaskResource taskService) {
+ this.taskService = taskService;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/rest/client/src/main/resources/OSGI-INF/remote-service/remote-services.xml
----------------------------------------------------------------------
diff --git a/samples/rest/client/src/main/resources/OSGI-INF/remote-service/remote-services.xml b/samples/rest/client/src/main/resources/OSGI-INF/remote-service/remote-services.xml
new file mode 100644
index 0000000..db5bb14
--- /dev/null
+++ b/samples/rest/client/src/main/resources/OSGI-INF/remote-service/remote-services.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to you under the Apache License, Version
+ 2.0 (the "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0 Unless required by
+ applicable law or agreed to in writing, software distributed under
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
+ OR CONDITIONS OF ANY KIND, either express or implied. See the
+ License for the specific language governing permissions and
+ limitations under the License.
+ -->
+<service-descriptions xmlns="http://www.osgi.org/xmlns/sd/v1.0.0">
+ <service-description>
+ <provide interface="org.apache.cxf.dosgi.samples.greeter.rest.GreeterService" />
+ <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:8080/greeter</property>
+ </service-description>
+</service-descriptions>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/rest/impl/pom.xml
----------------------------------------------------------------------
diff --git a/samples/rest/impl/pom.xml b/samples/rest/impl/pom.xml
new file mode 100644
index 0000000..dc18337
--- /dev/null
+++ b/samples/rest/impl/pom.xml
@@ -0,0 +1,44 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+ license agreements. See the NOTICE file distributed with this work for additional
+ information regarding copyright ownership. The ASF licenses this file to
+ you under the Apache License, Version 2.0 (the "License"); you may not use
+ this file except in compliance with the License. You may obtain a copy of
+ the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+ by applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ OF ANY KIND, either express or implied. See the License for the specific
+ language governing permissions and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>cxf-dosgi-samples-rest-impl</artifactId>
+ <packaging>bundle</packaging>
+ <name>CXF DOSGi samples REST Impl</name>
+
+ <parent>
+ <groupId>org.apache.cxf.dosgi.samples</groupId>
+ <artifactId>cxf-dosgi-samples-rest-parent</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <properties>
+ <topDirectoryLocation>..</topDirectoryLocation>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>javax.ws.rs-api</artifactId>
+ <version>2.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf.dosgi.samples</groupId>
+ <artifactId>cxf-dosgi-samples-rest-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/rest/impl/src/main/java/org/apache/cxf/dosgi/samples/rest/impl/TaskServiceImpl.java
----------------------------------------------------------------------
diff --git a/samples/rest/impl/src/main/java/org/apache/cxf/dosgi/samples/rest/impl/TaskServiceImpl.java b/samples/rest/impl/src/main/java/org/apache/cxf/dosgi/samples/rest/impl/TaskServiceImpl.java
new file mode 100644
index 0000000..2644e8d
--- /dev/null
+++ b/samples/rest/impl/src/main/java/org/apache/cxf/dosgi/samples/rest/impl/TaskServiceImpl.java
@@ -0,0 +1,74 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.dosgi.samples.rest.impl;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.cxf.dosgi.samples.rest.Task;
+import org.apache.cxf.dosgi.samples.rest.TaskResource;
+import org.osgi.service.component.annotations.Component;
+
+@Component(immediate = true, //
+property = //
+{ //
+ "name=TaskResource",
+ "service.exported.interfaces=*", //
+ "service.exported.configs=org.apache.cxf.rs", //
+ "org.apache.cxf.rs.address=/tasks" //
+} //
+)
+public class TaskServiceImpl implements TaskResource {
+ Map<Integer, Task> taskMap;
+
+ public TaskServiceImpl() {
+ taskMap = new HashMap<Integer, Task>();
+ Task task = new Task();
+ task.setId(1);
+ task.setTitle("Buy some coffee");
+ task.setDescription("Take the extra strong");
+ addOrUpdate(task);
+ task = new Task();
+ task.setId(2);
+ task.setTitle("Finish DOSGi example");
+ task.setDescription("");
+ addOrUpdate(task);
+ }
+
+ @Override
+ public Task get(Integer id) {
+ return taskMap.get(id);
+ }
+
+ @Override
+ public void addOrUpdate(Task task) {
+ taskMap.put(task.getId(), task);
+ }
+
+ @Override
+ public Task[] getAll() {
+ return taskMap.values().toArray(new Task[]{});
+ }
+
+ @Override
+ public void delete(Integer id) {
+ taskMap.remove(id);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/rest/pom.xml
----------------------------------------------------------------------
diff --git a/samples/rest/pom.xml b/samples/rest/pom.xml
new file mode 100644
index 0000000..b40e0f7
--- /dev/null
+++ b/samples/rest/pom.xml
@@ -0,0 +1,47 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+ license agreements. See the NOTICE file distributed with this work for additional
+ information regarding copyright ownership. The ASF licenses this file to
+ you under the Apache License, Version 2.0 (the "License"); you may not use
+ this file except in compliance with the License. You may obtain a copy of
+ the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+ by applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ OF ANY KIND, either express or implied. See the License for the specific
+ language governing permissions and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.cxf.dosgi.samples</groupId>
+ <artifactId>cxf-dosgi-samples-rest-parent</artifactId>
+ <packaging>pom</packaging>
+ <name>CXF DOSGi samples REST Parent</name>
+
+ <parent>
+ <groupId>org.apache.cxf.dosgi.samples</groupId>
+ <artifactId>cxf-dosgi-samples-parent</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <modules>
+ <module>api</module>
+ <module>impl</module>
+ <module>client</module>
+ </modules>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/security_filter/bnd.bnd
----------------------------------------------------------------------
diff --git a/samples/security_filter/bnd.bnd b/samples/security_filter/bnd.bnd
index 2056f10..6c23d21 100644
--- a/samples/security_filter/bnd.bnd
+++ b/samples/security_filter/bnd.bnd
@@ -1,2 +1 @@
Private-Package: org.apache.cxf.dosgi.samples.security
-Bundle-Activator: org.apache.cxf.dosgi.samples.security.Activator
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/security_filter/pom.xml
----------------------------------------------------------------------
diff --git a/samples/security_filter/pom.xml b/samples/security_filter/pom.xml
index 754b71f..bdaec00 100644
--- a/samples/security_filter/pom.xml
+++ b/samples/security_filter/pom.xml
@@ -13,9 +13,9 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.cxf.dosgi.samples</groupId>
- <artifactId>cxf-dosgi-ri-samples-security</artifactId>
+ <artifactId>cxf-dosgi-ri-samples-security-filter</artifactId>
<packaging>bundle</packaging>
- <name>CXF DOSGi Security Sample Bundle</name>
+ <name>CXF DOSGi Samples Security Filter</name>
<parent>
<groupId>org.apache.cxf.dosgi</groupId>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/security_filter/src/main/java/org/apache/cxf/dosgi/samples/security/Activator.java
----------------------------------------------------------------------
diff --git a/samples/security_filter/src/main/java/org/apache/cxf/dosgi/samples/security/Activator.java b/samples/security_filter/src/main/java/org/apache/cxf/dosgi/samples/security/Activator.java
deleted file mode 100644
index 2514106..0000000
--- a/samples/security_filter/src/main/java/org/apache/cxf/dosgi/samples/security/Activator.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.dosgi.samples.security;
-
-import java.util.Dictionary;
-import java.util.Hashtable;
-
-import javax.servlet.Filter;
-
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceRegistration;
-
-/**
- * Registers a REST endpoint and a servlet filter to control access to the
- * endpoint.
- */
-public class Activator implements BundleActivator {
-
- private ServiceRegistration restRegistration;
- private ServiceRegistration filterRegistration;
-
- public void start(BundleContext bundleContext) throws Exception {
- // Register a rest endpoint
- Dictionary<String, Object> restProps = new Hashtable<String, Object>();
- restProps.put("service.exported.interfaces", SecureRestEndpoint.class.getName());
- restProps.put("service.exported.configs", "org.apache.cxf.rs");
- restProps.put("org.apache.cxf.rs.httpservice.context", "/secure");
- restRegistration = bundleContext.registerService(SecureRestEndpoint.class.getName(),
- new SecureRestEndpoint(), restProps);
-
- // Register a servlet filter (this could be done in another OSGi bundle,
- // too)
- Dictionary<String, Object> filterProps = new Hashtable<String, Object>();
- filterProps.put("org.apache.cxf.httpservice.filter", Boolean.TRUE);
- // Pax-Web whiteboard (if deployed) will attempt to apply this filter to
- // servlets by name or URL, and will complain
- // if neither servletName or urlPatterns are specified. The felix http
- // service whiteboard may do something similar.
- filterProps.put("servletNames", "none");
- filterRegistration = bundleContext.registerService(Filter.class.getName(),
- new SampleSecurityFilter(), filterProps);
- }
-
- public void stop(BundleContext bundleContext) throws Exception {
- restRegistration.unregister();
- filterRegistration.unregister();
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/security_filter/src/main/java/org/apache/cxf/dosgi/samples/security/SampleSecurityFilter.java
----------------------------------------------------------------------
diff --git a/samples/security_filter/src/main/java/org/apache/cxf/dosgi/samples/security/SampleSecurityFilter.java b/samples/security_filter/src/main/java/org/apache/cxf/dosgi/samples/security/SampleSecurityFilter.java
index bfc8504..92c65b3 100644
--- a/samples/security_filter/src/main/java/org/apache/cxf/dosgi/samples/security/SampleSecurityFilter.java
+++ b/samples/security_filter/src/main/java/org/apache/cxf/dosgi/samples/security/SampleSecurityFilter.java
@@ -29,13 +29,23 @@ import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.osgi.service.component.annotations.Component;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * A filter that requires a query string of "secure" to invoke the protected
- * resource.
+ * A filter that requires a query string of "secure" to invoke the protected resource. Pax-Web whiteboard (if
+ * deployed) will attempt to apply this filter to servlets by name or URL, and will complain if neither
+ * servletName or urlPatterns are specified. The felix http service whiteboard may do something similar.
*/
+@Component //
+(//
+ service = javax.servlet.Filter.class,
+ property = //
+ {
+ "org.apache.cxf.httpservice.filter=true", "servletNames=none"
+ }//
+)
public class SampleSecurityFilter implements Filter {
private static final Logger LOG = LoggerFactory.getLogger(SampleSecurityFilter.class);
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/security_filter/src/main/java/org/apache/cxf/dosgi/samples/security/SecureRestEndpoint.java
----------------------------------------------------------------------
diff --git a/samples/security_filter/src/main/java/org/apache/cxf/dosgi/samples/security/SecureRestEndpoint.java b/samples/security_filter/src/main/java/org/apache/cxf/dosgi/samples/security/SecureRestEndpoint.java
index 8c066ac..a646c2d 100644
--- a/samples/security_filter/src/main/java/org/apache/cxf/dosgi/samples/security/SecureRestEndpoint.java
+++ b/samples/security_filter/src/main/java/org/apache/cxf/dosgi/samples/security/SecureRestEndpoint.java
@@ -23,6 +23,18 @@ import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
+import org.osgi.service.component.annotations.Component;
+
+@Component //
+(//
+ service = SecureRestEndpoint.class,
+ property = //
+ { //
+ "service.exported.interfaces=*",
+ "service.exported.configs=org.apache.cxf.rs",
+ "org.apache.cxf.rs.httpservice.context=/secure"
+ }
+)
@Path("/")
public class SecureRestEndpoint {
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/soap/README.md
----------------------------------------------------------------------
diff --git a/samples/soap/README.md b/samples/soap/README.md
new file mode 100644
index 0000000..638b3cb
--- /dev/null
+++ b/samples/soap/README.md
@@ -0,0 +1,42 @@
+# CXF DOSGi example SOAP
+
+This example shows how to expose and use a SOAP service using declarative services.
+
+The API module defines the TaskService interface which is annotated using @WebService to signal that
+we want to create a JAXWS based SOAP service.
+
+The impl module implements the TaskService using a simple HashMap internally. It allows to manage Task objects which represent items of a to do list.
+
+
+## Installation
+
+Unpack karaf 4 into a server and client directory.
+
+### Install server
+
+Start the server karaf
+
+```
+feature:repo-add cxf-dosgi-samples 2.0-SNAPSHOT
+feature:install cxf-dosgi-sample-soap-impl
+rsa:endpoints
+```
+
+The last command should show one endpoint with a URI as id. You should be able to open the url in the browser.
+
+### Install client
+
+Start the client karaf
+
+```
+feature:repo-add cxf-dosgi-samples 2.0-SNAPSHOT
+feature:install cxf-dosgi-sample-soap-client
+```
+Use commands to test
+
+```
+rsa:endpoints
+task:list
+task:add 4 Mytask
+task:list
+```
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/soap/api/bnd.bnd
----------------------------------------------------------------------
diff --git a/samples/soap/api/bnd.bnd b/samples/soap/api/bnd.bnd
new file mode 100644
index 0000000..7f29e80
--- /dev/null
+++ b/samples/soap/api/bnd.bnd
@@ -0,0 +1 @@
+Export-Package: org.apache.cxf.dosgi.samples.soap
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/soap/api/pom.xml
----------------------------------------------------------------------
diff --git a/samples/soap/api/pom.xml b/samples/soap/api/pom.xml
new file mode 100644
index 0000000..9468c1a
--- /dev/null
+++ b/samples/soap/api/pom.xml
@@ -0,0 +1,38 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>cxf-dosgi-samples-soap-api</artifactId>
+ <packaging>bundle</packaging>
+ <name>CXF DOSGi samples SOAP API</name>
+
+ <parent>
+ <groupId>org.apache.cxf.dosgi.samples</groupId>
+ <artifactId>cxf-dosgi-samples-soap-parent</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <properties>
+ <topDirectoryLocation>..</topDirectoryLocation>
+ </properties>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/soap/api/src/main/java/org/apache/cxf/dosgi/samples/soap/Task.java
----------------------------------------------------------------------
diff --git a/samples/soap/api/src/main/java/org/apache/cxf/dosgi/samples/soap/Task.java b/samples/soap/api/src/main/java/org/apache/cxf/dosgi/samples/soap/Task.java
new file mode 100644
index 0000000..a689ed4
--- /dev/null
+++ b/samples/soap/api/src/main/java/org/apache/cxf/dosgi/samples/soap/Task.java
@@ -0,0 +1,83 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.dosgi.samples.soap;
+
+import java.util.Date;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class Task {
+ Integer id;
+ String title;
+ String description;
+ Date dueDate;
+ boolean finished;
+
+ public Task() {
+ }
+
+ public Task(Integer id, String title, String description) {
+ super();
+ this.id = id;
+ this.title = title;
+ this.description = description;
+ }
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = new Integer(id);
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Date getDueDate() {
+ return dueDate;
+ }
+
+ public void setDueDate(Date dueDate) {
+ this.dueDate = dueDate;
+ }
+
+ public boolean isFinished() {
+ return finished;
+ }
+
+ public void setFinished(boolean finished) {
+ this.finished = finished;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/soap/api/src/main/java/org/apache/cxf/dosgi/samples/soap/TaskService.java
----------------------------------------------------------------------
diff --git a/samples/soap/api/src/main/java/org/apache/cxf/dosgi/samples/soap/TaskService.java b/samples/soap/api/src/main/java/org/apache/cxf/dosgi/samples/soap/TaskService.java
new file mode 100644
index 0000000..45face5
--- /dev/null
+++ b/samples/soap/api/src/main/java/org/apache/cxf/dosgi/samples/soap/TaskService.java
@@ -0,0 +1,34 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.dosgi.samples.soap;
+
+import java.util.Collection;
+
+import javax.jws.WebService;
+
+@WebService
+public interface TaskService {
+ Task get(Integer id);
+
+ void addOrUpdate(Task task);
+
+ void delete(Integer id);
+
+ Collection<Task> getAll();
+}
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/soap/client/bnd.bnd
----------------------------------------------------------------------
diff --git a/samples/soap/client/bnd.bnd b/samples/soap/client/bnd.bnd
new file mode 100644
index 0000000..c2afb9b
--- /dev/null
+++ b/samples/soap/client/bnd.bnd
@@ -0,0 +1 @@
+Export-Package: org.apache.cxf.dosgi.samples.soap.client
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/soap/client/pom.xml
----------------------------------------------------------------------
diff --git a/samples/soap/client/pom.xml b/samples/soap/client/pom.xml
new file mode 100644
index 0000000..f850e56
--- /dev/null
+++ b/samples/soap/client/pom.xml
@@ -0,0 +1,37 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+ license agreements. See the NOTICE file distributed with this work for additional
+ information regarding copyright ownership. The ASF licenses this file to
+ you under the Apache License, Version 2.0 (the "License"); you may not use
+ this file except in compliance with the License. You may obtain a copy of
+ the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+ by applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ OF ANY KIND, either express or implied. See the License for the specific
+ language governing permissions and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>cxf-dosgi-samples-soap-client</artifactId>
+ <packaging>bundle</packaging>
+ <name>CXF DOSGi samples SOAP Client</name>
+
+ <parent>
+ <groupId>org.apache.cxf.dosgi.samples</groupId>
+ <artifactId>cxf-dosgi-samples-soap-parent</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <properties>
+ <topDirectoryLocation>..</topDirectoryLocation>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.cxf.dosgi.samples</groupId>
+ <artifactId>cxf-dosgi-samples-soap-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/soap/client/src/main/java/org/apache/cxf/dosgi/samples/soap/client/TaskServiceCommand.java
----------------------------------------------------------------------
diff --git a/samples/soap/client/src/main/java/org/apache/cxf/dosgi/samples/soap/client/TaskServiceCommand.java b/samples/soap/client/src/main/java/org/apache/cxf/dosgi/samples/soap/client/TaskServiceCommand.java
new file mode 100644
index 0000000..a249d38
--- /dev/null
+++ b/samples/soap/client/src/main/java/org/apache/cxf/dosgi/samples/soap/client/TaskServiceCommand.java
@@ -0,0 +1,65 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.dosgi.samples.soap.client;
+
+import java.util.Collection;
+
+import org.apache.cxf.dosgi.samples.soap.Task;
+import org.apache.cxf.dosgi.samples.soap.TaskService;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
+
+@Component//
+(//
+ service = TaskServiceCommand.class,
+ property = //
+ {
+ "osgi.command.scope=task", //
+ "osgi.command.function=list", //
+ "osgi.command.function=add", //
+ "osgi.command.function=delete"
+ }//
+)
+public class TaskServiceCommand {
+
+ private TaskService taskService;
+
+ public void list() {
+ System.out.println("Open tasks:");
+ Collection<Task> tasks = taskService.getAll();
+ for (Task task : tasks) {
+ String line = String.format("%d %s", task.getId(), task.getTitle());
+ System.out.println(line);
+ }
+ }
+
+ public void add(Integer id, String title) {
+ Task task = new Task(id, title, "");
+ taskService.addOrUpdate(task);
+ }
+
+ public void delete(Integer id) {
+ taskService.delete(id);
+ }
+
+ @Reference
+ public void setTaskService(TaskService taskService) {
+ this.taskService = taskService;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/soap/impl/pom.xml
----------------------------------------------------------------------
diff --git a/samples/soap/impl/pom.xml b/samples/soap/impl/pom.xml
new file mode 100644
index 0000000..2dfb07a
--- /dev/null
+++ b/samples/soap/impl/pom.xml
@@ -0,0 +1,45 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>cxf-dosgi-samples-soap-impl</artifactId>
+ <packaging>bundle</packaging>
+ <name>CXF DOSGi samples SOAP Impl</name>
+
+ <parent>
+ <groupId>org.apache.cxf.dosgi.samples</groupId>
+ <artifactId>cxf-dosgi-samples-soap-parent</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <properties>
+ <topDirectoryLocation>..</topDirectoryLocation>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.cxf.dosgi.samples</groupId>
+ <artifactId>cxf-dosgi-samples-soap-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/soap/impl/src/main/java/org/apache/cxf/dosgi/samples/soap/impl/TaskServiceImpl.java
----------------------------------------------------------------------
diff --git a/samples/soap/impl/src/main/java/org/apache/cxf/dosgi/samples/soap/impl/TaskServiceImpl.java b/samples/soap/impl/src/main/java/org/apache/cxf/dosgi/samples/soap/impl/TaskServiceImpl.java
new file mode 100644
index 0000000..d2f94bf
--- /dev/null
+++ b/samples/soap/impl/src/main/java/org/apache/cxf/dosgi/samples/soap/impl/TaskServiceImpl.java
@@ -0,0 +1,77 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.dosgi.samples.soap.impl;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.cxf.dosgi.samples.soap.Task;
+import org.apache.cxf.dosgi.samples.soap.TaskService;
+import org.osgi.service.component.annotations.Component;
+
+@Component(immediate = true, //
+property = //
+{ //
+ "name=TaskService",
+ "service.exported.interfaces=*", //
+ "service.exported.configs=org.apache.cxf.ws", //
+ "org.apache.cxf.ws.address=/taskservice" //
+} //
+)
+public class TaskServiceImpl implements TaskService {
+ Map<Integer, Task> taskMap;
+
+ public TaskServiceImpl() {
+ taskMap = new HashMap<Integer, Task>();
+ Task task = new Task();
+ task.setId(1);
+ task.setTitle("Buy some coffee");
+ task.setDescription("Take the extra strong");
+ addOrUpdate(task);
+ task = new Task();
+ task.setId(2);
+ task.setTitle("Finish DOSGi example");
+ task.setDescription("");
+ addOrUpdate(task);
+ }
+
+ @Override
+ public Task get(Integer id) {
+ return taskMap.get(id);
+ }
+
+ @Override
+ public void addOrUpdate(Task task) {
+ taskMap.put(task.getId(), task);
+ }
+
+ @Override
+ public Collection<Task> getAll() {
+ // taskMap.values is not serializable
+ return new ArrayList<Task>(taskMap.values());
+ }
+
+ @Override
+ public void delete(Integer id) {
+ taskMap.remove(id);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/soap/pom.xml
----------------------------------------------------------------------
diff --git a/samples/soap/pom.xml b/samples/soap/pom.xml
new file mode 100644
index 0000000..59801ad
--- /dev/null
+++ b/samples/soap/pom.xml
@@ -0,0 +1,45 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+ license agreements. See the NOTICE file distributed with this work for additional
+ information regarding copyright ownership. The ASF licenses this file to
+ you under the Apache License, Version 2.0 (the "License"); you may not use
+ this file except in compliance with the License. You may obtain a copy of
+ the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+ by applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ OF ANY KIND, either express or implied. See the License for the specific
+ language governing permissions and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>cxf-dosgi-samples-soap-parent</artifactId>
+ <packaging>pom</packaging>
+ <name>CXF DOSGi samples SOAP Parent</name>
+
+ <parent>
+ <groupId>org.apache.cxf.dosgi.samples</groupId>
+ <artifactId>cxf-dosgi-samples-parent</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <modules>
+ <module>api</module>
+ <module>impl</module>
+ <module>client</module>
+ </modules>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/ssl/README.md
----------------------------------------------------------------------
diff --git a/samples/ssl/README.md b/samples/ssl/README.md
index dce022a..d3c66e5 100644
--- a/samples/ssl/README.md
+++ b/samples/ssl/README.md
@@ -2,6 +2,10 @@
This example demonstrates how to configure ssl with a custom keystore and required key based client auth using a plain DOSGi service with a custom intent.
+The example reuses the soap example code. It then adds the ssl intent to the service impl by using a config. This prevents the service from starting up.
+
+We then install the ssl-intent bundle which implements the intent. This allows the service and client to start up.
+
## Karaf SSL config
We want the karaf HttpService to be secured by https and require a client certificate for authentication.
@@ -27,7 +31,7 @@ We want the karaf HttpService to be secured by https and require a client certif
keytool -importcert -storepass password -keystore etc/keystores/client.jks -alias serverKey -file server.cert
-- Copy the file org.ops4j.pax.web.cfg to the karaf etc dir.
+- Copy thes files in etc to the karaf etc dir
- Copy the keystores (*.jks) into the karaf etc directory.
## Installation
@@ -40,9 +44,10 @@ We want the karaf HttpService to be secured by https and require a client certif
feature:repo-add cxf-dosgi 2.0-SNAPSHOT
feature:install cxf-dosgi-provider-ws
-install -s mvn:org.apache.cxf.dosgi.samples/cxf-dosgi-ri-samples-ssl-interface/2.0_SNAPSHOT
-install -s mvn:org.apache.cxf.dosgi.samples/cxf-dosgi-ri-samples-ssl-impl/2.0-SNAPSHOT
-install -s mvn:org.apache.cxf.dosgi.samples/cxf-dosgi-ri-samples-ssl-client/2.0-SNAPSHOT
+install -s mvn:org.apache.cxf.dosgi.samples/cxf-dosgi-samples-soap-api/2.0_SNAPSHOT
+install -s mvn:org.apache.cxf.dosgi.samples/cxf-dosgi-samples-soap-impl/2.0-SNAPSHOT
+install -s mvn:org.apache.cxf.dosgi.samples/cxf-dosgi-samples-soap-client/2.0-SNAPSHOT
+install -s mvn:org.apache.cxf.dosgi.samples/cxf-dosgi-samples-ssl-intent/2.0-SNAPSHOT
```
# Test using browser
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/ssl/client/pom.xml
----------------------------------------------------------------------
diff --git a/samples/ssl/client/pom.xml b/samples/ssl/client/pom.xml
deleted file mode 100644
index dbea300..0000000
--- a/samples/ssl/client/pom.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version='1.0' encoding='UTF-8' ?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <artifactId>cxf-dosgi-ri-samples-ssl-client</artifactId>
- <packaging>bundle</packaging>
- <name>CXF DOSGi Greeter Bundle Client</name>
-
- <parent>
- <groupId>org.apache.cxf.dosgi.samples</groupId>
- <artifactId>cxf-dosgi-ri-samples-ssl-parent</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <properties>
- <topDirectoryLocation>../../..</topDirectoryLocation>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.cxf.dosgi.samples</groupId>
- <artifactId>cxf-dosgi-ri-samples-ssl-interface</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
-</project>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/ssl/client/src/main/java/org/apache/cxf/dosgi/samples/ssl/client/EchoClient.java
----------------------------------------------------------------------
diff --git a/samples/ssl/client/src/main/java/org/apache/cxf/dosgi/samples/ssl/client/EchoClient.java b/samples/ssl/client/src/main/java/org/apache/cxf/dosgi/samples/ssl/client/EchoClient.java
deleted file mode 100644
index 0b701e2..0000000
--- a/samples/ssl/client/src/main/java/org/apache/cxf/dosgi/samples/ssl/client/EchoClient.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.dosgi.samples.ssl.client;
-
-import org.apache.cxf.dosgi.samples.ssl.EchoService;
-import org.osgi.service.component.annotations.Activate;
-import org.osgi.service.component.annotations.Component;
-import org.osgi.service.component.annotations.Reference;
-
-@Component//
-(//
- immediate = true //
-)
-public class EchoClient {
- private EchoService echoService;
-
- @Activate
- public void activate() {
- System.out.println(echoService.echo("Hello"));
- }
-
- @Reference(target = "(service.imported=*)")
- public void setEchoService(EchoService echoService) {
- this.echoService = echoService;
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/ssl/etc/cxf.dosgi.sample.impl.cfg
----------------------------------------------------------------------
diff --git a/samples/ssl/etc/cxf.dosgi.sample.impl.cfg b/samples/ssl/etc/cxf.dosgi.sample.impl.cfg
new file mode 100644
index 0000000..37de3ca
--- /dev/null
+++ b/samples/ssl/etc/cxf.dosgi.sample.impl.cfg
@@ -0,0 +1 @@
+service.exported.intents=ssl
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/ssl/etc/org.ops4j.pax.web.cfg
----------------------------------------------------------------------
diff --git a/samples/ssl/etc/org.ops4j.pax.web.cfg b/samples/ssl/etc/org.ops4j.pax.web.cfg
new file mode 100644
index 0000000..8061c7f
--- /dev/null
+++ b/samples/ssl/etc/org.ops4j.pax.web.cfg
@@ -0,0 +1,12 @@
+# Configure pax web with a server key and allowed client cert
+javax.servlet.context.tempdir = ${karaf.home}/data/pax-web-jsp
+org.ops4j.pax.web.config.file = ${karaf.home}/etc/jetty.xml
+org.osgi.service.http.port = 8181
+org.osgi.service.http.secure.enabled=true
+org.ops4j.pax.web.ssl.keystore=etc/keystores/keystore.jks
+org.ops4j.pax.web.ssl.truststore=etc/keystores/keystore.jks
+org.ops4j.pax.web.ssl.password=password
+org.ops4j.pax.web.ssl.keypassword=password
+org.osgi.service.http.port.secure=8443
+org.ops4j.pax.web.ssl.clientauthneeded=true
+
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/ssl/impl/pom.xml
----------------------------------------------------------------------
diff --git a/samples/ssl/impl/pom.xml b/samples/ssl/impl/pom.xml
deleted file mode 100644
index 7a1025f..0000000
--- a/samples/ssl/impl/pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version='1.0' encoding='UTF-8' ?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <artifactId>cxf-dosgi-ri-samples-ssl-impl</artifactId>
- <packaging>bundle</packaging>
- <name>CXF DOSGi Greeter Implementation Bundle</name>
-
- <parent>
- <groupId>org.apache.cxf.dosgi.samples</groupId>
- <artifactId>cxf-dosgi-ri-samples-ssl-parent</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <properties>
- <topDirectoryLocation>..</topDirectoryLocation>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.cxf.dosgi.samples</groupId>
- <artifactId>cxf-dosgi-ri-samples-ssl-interface</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
-</project>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/ssl/impl/src/main/java/org/apache/cxf/dosgi/samples/ssl/impl/GreeterServiceImpl.java
----------------------------------------------------------------------
diff --git a/samples/ssl/impl/src/main/java/org/apache/cxf/dosgi/samples/ssl/impl/GreeterServiceImpl.java b/samples/ssl/impl/src/main/java/org/apache/cxf/dosgi/samples/ssl/impl/GreeterServiceImpl.java
deleted file mode 100644
index ba56916..0000000
--- a/samples/ssl/impl/src/main/java/org/apache/cxf/dosgi/samples/ssl/impl/GreeterServiceImpl.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.dosgi.samples.ssl.impl;
-
-import org.apache.cxf.dosgi.samples.ssl.EchoService;
-import org.osgi.service.component.annotations.Component;
-import org.osgi.service.remoteserviceadmin.RemoteConstants;
-
-@Component(//
- immediate = true, //
- property = //
- {
- "service.exported.interfaces=*", //
- "service.exported.configs=org.apache.cxf.ws", //
- "org.apache.cxf.ws.address=/echo", //
- RemoteConstants.SERVICE_EXPORTED_INTENTS + "=ssl"
- } //
-)
-public class GreeterServiceImpl implements EchoService {
-
- @Override
- public String echo(String msg) {
- return msg;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/ssl/interface/bnd.bnd
----------------------------------------------------------------------
diff --git a/samples/ssl/interface/bnd.bnd b/samples/ssl/interface/bnd.bnd
deleted file mode 100644
index a89d016..0000000
--- a/samples/ssl/interface/bnd.bnd
+++ /dev/null
@@ -1 +0,0 @@
-Export-Package: org.apache.cxf.dosgi.samples.ssl
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/ssl/interface/pom.xml
----------------------------------------------------------------------
diff --git a/samples/ssl/interface/pom.xml b/samples/ssl/interface/pom.xml
deleted file mode 100644
index d705a41..0000000
--- a/samples/ssl/interface/pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version='1.0' encoding='UTF-8' ?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <artifactId>cxf-dosgi-ri-samples-ssl-interface</artifactId>
- <packaging>bundle</packaging>
- <name>CXF DOSGi Greeter Interface Bundle</name>
-
- <parent>
- <groupId>org.apache.cxf.dosgi.samples</groupId>
- <artifactId>cxf-dosgi-ri-samples-ssl-parent</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <properties>
- <topDirectoryLocation>..</topDirectoryLocation>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-transports-http-jetty</artifactId>
- <version>${cxf.version}</version>
- </dependency>
- </dependencies>
-</project>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/ssl/interface/src/main/java/org/apache/cxf/dosgi/samples/ssl/EchoService.java
----------------------------------------------------------------------
diff --git a/samples/ssl/interface/src/main/java/org/apache/cxf/dosgi/samples/ssl/EchoService.java b/samples/ssl/interface/src/main/java/org/apache/cxf/dosgi/samples/ssl/EchoService.java
deleted file mode 100644
index 6669f24..0000000
--- a/samples/ssl/interface/src/main/java/org/apache/cxf/dosgi/samples/ssl/EchoService.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.dosgi.samples.ssl;
-
-public interface EchoService {
- String echo(String msg);
-}
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/ssl/interface/src/main/java/org/apache/cxf/dosgi/samples/ssl/SslIntent.java
----------------------------------------------------------------------
diff --git a/samples/ssl/interface/src/main/java/org/apache/cxf/dosgi/samples/ssl/SslIntent.java b/samples/ssl/interface/src/main/java/org/apache/cxf/dosgi/samples/ssl/SslIntent.java
deleted file mode 100644
index 558f7a7..0000000
--- a/samples/ssl/interface/src/main/java/org/apache/cxf/dosgi/samples/ssl/SslIntent.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.dosgi.samples.ssl;
-
-import static javax.net.ssl.KeyManagerFactory.getDefaultAlgorithm;
-
-import java.io.FileInputStream;
-import java.security.KeyStore;
-import java.util.Arrays;
-import java.util.List;
-import java.util.concurrent.Callable;
-
-import javax.net.ssl.HostnameVerifier;
-import javax.net.ssl.KeyManager;
-import javax.net.ssl.KeyManagerFactory;
-import javax.net.ssl.SSLSession;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.TrustManagerFactory;
-
-import org.apache.cxf.configuration.jsse.TLSClientParameters;
-import org.apache.cxf.transport.http.HttpConduitConfig;
-import org.apache.cxf.transport.http.HttpConduitFeature;
-import org.osgi.service.component.annotations.Component;
-
-/**
- * Configures the client side conduit to trust the server certificate and authenticate by using
- * a client certificate
- */
-@Component //
-(//
- property = "org.apache.cxf.dosgi.IntentName=ssl" //
-)
-public class SslIntent implements Callable<List<Object>> {
-
- private static final String CLIENT_PASSWORD = "password";
-
- @Override
- public List<Object> call() throws Exception {
- HttpConduitFeature conduitFeature = new HttpConduitFeature();
- HttpConduitConfig conduitConfig = new HttpConduitConfig();
- TLSClientParameters tls = new TLSClientParameters();
- String karafHome = System.getProperty("karaf.home");
- tls.setKeyManagers(keyManager(keystore(karafHome + "/etc/keystores/client.jks", CLIENT_PASSWORD),
- CLIENT_PASSWORD));
- tls.setTrustManagers(trustManager(keystore(karafHome + "/etc/keystores/client.jks", CLIENT_PASSWORD)));
- //tls.setTrustManagers(new TrustManager[]{new DefaultTrustManager()});
- HostnameVerifier verifier = new HostnameVerifier() {
-
- @Override
- public boolean verify(String hostname, SSLSession session) {
- return true;
- }
- };
- tls.setHostnameVerifier(verifier);
- tls.setCertAlias("clientkey");
- tls.setDisableCNCheck(true);
- conduitConfig.setTlsClientParameters(tls);
- conduitFeature.setConduitConfig(conduitConfig);
-
- return Arrays.asList((Object)conduitFeature);
- }
-
- private TrustManager[] trustManager(KeyStore ks) throws Exception {
- TrustManagerFactory factory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
- factory.init(ks);
- return factory.getTrustManagers();
- }
-
- private KeyManager[] keyManager(KeyStore ks, String keyPassword) throws Exception {
- KeyManagerFactory kmfactory = KeyManagerFactory.getInstance(getDefaultAlgorithm());
- kmfactory.init(ks, keyPassword.toCharArray());
- return kmfactory.getKeyManagers();
- }
-
- private KeyStore keystore(String keystorePath, String storePassword) throws Exception {
- KeyStore ks = KeyStore.getInstance("JKS");
- ks.load(new FileInputStream(keystorePath), storePassword.toCharArray());
- return ks;
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/ssl/org.ops4j.pax.web.cfg
----------------------------------------------------------------------
diff --git a/samples/ssl/org.ops4j.pax.web.cfg b/samples/ssl/org.ops4j.pax.web.cfg
deleted file mode 100644
index 8061c7f..0000000
--- a/samples/ssl/org.ops4j.pax.web.cfg
+++ /dev/null
@@ -1,12 +0,0 @@
-# Configure pax web with a server key and allowed client cert
-javax.servlet.context.tempdir = ${karaf.home}/data/pax-web-jsp
-org.ops4j.pax.web.config.file = ${karaf.home}/etc/jetty.xml
-org.osgi.service.http.port = 8181
-org.osgi.service.http.secure.enabled=true
-org.ops4j.pax.web.ssl.keystore=etc/keystores/keystore.jks
-org.ops4j.pax.web.ssl.truststore=etc/keystores/keystore.jks
-org.ops4j.pax.web.ssl.password=password
-org.ops4j.pax.web.ssl.keypassword=password
-org.osgi.service.http.port.secure=8443
-org.ops4j.pax.web.ssl.clientauthneeded=true
-
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/ssl/pom.xml
----------------------------------------------------------------------
diff --git a/samples/ssl/pom.xml b/samples/ssl/pom.xml
index e48404e..0fe4033 100644
--- a/samples/ssl/pom.xml
+++ b/samples/ssl/pom.xml
@@ -21,15 +21,15 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.cxf.dosgi.samples</groupId>
- <artifactId>cxf-dosgi-ri-samples-ssl-parent</artifactId>
+ <artifactId>cxf-dosgi-samples-ssl-parent</artifactId>
<packaging>pom</packaging>
<name>CXF DOSGi Greeter Bundles</name>
<parent>
- <groupId>org.apache.cxf.dosgi</groupId>
- <artifactId>cxf-dosgi-ri-parent</artifactId>
+ <groupId>org.apache.cxf.dosgi.samples</groupId>
+ <artifactId>cxf-dosgi-samples-parent</artifactId>
<version>2.0-SNAPSHOT</version>
- <relativePath>../../parent/pom.xml</relativePath>
+ <relativePath>../pom.xml</relativePath>
</parent>
<dependencies>
@@ -46,9 +46,6 @@
</dependencies>
<modules>
- <module>interface</module>
- <module>impl</module>
- <module>client</module>
+ <module>ssl-intent</module>
</modules>
-
</project>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/ssl/ssl-intent/bnd.bnd
----------------------------------------------------------------------
diff --git a/samples/ssl/ssl-intent/bnd.bnd b/samples/ssl/ssl-intent/bnd.bnd
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/ssl/ssl-intent/pom.xml
----------------------------------------------------------------------
diff --git a/samples/ssl/ssl-intent/pom.xml b/samples/ssl/ssl-intent/pom.xml
new file mode 100644
index 0000000..5c69ff5
--- /dev/null
+++ b/samples/ssl/ssl-intent/pom.xml
@@ -0,0 +1,45 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>cxf-dosgi-samples-ssl-intent</artifactId>
+ <packaging>bundle</packaging>
+ <name>CXF DOSGi Greeter Interface Bundle</name>
+
+ <parent>
+ <groupId>org.apache.cxf.dosgi.samples</groupId>
+ <artifactId>cxf-dosgi-samples-ssl-parent</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <properties>
+ <topDirectoryLocation>..</topDirectoryLocation>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-transports-http-jetty</artifactId>
+ <version>${cxf.version}</version>
+ </dependency>
+ </dependencies>
+</project>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/ssl/ssl-intent/src/main/java/org/apache/cxf/dosgi/samples/ssl/EchoService.java
----------------------------------------------------------------------
diff --git a/samples/ssl/ssl-intent/src/main/java/org/apache/cxf/dosgi/samples/ssl/EchoService.java b/samples/ssl/ssl-intent/src/main/java/org/apache/cxf/dosgi/samples/ssl/EchoService.java
new file mode 100644
index 0000000..6669f24
--- /dev/null
+++ b/samples/ssl/ssl-intent/src/main/java/org/apache/cxf/dosgi/samples/ssl/EchoService.java
@@ -0,0 +1,23 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.dosgi.samples.ssl;
+
+public interface EchoService {
+ String echo(String msg);
+}
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/ssl/ssl-intent/src/main/java/org/apache/cxf/dosgi/samples/ssl/SslIntent.java
----------------------------------------------------------------------
diff --git a/samples/ssl/ssl-intent/src/main/java/org/apache/cxf/dosgi/samples/ssl/SslIntent.java b/samples/ssl/ssl-intent/src/main/java/org/apache/cxf/dosgi/samples/ssl/SslIntent.java
new file mode 100644
index 0000000..558f7a7
--- /dev/null
+++ b/samples/ssl/ssl-intent/src/main/java/org/apache/cxf/dosgi/samples/ssl/SslIntent.java
@@ -0,0 +1,98 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.dosgi.samples.ssl;
+
+import static javax.net.ssl.KeyManagerFactory.getDefaultAlgorithm;
+
+import java.io.FileInputStream;
+import java.security.KeyStore;
+import java.util.Arrays;
+import java.util.List;
+import java.util.concurrent.Callable;
+
+import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.KeyManager;
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.SSLSession;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.TrustManagerFactory;
+
+import org.apache.cxf.configuration.jsse.TLSClientParameters;
+import org.apache.cxf.transport.http.HttpConduitConfig;
+import org.apache.cxf.transport.http.HttpConduitFeature;
+import org.osgi.service.component.annotations.Component;
+
+/**
+ * Configures the client side conduit to trust the server certificate and authenticate by using
+ * a client certificate
+ */
+@Component //
+(//
+ property = "org.apache.cxf.dosgi.IntentName=ssl" //
+)
+public class SslIntent implements Callable<List<Object>> {
+
+ private static final String CLIENT_PASSWORD = "password";
+
+ @Override
+ public List<Object> call() throws Exception {
+ HttpConduitFeature conduitFeature = new HttpConduitFeature();
+ HttpConduitConfig conduitConfig = new HttpConduitConfig();
+ TLSClientParameters tls = new TLSClientParameters();
+ String karafHome = System.getProperty("karaf.home");
+ tls.setKeyManagers(keyManager(keystore(karafHome + "/etc/keystores/client.jks", CLIENT_PASSWORD),
+ CLIENT_PASSWORD));
+ tls.setTrustManagers(trustManager(keystore(karafHome + "/etc/keystores/client.jks", CLIENT_PASSWORD)));
+ //tls.setTrustManagers(new TrustManager[]{new DefaultTrustManager()});
+ HostnameVerifier verifier = new HostnameVerifier() {
+
+ @Override
+ public boolean verify(String hostname, SSLSession session) {
+ return true;
+ }
+ };
+ tls.setHostnameVerifier(verifier);
+ tls.setCertAlias("clientkey");
+ tls.setDisableCNCheck(true);
+ conduitConfig.setTlsClientParameters(tls);
+ conduitFeature.setConduitConfig(conduitConfig);
+
+ return Arrays.asList((Object)conduitFeature);
+ }
+
+ private TrustManager[] trustManager(KeyStore ks) throws Exception {
+ TrustManagerFactory factory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
+ factory.init(ks);
+ return factory.getTrustManagers();
+ }
+
+ private KeyManager[] keyManager(KeyStore ks, String keyPassword) throws Exception {
+ KeyManagerFactory kmfactory = KeyManagerFactory.getInstance(getDefaultAlgorithm());
+ kmfactory.init(ks, keyPassword.toCharArray());
+ return kmfactory.getKeyManagers();
+ }
+
+ private KeyStore keystore(String keystorePath, String storePassword) throws Exception {
+ KeyStore ks = KeyStore.getInstance("JKS");
+ ks.load(new FileInputStream(keystorePath), storePassword.toCharArray());
+ return ks;
+ }
+
+
+}
[2/2] cxf-dosgi git commit: [DOSGI-249] Redesign examples
Posted by cs...@apache.org.
[DOSGI-249] Redesign examples
Project: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/commit/37cf7d35
Tree: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/tree/37cf7d35
Diff: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/diff/37cf7d35
Branch: refs/heads/master
Commit: 37cf7d355972229658033d48543002775114a021
Parents: abdd741
Author: Christian Schneider <ch...@die-schneider.net>
Authored: Fri Aug 12 18:06:51 2016 +0200
Committer: Christian Schneider <ch...@die-schneider.net>
Committed: Fri Aug 12 18:06:51 2016 +0200
----------------------------------------------------------------------
common/pom.xml | 2 +-
decorator/pom.xml | 2 +-
provider-rs/pom.xml | 2 +-
provider-ws/pom.xml | 2 +-
samples/ds/client/pom.xml | 36 -------
.../samples/ds/consumer/AdderConsumer.java | 39 --------
.../OSGI-INF/remote-service/remote-services.xml | 26 ------
samples/ds/impl/pom.xml | 44 ---------
.../dosgi/samples/ds/impl/AdderServiceImpl.java | 39 --------
samples/ds/interface/bnd.bnd | 1 -
samples/ds/interface/pom.xml | 37 --------
.../cxf/dosgi/samples/ds/AdderService.java | 23 -----
samples/ds/pom.xml | 47 ----------
samples/features/pom.xml | 83 +++++++++++++++++
.../features/src/main/resources/features.xml | 33 +++++++
samples/greeter/client/pom.xml | 48 ----------
.../samples/greeter/client/GreeterClient.java | 48 ----------
.../samples/greeter/client/GreeterDataImpl.java | 46 ---------
.../OSGI-INF/cxf/intents/intent-map.xml | 75 ---------------
.../OSGI-INF/remote-service/remote-services.xml | 27 ------
samples/greeter/impl/pom.xml | 45 ---------
.../greeter/impl/GreeterServiceImpl.java | 69 --------------
samples/greeter/interface/bnd.bnd | 1 -
samples/greeter/interface/pom.xml | 38 --------
.../cxf/dosgi/samples/greeter/GreeterData.java | 25 -----
.../dosgi/samples/greeter/GreeterException.java | 45 ---------
.../dosgi/samples/greeter/GreeterService.java | 26 ------
.../dosgi/samples/greeter/GreetingPhrase.java | 50 ----------
samples/greeter/pom.xml | 54 -----------
samples/greeter_rest/client/pom.xml | 38 --------
.../greeter/client/rest/GreeterClient.java | 46 ---------
.../OSGI-INF/remote-service/remote-services.xml | 24 -----
samples/greeter_rest/impl/pom.xml | 46 ---------
.../greeter/impl/rest/GreeterServiceImpl.java | 57 ------------
samples/greeter_rest/interface/bnd.bnd | 1 -
samples/greeter_rest/interface/pom.xml | 51 ----------
.../samples/greeter/rest/GreeterException.java | 45 ---------
.../dosgi/samples/greeter/rest/GreeterInfo.java | 37 --------
.../samples/greeter/rest/GreeterService.java | 31 -------
.../samples/greeter/rest/GreetingPhrase.java | 64 -------------
.../cxf/jaxrs/GreeterService2-model.xml | 7 --
samples/greeter_rest/pom.xml | 47 ----------
samples/pom.xml | 10 +-
samples/rest/README.md | 42 +++++++++
samples/rest/api/bnd.bnd | 1 +
samples/rest/api/pom.xml | 51 ++++++++++
.../org/apache/cxf/dosgi/samples/rest/Task.java | 83 +++++++++++++++++
.../cxf/dosgi/samples/rest/TaskResource.java | 44 +++++++++
.../cxf/jaxrs/GreeterService2-model.xml | 7 ++
samples/rest/client/pom.xml | 38 ++++++++
.../rest/client/TaskResourceCommand.java | 63 +++++++++++++
.../OSGI-INF/remote-service/remote-services.xml | 24 +++++
samples/rest/impl/pom.xml | 44 +++++++++
.../samples/rest/impl/TaskServiceImpl.java | 74 +++++++++++++++
samples/rest/pom.xml | 47 ++++++++++
samples/security_filter/bnd.bnd | 1 -
samples/security_filter/pom.xml | 4 +-
.../cxf/dosgi/samples/security/Activator.java | 65 -------------
.../samples/security/SampleSecurityFilter.java | 14 ++-
.../samples/security/SecureRestEndpoint.java | 12 +++
samples/soap/README.md | 42 +++++++++
samples/soap/api/bnd.bnd | 1 +
samples/soap/api/pom.xml | 38 ++++++++
.../org/apache/cxf/dosgi/samples/soap/Task.java | 83 +++++++++++++++++
.../cxf/dosgi/samples/soap/TaskService.java | 34 +++++++
samples/soap/client/bnd.bnd | 1 +
samples/soap/client/pom.xml | 37 ++++++++
.../samples/soap/client/TaskServiceCommand.java | 65 +++++++++++++
samples/soap/impl/pom.xml | 45 +++++++++
.../samples/soap/impl/TaskServiceImpl.java | 77 +++++++++++++++
samples/soap/pom.xml | 45 +++++++++
samples/ssl/README.md | 13 ++-
samples/ssl/client/pom.xml | 46 ---------
.../dosgi/samples/ssl/client/EchoClient.java | 42 ---------
samples/ssl/etc/cxf.dosgi.sample.impl.cfg | 1 +
samples/ssl/etc/org.ops4j.pax.web.cfg | 12 +++
samples/ssl/impl/pom.xml | 45 ---------
.../samples/ssl/impl/GreeterServiceImpl.java | 42 ---------
samples/ssl/interface/bnd.bnd | 1 -
samples/ssl/interface/pom.xml | 45 ---------
.../cxf/dosgi/samples/ssl/EchoService.java | 23 -----
.../apache/cxf/dosgi/samples/ssl/SslIntent.java | 98 --------------------
samples/ssl/org.ops4j.pax.web.cfg | 12 ---
samples/ssl/pom.xml | 13 +--
samples/ssl/ssl-intent/bnd.bnd | 0
samples/ssl/ssl-intent/pom.xml | 45 +++++++++
.../cxf/dosgi/samples/ssl/EchoService.java | 23 +++++
.../apache/cxf/dosgi/samples/ssl/SslIntent.java | 98 ++++++++++++++++++++
88 files changed, 1330 insertions(+), 1828 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/common/pom.xml
----------------------------------------------------------------------
diff --git a/common/pom.xml b/common/pom.xml
index 8e7e136..cf06052 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -22,7 +22,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>cxf-dosgi-ri-common</artifactId>
<packaging>bundle</packaging>
- <name>CXF dOSGi Common</name>
+ <name>CXF DOSGi Common</name>
<parent>
<groupId>org.apache.cxf.dosgi</groupId>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/decorator/pom.xml
----------------------------------------------------------------------
diff --git a/decorator/pom.xml b/decorator/pom.xml
index 9e37865..495124f 100644
--- a/decorator/pom.xml
+++ b/decorator/pom.xml
@@ -22,7 +22,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>cxf-dosgi-ri-decorator</artifactId>
<packaging>bundle</packaging>
- <name>CXF dOSGi Service decorator support</name>
+ <name>CXF DOSGi Service decorator support</name>
<parent>
<groupId>org.apache.cxf.dosgi</groupId>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/provider-rs/pom.xml
----------------------------------------------------------------------
diff --git a/provider-rs/pom.xml b/provider-rs/pom.xml
index 4efa32a..0a097c7 100644
--- a/provider-rs/pom.xml
+++ b/provider-rs/pom.xml
@@ -22,7 +22,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>cxf-dosgi-ri-provider-rs</artifactId>
<packaging>bundle</packaging>
- <name>CXF dOSGi provider rs</name>
+ <name>CXF DOSGi provider rs</name>
<parent>
<groupId>org.apache.cxf.dosgi</groupId>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/provider-ws/pom.xml
----------------------------------------------------------------------
diff --git a/provider-ws/pom.xml b/provider-ws/pom.xml
index 21e741f..e816f2c 100644
--- a/provider-ws/pom.xml
+++ b/provider-ws/pom.xml
@@ -22,7 +22,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>cxf-dosgi-ri-provider-ws</artifactId>
<packaging>bundle</packaging>
- <name>CXF dOSGi provider ws</name>
+ <name>CXF DOSGi provider ws</name>
<parent>
<groupId>org.apache.cxf.dosgi</groupId>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/ds/client/pom.xml
----------------------------------------------------------------------
diff --git a/samples/ds/client/pom.xml b/samples/ds/client/pom.xml
deleted file mode 100644
index dd06083..0000000
--- a/samples/ds/client/pom.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version='1.0' encoding='UTF-8' ?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
- license agreements. See the NOTICE file distributed with this work for additional
- information regarding copyright ownership. The ASF licenses this file to
- you under the Apache License, Version 2.0 (the "License"); you may not use
- this file except in compliance with the License. You may obtain a copy of
- the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
- by applicable law or agreed to in writing, software distributed under the
- License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
- OF ANY KIND, either express or implied. See the License for the specific
- language governing permissions and limitations under the License. -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <artifactId>cxf-dosgi-ri-samples-ds-client</artifactId>
- <packaging>bundle</packaging>
- <name>CXF DOSGi DS Client</name>
-
- <parent>
- <groupId>org.apache.cxf.dosgi.samples</groupId>
- <artifactId>cxf-dosgi-ri-samples-ds-parent</artifactId>
- <version>2.0-SNAPSHOT</version>
- </parent>
-
- <properties>
- <topDirectoryLocation>..</topDirectoryLocation>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.cxf.dosgi.samples</groupId>
- <artifactId>cxf-dosgi-ri-samples-ds-interface</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
-</project>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/ds/client/src/main/java/org/apache/cxf/dosgi/samples/ds/consumer/AdderConsumer.java
----------------------------------------------------------------------
diff --git a/samples/ds/client/src/main/java/org/apache/cxf/dosgi/samples/ds/consumer/AdderConsumer.java b/samples/ds/client/src/main/java/org/apache/cxf/dosgi/samples/ds/consumer/AdderConsumer.java
deleted file mode 100644
index 4c96ea2..0000000
--- a/samples/ds/client/src/main/java/org/apache/cxf/dosgi/samples/ds/consumer/AdderConsumer.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.dosgi.samples.ds.consumer;
-
-import org.apache.cxf.dosgi.samples.ds.AdderService;
-import org.osgi.service.component.annotations.Component;
-import org.osgi.service.component.annotations.Reference;
-
-@Component
-public class AdderConsumer {
-
- private AdderService adder;
-
- public void start() {
- System.out.println("Declarative Service consumer component.");
- System.out.println("Using adder service: 1 + 1 = " + adder.add(1, 1));
- }
-
- @Reference
- public void setAdder(AdderService adder) {
- this.adder = adder;
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/ds/client/src/main/resources/OSGI-INF/remote-service/remote-services.xml
----------------------------------------------------------------------
diff --git a/samples/ds/client/src/main/resources/OSGI-INF/remote-service/remote-services.xml b/samples/ds/client/src/main/resources/OSGI-INF/remote-service/remote-services.xml
deleted file mode 100644
index e1f0b21..0000000
--- a/samples/ds/client/src/main/resources/OSGI-INF/remote-service/remote-services.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to you under the Apache License, Version
- 2.0 (the "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0 Unless required by
- applicable law or agreed to in writing, software distributed under
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
- OR CONDITIONS OF ANY KIND, either express or implied. See the
- License for the specific language governing permissions and
- limitations under the License.
- -->
-<endpoint-descriptions xmlns="http://www.osgi.org/xmlns/rsa/v1.0.0">
- <endpoint-description>
- <property name="objectClass">
- <array>
- <value>org.apache.cxf.dosgi.samples.ds.AdderService</value>
- </array>
- </property>
- <property name="endpoint.id">http://localhost:9090/adder</property>
- <property name="service.imported.configs">org.apache.cxf.ws</property>
- </endpoint-description>
-</endpoint-descriptions>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/ds/impl/pom.xml
----------------------------------------------------------------------
diff --git a/samples/ds/impl/pom.xml b/samples/ds/impl/pom.xml
deleted file mode 100644
index 126630e..0000000
--- a/samples/ds/impl/pom.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version='1.0' encoding='UTF-8' ?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <artifactId>cxf-dosgi-ri-samples-ds-impl</artifactId>
- <packaging>bundle</packaging>
-
- <parent>
- <groupId>org.apache.cxf.dosgi.samples</groupId>
- <artifactId>cxf-dosgi-ri-samples-ds-parent</artifactId>
- <version>2.0-SNAPSHOT</version>
- </parent>
-
- <properties>
- <topDirectoryLocation>..</topDirectoryLocation>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.cxf.dosgi.samples</groupId>
- <artifactId>cxf-dosgi-ri-samples-ds-interface</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
- <name>CXF DOSGi DS Sample Impl</name>
-</project>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/ds/impl/src/main/java/org/apache/cxf/dosgi/samples/ds/impl/AdderServiceImpl.java
----------------------------------------------------------------------
diff --git a/samples/ds/impl/src/main/java/org/apache/cxf/dosgi/samples/ds/impl/AdderServiceImpl.java b/samples/ds/impl/src/main/java/org/apache/cxf/dosgi/samples/ds/impl/AdderServiceImpl.java
deleted file mode 100644
index 3d65d3e..0000000
--- a/samples/ds/impl/src/main/java/org/apache/cxf/dosgi/samples/ds/impl/AdderServiceImpl.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.dosgi.samples.ds.impl;
-
-import org.apache.cxf.dosgi.samples.ds.AdderService;
-import org.osgi.service.component.annotations.Component;
-
-@Component(immediate = true, //
- property = //
- {
- "service.exported.interfaces=*", //
- "service.exported.configs=org.apache.cxf.ws", //
- "org.apache.cxf.ws.address=http://localhost:9090/adder" //
- } //
-)
-public class AdderServiceImpl implements AdderService {
-
- public int add(int a, int b) {
- int result = a + b;
- System.out.println("Adder service invoked: " + a + " + " + b + " = " + result);
- return result;
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/ds/interface/bnd.bnd
----------------------------------------------------------------------
diff --git a/samples/ds/interface/bnd.bnd b/samples/ds/interface/bnd.bnd
deleted file mode 100644
index 0bf50d5..0000000
--- a/samples/ds/interface/bnd.bnd
+++ /dev/null
@@ -1 +0,0 @@
-Export-Package: org.apache.cxf.dosgi.samples.ds
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/ds/interface/pom.xml
----------------------------------------------------------------------
diff --git a/samples/ds/interface/pom.xml b/samples/ds/interface/pom.xml
deleted file mode 100644
index 1585fc9..0000000
--- a/samples/ds/interface/pom.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version='1.0' encoding='UTF-8' ?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <artifactId>cxf-dosgi-ri-samples-ds-interface</artifactId>
- <packaging>bundle</packaging>
- <name>CXF DOSGi DS Sample Interface</name>
-
- <parent>
- <groupId>org.apache.cxf.dosgi.samples</groupId>
- <artifactId>cxf-dosgi-ri-samples-ds-parent</artifactId>
- <version>2.0-SNAPSHOT</version>
- </parent>
-
- <properties>
- <topDirectoryLocation>..</topDirectoryLocation>
- </properties>
-
-</project>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/ds/interface/src/main/java/org/apache/cxf/dosgi/samples/ds/AdderService.java
----------------------------------------------------------------------
diff --git a/samples/ds/interface/src/main/java/org/apache/cxf/dosgi/samples/ds/AdderService.java b/samples/ds/interface/src/main/java/org/apache/cxf/dosgi/samples/ds/AdderService.java
deleted file mode 100644
index f5e77fc..0000000
--- a/samples/ds/interface/src/main/java/org/apache/cxf/dosgi/samples/ds/AdderService.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.dosgi.samples.ds;
-
-public interface AdderService {
- int add(int a, int b);
-}
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/ds/pom.xml
----------------------------------------------------------------------
diff --git a/samples/ds/pom.xml b/samples/ds/pom.xml
deleted file mode 100644
index e52588f..0000000
--- a/samples/ds/pom.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version='1.0' encoding='UTF-8' ?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
- license agreements. See the NOTICE file distributed with this work for additional
- information regarding copyright ownership. The ASF licenses this file to
- you under the Apache License, Version 2.0 (the "License"); you may not use
- this file except in compliance with the License. You may obtain a copy of
- the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
- by applicable law or agreed to in writing, software distributed under the
- License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
- OF ANY KIND, either express or implied. See the License for the specific
- language governing permissions and limitations under the License. -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.cxf.dosgi.samples</groupId>
- <artifactId>cxf-dosgi-ri-samples-ds-parent</artifactId>
- <packaging>pom</packaging>
- <name>CXF DOSGi DS Sample</name>
- <version>2.0-SNAPSHOT</version>
-
- <parent>
- <groupId>org.apache.cxf.dosgi</groupId>
- <artifactId>cxf-dosgi-ri-parent</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../../parent/pom.xml</relativePath>
- </parent>
-
- <modules>
- <module>interface</module>
- <module>impl</module>
- <module>client</module>
- </modules>
-
- <dependencies>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
-</project>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/features/pom.xml
----------------------------------------------------------------------
diff --git a/samples/features/pom.xml b/samples/features/pom.xml
new file mode 100644
index 0000000..15685ce
--- /dev/null
+++ b/samples/features/pom.xml
@@ -0,0 +1,83 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+ license agreements. See the NOTICE file distributed with this work for additional
+ information regarding copyright ownership. The ASF licenses this file to
+ you under the Apache License, Version 2.0 (the "License"); you may not use
+ this file except in compliance with the License. You may obtain a copy of
+ the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+ by applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ OF ANY KIND, either express or implied. See the License for the specific
+ language governing permissions and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>cxf-dosgi-samples</artifactId>
+ <packaging>pom</packaging>
+ <name>CXF DOSGI Samples Features</name>
+
+ <parent>
+ <groupId>org.apache.cxf.dosgi.samples</groupId>
+ <artifactId>cxf-dosgi-samples-parent</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <properties>
+ <topDirectoryLocation>../..</topDirectoryLocation>
+ </properties>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>${project.basedir}/src/main/resources</directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>**/features.xml</include>
+ <include>**/*.cfg</include>
+ <include>**/*.properties</include>
+ </includes>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>filter</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>resources</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.12</version>
+ <executions>
+ <execution>
+ <id>attach-artifacts</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <configuration>
+ <artifacts>
+ <artifact>
+ <file>target/classes/features.xml</file>
+ <type>xml</type>
+ <classifier>features</classifier>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <groupId>org.apache.cxf.dosgi</groupId>
+</project>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/features/src/main/resources/features.xml
----------------------------------------------------------------------
diff --git a/samples/features/src/main/resources/features.xml b/samples/features/src/main/resources/features.xml
new file mode 100644
index 0000000..58b9c91
--- /dev/null
+++ b/samples/features/src/main/resources/features.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="cxf-dosgi-${project.version}">
+ <repository>mvn:org.apache.cxf.dosgi/cxf-dosgi/${project.version}/xml/features</repository>
+
+ <feature name="cxf-dosgi-sample-soap-impl" version="${project.version}">
+ <feature>cxf-dosgi-provider-ws</feature>
+ <feature>aries-rsa-discovery-zookeeper-server</feature>
+ <bundle>mvn:org.apache.cxf.dosgi.samples/cxf-dosgi-samples-soap-api/${project.version}</bundle>
+ <bundle>mvn:org.apache.cxf.dosgi.samples/cxf-dosgi-samples-soap-impl/${project.version}</bundle>
+ </feature>
+
+ <feature name="cxf-dosgi-sample-soap-client" version="${project.version}">
+ <feature>cxf-dosgi-provider-ws</feature>
+ <feature>aries-rsa-discovery-zookeeper</feature>
+ <bundle>mvn:org.apache.cxf.dosgi.samples/cxf-dosgi-samples-soap-api/${project.version}</bundle>
+ <bundle>mvn:org.apache.cxf.dosgi.samples/cxf-dosgi-samples-soap-client/${project.version}</bundle>
+ </feature>
+
+ <feature name="cxf-dosgi-sample-rest-impl" version="${project.version}">
+ <feature>cxf-dosgi-provider-rs</feature>
+ <feature>aries-rsa-discovery-zookeeper-server</feature>
+ <bundle>mvn:org.apache.cxf.dosgi.samples/cxf-dosgi-samples-rest-api/${project.version}</bundle>
+ <bundle>mvn:org.apache.cxf.dosgi.samples/cxf-dosgi-samples-rest-impl/${project.version}</bundle>
+ </feature>
+
+ <feature name="cxf-dosgi-sample-rest-client" version="${project.version}">
+ <feature>cxf-dosgi-provider-rs</feature>
+ <feature>aries-rsa-discovery-zookeeper</feature>
+ <bundle>mvn:org.apache.cxf.dosgi.samples/cxf-dosgi-samples-rest-api/${project.version}</bundle>
+ <bundle>mvn:org.apache.cxf.dosgi.samples/cxf-dosgi-samples-rest-client/${project.version}</bundle>
+ </feature>
+
+</features>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/greeter/client/pom.xml
----------------------------------------------------------------------
diff --git a/samples/greeter/client/pom.xml b/samples/greeter/client/pom.xml
deleted file mode 100644
index da9fe5a..0000000
--- a/samples/greeter/client/pom.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version='1.0' encoding='UTF-8' ?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <artifactId>cxf-dosgi-ri-samples-greeter-client</artifactId>
- <packaging>bundle</packaging>
- <name>CXF DOSGi Greeter Bundle Client</name>
-
- <parent>
- <groupId>org.apache.cxf.dosgi.samples</groupId>
- <artifactId>cxf-dosgi-ri-samples-greeter-parent</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <properties>
- <bundle.import.package>*</bundle.import.package>
- <bundle.private.package>org.apache.cxf.dosgi.samples.greeter.client</bundle.private.package>
- <topDirectoryLocation>../../..</topDirectoryLocation>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.cxf.dosgi.samples</groupId>
- <artifactId>cxf-dosgi-ri-samples-greeter-interface</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
-</project>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/greeter/client/src/main/java/org/apache/cxf/dosgi/samples/greeter/client/GreeterClient.java
----------------------------------------------------------------------
diff --git a/samples/greeter/client/src/main/java/org/apache/cxf/dosgi/samples/greeter/client/GreeterClient.java b/samples/greeter/client/src/main/java/org/apache/cxf/dosgi/samples/greeter/client/GreeterClient.java
deleted file mode 100644
index 0d7e267..0000000
--- a/samples/greeter/client/src/main/java/org/apache/cxf/dosgi/samples/greeter/client/GreeterClient.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.dosgi.samples.greeter.client;
-
-import java.util.Map;
-
-import org.apache.cxf.dosgi.samples.greeter.GreeterException;
-import org.apache.cxf.dosgi.samples.greeter.GreeterService;
-import org.apache.cxf.dosgi.samples.greeter.GreetingPhrase;
-import org.osgi.service.component.annotations.Activate;
-import org.osgi.service.component.annotations.Component;
-import org.osgi.service.component.annotations.Reference;
-
-@Component
-public class GreeterClient {
- private GreeterService greeterService;
-
- @Activate
- public void activate() throws GreeterException {
- Map<GreetingPhrase, String> greetings = greeterService.greetMe("Christian");
- for (GreetingPhrase phrase : greetings.keySet()) {
- System.out.println(phrase.getPhrase());
- }
-
- }
-
- @Reference
- public void setGreeterService(GreeterService greeterService) {
- this.greeterService = greeterService;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/greeter/client/src/main/java/org/apache/cxf/dosgi/samples/greeter/client/GreeterDataImpl.java
----------------------------------------------------------------------
diff --git a/samples/greeter/client/src/main/java/org/apache/cxf/dosgi/samples/greeter/client/GreeterDataImpl.java b/samples/greeter/client/src/main/java/org/apache/cxf/dosgi/samples/greeter/client/GreeterDataImpl.java
deleted file mode 100644
index 368be36..0000000
--- a/samples/greeter/client/src/main/java/org/apache/cxf/dosgi/samples/greeter/client/GreeterDataImpl.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.dosgi.samples.greeter.client;
-
-import org.apache.cxf.dosgi.samples.greeter.GreeterData;
-
-public class GreeterDataImpl implements GreeterData {
-
- private final String name;
- private final int age;
- private final boolean exception;
-
- public GreeterDataImpl(String n, int a, boolean b) {
- name = n;
- age = a;
- exception = b;
- }
-
- public String getName() {
- return name;
- }
-
- public int getAge() {
- return age;
- }
-
- public boolean isException() {
- return exception;
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/greeter/client/src/main/resources/OSGI-INF/cxf/intents/intent-map.xml
----------------------------------------------------------------------
diff --git a/samples/greeter/client/src/main/resources/OSGI-INF/cxf/intents/intent-map.xml b/samples/greeter/client/src/main/resources/OSGI-INF/cxf/intents/intent-map.xml
deleted file mode 100644
index 026bf13..0000000
--- a/samples/greeter/client/src/main/resources/OSGI-INF/cxf/intents/intent-map.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:p="http://cxf.apache.org/policy"
- xmlns:wsp="http://www.w3.org/ns/ws-policy"
- xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
- xmlns:http="http://cxf.apache.org/transports/http/configuration"
- xmlns:wsrm-policy="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"
- xsi:schemaLocation="
- http://cxf.apache.org/policy http://cxf.apache.org/schemas/policy.xsd
- http://www.w3.org/ns/ws-policy http://www.w3.org/2007/02/ws-policy.xsd
- http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd
- http://schemas.xmlsoap.org/ws/2005/02/rm/policy http://schemas.xmlsoap.org/ws/2005/02/rm/wsrm-policy.xsd
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
-
- <bean id="intentMap" class="org.apache.cxf.dosgi.dsw.qos.IntentMap">
- <property name="intents">
- <map>
- <entry key="reliability" value-ref="reliableMessaging"/>
- <entry key="decoupled" value-ref="decoupledAddressing"/>
- </map>
- </property>
- </bean>
-
- <p:policies id="reliableMessaging">
- <wsp:PolicyReference URI="#ReliabilityPolicy"/>
- <wsp:PolicyReference URI="#DecoupledPolicy"/>
- <wsp:PolicyReference URI="#AddressingPolicy"/>
- </p:policies>
-
- <p:policies id="decoupledAddressing">
- <wsp:PolicyReference URI="#DecoupledPolicy"/>
- <wsp:PolicyReference URI="#AddressingPolicy"/>
- </p:policies>
-
- <wsp:Policy wsu:Id="ReliabilityPolicy">
- <wsrm-policy:RMAssertion>
- <wsrm-policy:BaseRetransmissionInterval Milliseconds="4000"/>
- <wsrm-policy:AcknowledgementInterval Milliseconds="2000" />
- </wsrm-policy:RMAssertion>
- </wsp:Policy>
-
- <wsp:Policy wsu:Id="DecoupledPolicy">
- <wsp:ExactlyOne>
- <http:client DecoupledEndpoint="http://localhost:9970/decoupled_endpoint"/>
- </wsp:ExactlyOne>
- </wsp:Policy>
-
- <wsp:Policy wsu:Id="AddressingPolicy"
- xmlns:wsam="http://www.w3.org/2007/02/addressing/metadata">
- <wsam:Addressing>
- <wsp:Policy />
- </wsam:Addressing>
- </wsp:Policy>
-
-</beans>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/greeter/client/src/main/resources/OSGI-INF/remote-service/remote-services.xml
----------------------------------------------------------------------
diff --git a/samples/greeter/client/src/main/resources/OSGI-INF/remote-service/remote-services.xml b/samples/greeter/client/src/main/resources/OSGI-INF/remote-service/remote-services.xml
deleted file mode 100644
index af3486e..0000000
--- a/samples/greeter/client/src/main/resources/OSGI-INF/remote-service/remote-services.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to you under the Apache License, Version
- 2.0 (the "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0 Unless required by
- applicable law or agreed to in writing, software distributed under
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
- OR CONDITIONS OF ANY KIND, either express or implied. See the
- License for the specific language governing permissions and
- limitations under the License.
- -->
-<endpoint-descriptions xmlns="http://www.osgi.org/xmlns/rsa/v1.0.0">
- <endpoint-description>
- <property name="objectClass">
- <array>
- <value>org.apache.cxf.dosgi.samples.greeter.GreeterService</value>
- </array>
- </property>
- <property name="endpoint.id">http://localhost:9090/greeter</property>
- <property name="service.imported.configs">org.apache.cxf.ws</property>
- </endpoint-description>
-</endpoint-descriptions>
-
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/greeter/impl/pom.xml
----------------------------------------------------------------------
diff --git a/samples/greeter/impl/pom.xml b/samples/greeter/impl/pom.xml
deleted file mode 100644
index e76e282..0000000
--- a/samples/greeter/impl/pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version='1.0' encoding='UTF-8' ?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <artifactId>cxf-dosgi-ri-samples-greeter-impl</artifactId>
- <packaging>bundle</packaging>
- <name>CXF DOSGi Greeter Implementation Bundle</name>
-
- <parent>
- <groupId>org.apache.cxf.dosgi.samples</groupId>
- <artifactId>cxf-dosgi-ri-samples-greeter-parent</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <properties>
- <topDirectoryLocation>..</topDirectoryLocation>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.cxf.dosgi.samples</groupId>
- <artifactId>cxf-dosgi-ri-samples-greeter-interface</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
-</project>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/greeter/impl/src/main/java/org/apache/cxf/dosgi/samples/greeter/impl/GreeterServiceImpl.java
----------------------------------------------------------------------
diff --git a/samples/greeter/impl/src/main/java/org/apache/cxf/dosgi/samples/greeter/impl/GreeterServiceImpl.java b/samples/greeter/impl/src/main/java/org/apache/cxf/dosgi/samples/greeter/impl/GreeterServiceImpl.java
deleted file mode 100644
index dde220e..0000000
--- a/samples/greeter/impl/src/main/java/org/apache/cxf/dosgi/samples/greeter/impl/GreeterServiceImpl.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.dosgi.samples.greeter.impl;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.cxf.dosgi.samples.greeter.GreeterData;
-import org.apache.cxf.dosgi.samples.greeter.GreeterException;
-import org.apache.cxf.dosgi.samples.greeter.GreeterService;
-import org.apache.cxf.dosgi.samples.greeter.GreetingPhrase;
-import org.osgi.service.component.annotations.Component;
-
-@Component(//
- immediate = true, //
- property = //
- {
- "service.exported.interfaces=*", //
- "service.exported.configs=org.apache.cxf.ws", //
- "org.apache.cxf.ws.address=http://localhost:9090/greeter" //
- } //
-)
-public class GreeterServiceImpl implements GreeterService {
-
- public Map<GreetingPhrase, String> greetMe(String name) {
- System.out.println("Invoking: greetMe(" + name + ")");
-
- Map<GreetingPhrase, String> greetings = new HashMap<GreetingPhrase, String>();
-
- greetings.put(new GreetingPhrase("Hello"), name);
- greetings.put(new GreetingPhrase("Hoi"), name);
- greetings.put(new GreetingPhrase("Hola"), name);
- greetings.put(new GreetingPhrase("Bonjour"), name);
-
- return greetings;
- }
-
- public GreetingPhrase[] greetMe(GreeterData gd) throws GreeterException {
- if (gd.isException()) {
- System.out.println("Throwing custom exception from: greetMe(" + gd.getName() + ")");
- throw new GreeterException(gd.getName());
- }
-
- String details = gd.getName() + "(" + gd.getAge() + ")";
- System.out.println("Invoking: greetMe(" + details + ")");
-
- return new GreetingPhrase[] {
- new GreetingPhrase("Howdy " + details), //
- new GreetingPhrase("Hallo " + details), //
- new GreetingPhrase("Ni hao " + details)
- };
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/greeter/interface/bnd.bnd
----------------------------------------------------------------------
diff --git a/samples/greeter/interface/bnd.bnd b/samples/greeter/interface/bnd.bnd
deleted file mode 100644
index 241de97..0000000
--- a/samples/greeter/interface/bnd.bnd
+++ /dev/null
@@ -1 +0,0 @@
-Export-Package: org.apache.cxf.dosgi.samples.greeter
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/greeter/interface/pom.xml
----------------------------------------------------------------------
diff --git a/samples/greeter/interface/pom.xml b/samples/greeter/interface/pom.xml
deleted file mode 100644
index 4a43d1f..0000000
--- a/samples/greeter/interface/pom.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version='1.0' encoding='UTF-8' ?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <artifactId>cxf-dosgi-ri-samples-greeter-interface</artifactId>
- <packaging>bundle</packaging>
- <name>CXF DOSGi Greeter Interface Bundle</name>
-
- <parent>
- <groupId>org.apache.cxf.dosgi.samples</groupId>
- <artifactId>cxf-dosgi-ri-samples-greeter-parent</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <properties>
- <topDirectoryLocation>..</topDirectoryLocation>
- </properties>
-
-</project>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/greeter/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/GreeterData.java
----------------------------------------------------------------------
diff --git a/samples/greeter/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/GreeterData.java b/samples/greeter/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/GreeterData.java
deleted file mode 100644
index be23cc4..0000000
--- a/samples/greeter/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/GreeterData.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.dosgi.samples.greeter;
-
-public interface GreeterData {
- String getName();
- int getAge();
- boolean isException();
-}
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/greeter/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/GreeterException.java
----------------------------------------------------------------------
diff --git a/samples/greeter/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/GreeterException.java b/samples/greeter/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/GreeterException.java
deleted file mode 100644
index ebc58d1..0000000
--- a/samples/greeter/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/GreeterException.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.dosgi.samples.greeter;
-
-public class GreeterException extends Exception {
-
- private static final long serialVersionUID = 1L;
- private String name;
-
- public GreeterException() {
- }
-
- public GreeterException(String name) {
- this.name = name;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String theName) {
- name = theName;
- }
-
- @Override
- public String toString() {
- return "GreeterService can not greet " + name;
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/greeter/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/GreeterService.java
----------------------------------------------------------------------
diff --git a/samples/greeter/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/GreeterService.java b/samples/greeter/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/GreeterService.java
deleted file mode 100644
index a04bb4a..0000000
--- a/samples/greeter/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/GreeterService.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.dosgi.samples.greeter;
-
-import java.util.Map;
-
-public interface GreeterService {
- Map<GreetingPhrase, String> greetMe(String name);
- GreetingPhrase[] greetMe(GreeterData name) throws GreeterException;
-}
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/greeter/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/GreetingPhrase.java
----------------------------------------------------------------------
diff --git a/samples/greeter/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/GreetingPhrase.java b/samples/greeter/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/GreetingPhrase.java
deleted file mode 100644
index 857ed70..0000000
--- a/samples/greeter/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/GreetingPhrase.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.dosgi.samples.greeter;
-
-public class GreetingPhrase {
-
- private String phrase;
-
- public GreetingPhrase() {
- }
-
- public GreetingPhrase(String phrase) {
- this.phrase = phrase;
- }
-
- public void setPhrase(String thePhrase) {
- this.phrase = thePhrase;
- }
-
- public String getPhrase() {
- return phrase;
- }
-
- @Override
- public int hashCode() {
- return phrase.hashCode();
- }
-
- @Override
- public boolean equals(Object other) {
- return GreetingPhrase.class.isAssignableFrom(other.getClass())
- && phrase.equals(((GreetingPhrase) other).phrase);
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/greeter/pom.xml
----------------------------------------------------------------------
diff --git a/samples/greeter/pom.xml b/samples/greeter/pom.xml
deleted file mode 100644
index a801f13..0000000
--- a/samples/greeter/pom.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version='1.0' encoding='UTF-8' ?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.cxf.dosgi.samples</groupId>
- <artifactId>cxf-dosgi-ri-samples-greeter-parent</artifactId>
- <packaging>pom</packaging>
- <name>CXF DOSGi Greeter Bundles</name>
-
- <parent>
- <groupId>org.apache.cxf.dosgi</groupId>
- <artifactId>cxf-dosgi-ri-parent</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../../parent/pom.xml</relativePath>
- </parent>
-
- <dependencies>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <modules>
- <module>interface</module>
- <module>impl</module>
- <module>client</module>
- </modules>
-
-</project>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/greeter_rest/client/pom.xml
----------------------------------------------------------------------
diff --git a/samples/greeter_rest/client/pom.xml b/samples/greeter_rest/client/pom.xml
deleted file mode 100644
index f2757df..0000000
--- a/samples/greeter_rest/client/pom.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version='1.0' encoding='UTF-8' ?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
- license agreements. See the NOTICE file distributed with this work for additional
- information regarding copyright ownership. The ASF licenses this file to
- you under the Apache License, Version 2.0 (the "License"); you may not use
- this file except in compliance with the License. You may obtain a copy of
- the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
- by applicable law or agreed to in writing, software distributed under the
- License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
- OF ANY KIND, either express or implied. See the License for the specific
- language governing permissions and limitations under the License. -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <artifactId>cxf-dosgi-ri-samples-greeter-rest-client</artifactId>
- <packaging>bundle</packaging>
- <name>CXF DOSGi Greeter REST Client</name>
-
- <parent>
- <groupId>org.apache.cxf.dosgi.samples</groupId>
- <artifactId>cxf-dosgi-ri-samples-greeter-rest-parent</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <properties>
- <topDirectoryLocation>../..</topDirectoryLocation>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.cxf.dosgi.samples</groupId>
- <artifactId>cxf-dosgi-ri-samples-greeter-rest-interface</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
-</project>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/greeter_rest/client/src/main/java/org/apache/cxf/dosgi/samples/greeter/client/rest/GreeterClient.java
----------------------------------------------------------------------
diff --git a/samples/greeter_rest/client/src/main/java/org/apache/cxf/dosgi/samples/greeter/client/rest/GreeterClient.java b/samples/greeter_rest/client/src/main/java/org/apache/cxf/dosgi/samples/greeter/client/rest/GreeterClient.java
deleted file mode 100644
index ab25100..0000000
--- a/samples/greeter_rest/client/src/main/java/org/apache/cxf/dosgi/samples/greeter/client/rest/GreeterClient.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.dosgi.samples.greeter.client.rest;
-
-import org.apache.cxf.dosgi.samples.greeter.rest.GreeterException;
-import org.apache.cxf.dosgi.samples.greeter.rest.GreeterInfo;
-import org.apache.cxf.dosgi.samples.greeter.rest.GreeterService;
-import org.apache.cxf.dosgi.samples.greeter.rest.GreetingPhrase;
-import org.osgi.service.component.annotations.Activate;
-import org.osgi.service.component.annotations.Component;
-import org.osgi.service.component.annotations.Reference;
-
-@Component
-public class GreeterClient {
- private GreeterService greeterService;
-
- @Activate
- public void activate() throws GreeterException {
- GreeterInfo greetings = greeterService.greetMe("Christian");
- for (GreetingPhrase phrase : greetings.getGreetings()) {
- System.out.println(phrase.getPhrase());
- }
-
- }
-
- @Reference
- public void setGreeterService(GreeterService greeterService) {
- this.greeterService = greeterService;
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/greeter_rest/client/src/main/resources/OSGI-INF/remote-service/remote-services.xml
----------------------------------------------------------------------
diff --git a/samples/greeter_rest/client/src/main/resources/OSGI-INF/remote-service/remote-services.xml b/samples/greeter_rest/client/src/main/resources/OSGI-INF/remote-service/remote-services.xml
deleted file mode 100644
index db5bb14..0000000
--- a/samples/greeter_rest/client/src/main/resources/OSGI-INF/remote-service/remote-services.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to you under the Apache License, Version
- 2.0 (the "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0 Unless required by
- applicable law or agreed to in writing, software distributed under
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
- OR CONDITIONS OF ANY KIND, either express or implied. See the
- License for the specific language governing permissions and
- limitations under the License.
- -->
-<service-descriptions xmlns="http://www.osgi.org/xmlns/sd/v1.0.0">
- <service-description>
- <provide interface="org.apache.cxf.dosgi.samples.greeter.rest.GreeterService" />
- <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:8080/greeter</property>
- </service-description>
-</service-descriptions>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/greeter_rest/impl/pom.xml
----------------------------------------------------------------------
diff --git a/samples/greeter_rest/impl/pom.xml b/samples/greeter_rest/impl/pom.xml
deleted file mode 100644
index d1b26de..0000000
--- a/samples/greeter_rest/impl/pom.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version='1.0' encoding='UTF-8' ?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <artifactId>cxf-dosgi-ri-samples-greeter-rest-impl</artifactId>
- <packaging>bundle</packaging>
- <name>CXF DOSGi Greeter REST Impl</name>
-
- <parent>
- <groupId>org.apache.cxf.dosgi.samples</groupId>
- <artifactId>cxf-dosgi-ri-samples-greeter-rest-parent</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <properties>
- <topDirectoryLocation>..</topDirectoryLocation>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.cxf.dosgi.samples</groupId>
- <artifactId>cxf-dosgi-ri-samples-greeter-rest-interface</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
-</project>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/greeter_rest/impl/src/main/java/org/apache/cxf/dosgi/samples/greeter/impl/rest/GreeterServiceImpl.java
----------------------------------------------------------------------
diff --git a/samples/greeter_rest/impl/src/main/java/org/apache/cxf/dosgi/samples/greeter/impl/rest/GreeterServiceImpl.java b/samples/greeter_rest/impl/src/main/java/org/apache/cxf/dosgi/samples/greeter/impl/rest/GreeterServiceImpl.java
deleted file mode 100644
index 1af2e1e..0000000
--- a/samples/greeter_rest/impl/src/main/java/org/apache/cxf/dosgi/samples/greeter/impl/rest/GreeterServiceImpl.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.dosgi.samples.greeter.impl.rest;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.cxf.dosgi.samples.greeter.rest.GreeterException;
-import org.apache.cxf.dosgi.samples.greeter.rest.GreeterInfo;
-import org.apache.cxf.dosgi.samples.greeter.rest.GreeterService;
-import org.apache.cxf.dosgi.samples.greeter.rest.GreetingPhrase;
-import org.osgi.service.component.annotations.Component;
-
-@Component(//
- immediate = true, //
- property = //
- {
- "service.exported.interfaces=*", //
- "service.exported.configs=org.apache.cxf.rs", //
- "org.apache.cxf.rs.httpservice.context=/greeter" //
- } //
-)
-public class GreeterServiceImpl implements GreeterService {
-
- public GreeterInfo greetMe(String name) throws GreeterException {
- System.out.println("Invoking: greetMe(" + name + ")");
-
- if (name.equals("Stranger")) {
- throw new GreeterException(name);
- }
-
- GreeterInfo info = new GreeterInfo();
- List<GreetingPhrase> list = new ArrayList<GreetingPhrase>();
- list.add(new GreetingPhrase("Hello", name));
- list.add(new GreetingPhrase("Hoi", name));
- list.add(new GreetingPhrase("Hola", name));
- list.add(new GreetingPhrase("Bonjour", name));
- info.setGreetings(list);
- return info;
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/greeter_rest/interface/bnd.bnd
----------------------------------------------------------------------
diff --git a/samples/greeter_rest/interface/bnd.bnd b/samples/greeter_rest/interface/bnd.bnd
deleted file mode 100644
index dad324a..0000000
--- a/samples/greeter_rest/interface/bnd.bnd
+++ /dev/null
@@ -1 +0,0 @@
-Export-Package: org.apache.cxf.dosgi.samples.greeter.rest
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/greeter_rest/interface/pom.xml
----------------------------------------------------------------------
diff --git a/samples/greeter_rest/interface/pom.xml b/samples/greeter_rest/interface/pom.xml
deleted file mode 100644
index 0630e41..0000000
--- a/samples/greeter_rest/interface/pom.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version='1.0' encoding='UTF-8' ?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.cxf.dosgi.samples</groupId>
- <artifactId>cxf-dosgi-ri-samples-greeter-rest-interface</artifactId>
- <packaging>bundle</packaging>
- <name>CXF DOSGi Greeter REST Interface</name>
-
- <parent>
- <groupId>org.apache.cxf.dosgi</groupId>
- <artifactId>cxf-dosgi-ri-parent</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../../../parent/pom.xml</relativePath>
- </parent>
-
- <properties>
- <topDirectoryLocation>../../..</topDirectoryLocation>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.jsr339-api-m10</artifactId>
- <version>${servicemix.specs.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.jaxb-api-2.1</artifactId>
- <version>${servicemix.specs.version}</version>
- </dependency>
- </dependencies>
-
-</project>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/greeter_rest/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/rest/GreeterException.java
----------------------------------------------------------------------
diff --git a/samples/greeter_rest/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/rest/GreeterException.java b/samples/greeter_rest/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/rest/GreeterException.java
deleted file mode 100644
index fb83637..0000000
--- a/samples/greeter_rest/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/rest/GreeterException.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.dosgi.samples.greeter.rest;
-
-public class GreeterException extends Exception {
-
- private static final long serialVersionUID = 1L;
- private String name;
-
- public GreeterException() {
- }
-
- public GreeterException(String name) {
- this.name = name;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String theName) {
- name = theName;
- }
-
- @Override
- public String toString() {
- return "GreeterService can not greet " + name;
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/greeter_rest/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/rest/GreeterInfo.java
----------------------------------------------------------------------
diff --git a/samples/greeter_rest/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/rest/GreeterInfo.java b/samples/greeter_rest/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/rest/GreeterInfo.java
deleted file mode 100644
index 6dba206..0000000
--- a/samples/greeter_rest/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/rest/GreeterInfo.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-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>();
-
- public void setGreetings(List<GreetingPhrase> list) {
- greetings = list;
- }
-
- public List<GreetingPhrase> getGreetings() {
- return greetings;
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/greeter_rest/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/rest/GreeterService.java
----------------------------------------------------------------------
diff --git a/samples/greeter_rest/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/rest/GreeterService.java b/samples/greeter_rest/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/rest/GreeterService.java
deleted file mode 100644
index 7e67bd4..0000000
--- a/samples/greeter_rest/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/rest/GreeterService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.dosgi.samples.greeter.rest;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-
-@Path("greeter")
-public interface GreeterService {
-
- @GET
- @Path("greeting/{name}")
- GreeterInfo greetMe(@PathParam("name") String name) throws GreeterException;
-}
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/greeter_rest/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/rest/GreetingPhrase.java
----------------------------------------------------------------------
diff --git a/samples/greeter_rest/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/rest/GreetingPhrase.java b/samples/greeter_rest/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/rest/GreetingPhrase.java
deleted file mode 100644
index 545e091..0000000
--- a/samples/greeter_rest/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/rest/GreetingPhrase.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.dosgi.samples.greeter.rest;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class GreetingPhrase {
-
- private String phrase;
- private String name;
-
- public GreetingPhrase() {
- }
-
- public GreetingPhrase(String phrase, String name) {
- this.phrase = phrase;
- this.name = name;
- }
-
- public void setPhrase(String thePhrase) {
- this.phrase = thePhrase;
- }
-
- public String getPhrase() {
- return phrase;
- }
-
- public void setName(String theName) {
- this.name = theName;
- }
-
- public String getName() {
- return name;
- }
-
- @Override
- public int hashCode() {
- return phrase.hashCode() + 37 * name.hashCode();
- }
-
- @Override
- public boolean equals(Object other) {
- return GreetingPhrase.class.isAssignableFrom(other.getClass())
- && phrase.equals(((GreetingPhrase) other).phrase)
- && name.equals(((GreetingPhrase) other).name);
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/greeter_rest/interface/src/main/resources/OSGI-INF/cxf/jaxrs/GreeterService2-model.xml
----------------------------------------------------------------------
diff --git a/samples/greeter_rest/interface/src/main/resources/OSGI-INF/cxf/jaxrs/GreeterService2-model.xml b/samples/greeter_rest/interface/src/main/resources/OSGI-INF/cxf/jaxrs/GreeterService2-model.xml
deleted file mode 100644
index 2c4da17..0000000
--- a/samples/greeter_rest/interface/src/main/resources/OSGI-INF/cxf/jaxrs/GreeterService2-model.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<model xmlns="http://cxf.apache.org/jaxrs">
- <resource name="org.apache.cxf.dosgi.samples.greeter.rest.GreeterService2" path="greeter">
- <operation name="greetMe" verb="GET" path="greeting/{name}">
- <param name="name" type="PATH"/>
- </operation>
- </resource>
-</model>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/greeter_rest/pom.xml
----------------------------------------------------------------------
diff --git a/samples/greeter_rest/pom.xml b/samples/greeter_rest/pom.xml
deleted file mode 100644
index 4f1a4f0..0000000
--- a/samples/greeter_rest/pom.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version='1.0' encoding='UTF-8' ?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
- license agreements. See the NOTICE file distributed with this work for additional
- information regarding copyright ownership. The ASF licenses this file to
- you under the Apache License, Version 2.0 (the "License"); you may not use
- this file except in compliance with the License. You may obtain a copy of
- the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
- by applicable law or agreed to in writing, software distributed under the
- License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
- OF ANY KIND, either express or implied. See the License for the specific
- language governing permissions and limitations under the License. -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.cxf.dosgi.samples</groupId>
- <artifactId>cxf-dosgi-ri-samples-greeter-rest-parent</artifactId>
- <packaging>pom</packaging>
- <name>CXF DOSGi Greeter REST</name>
-
- <parent>
- <groupId>org.apache.cxf.dosgi</groupId>
- <artifactId>cxf-dosgi-ri-parent</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../../parent/pom.xml</relativePath>
- </parent>
-
- <modules>
- <module>interface</module>
- <module>impl</module>
- <module>client</module>
- </modules>
-
- <dependencies>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
-</project>
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/pom.xml
----------------------------------------------------------------------
diff --git a/samples/pom.xml b/samples/pom.xml
index 5d08022..21ceeb8 100644
--- a/samples/pom.xml
+++ b/samples/pom.xml
@@ -21,9 +21,9 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.cxf.dosgi.samples</groupId>
- <artifactId>cxf-dosgi-ri-samples</artifactId>
+ <artifactId>cxf-dosgi-samples-parent</artifactId>
<packaging>pom</packaging>
- <name>CXF DOSGi Sample Bundles</name>
+ <name>CXF DOSGi Samples Parent</name>
<url>http://cxf.apache.org/</url>
<parent>
@@ -34,9 +34,9 @@
</parent>
<modules>
- <module>greeter</module>
- <module>greeter_rest</module>
- <module>ds</module>
+ <module>rest</module>
+ <module>soap</module>
<module>security_filter</module>
+ <module>features</module>
</modules>
</project>