[aries-jax-rs-whiteboard] branch master updated: [ARIES-1893] Fill the serviceDTO

2019-02-14 Thread csierra
This is an automated email from the ASF dual-hosted git repository.

csierra pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/aries-jax-rs-whiteboard.git


The following commit(s) were added to refs/heads/master by this push:
 new 6bfef5f  [ARIES-1893] Fill the serviceDTO
6bfef5f is described below

commit 6bfef5f0a2971d1136b7c1152f5f2393368a4a34
Author: Carlos Sierra 
AuthorDate: Thu Feb 14 17:14:49 2019 +0100

[ARIES-1893] Fill the serviceDTO
---
 jax-rs.itests/src/main/java/test/JaxrsTest.java   |  8 
 .../whiteboard/internal/AriesJaxrsServiceRuntime.java | 19 +++
 .../aries/jax/rs/whiteboard/internal/Whiteboard.java  | 13 +
 .../aries/jax/rs/whiteboard/internal/utils/Utils.java | 11 +++
 4 files changed, 47 insertions(+), 4 deletions(-)

diff --git a/jax-rs.itests/src/main/java/test/JaxrsTest.java 
b/jax-rs.itests/src/main/java/test/JaxrsTest.java
index f0680c0..85269e0 100644
--- a/jax-rs.itests/src/main/java/test/JaxrsTest.java
+++ b/jax-rs.itests/src/main/java/test/JaxrsTest.java
@@ -20,6 +20,7 @@ package test;
 import static javax.ws.rs.core.MediaType.TEXT_PLAIN_TYPE;
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static 
org.osgi.service.http.whiteboard.HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME;
 import static 
org.osgi.service.http.whiteboard.HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_PATH;
@@ -1918,6 +1919,13 @@ public class JaxrsTest extends TestHelper {
 }
 
 @Test
+public void testServiceEndpointInRuntimeDTO() {
+RuntimeDTO runtimeDTO = _runtime.getRuntimeDTO();
+
+assertNotNull(runtimeDTO.serviceDTO);
+}
+
+@Test
 public void 
testServiceReferencePropertiesAreAvailableInConfigurationInjection() {
 registerApplication(
 new Application() {
diff --git 
a/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/AriesJaxrsServiceRuntime.java
 
b/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/AriesJaxrsServiceRuntime.java
index 6a65679..319797d 100644
--- 
a/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/AriesJaxrsServiceRuntime.java
+++ 
b/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/AriesJaxrsServiceRuntime.java
@@ -46,9 +46,13 @@ import 
org.apache.aries.jax.rs.whiteboard.internal.cxf.CxfJaxrsServiceRegistrato
 import org.apache.aries.jax.rs.whiteboard.internal.utils.PropertyHolder;
 import 
org.apache.aries.jax.rs.whiteboard.internal.introspection.ClassIntrospector;
 import org.apache.aries.component.dsl.CachingServiceReference;
+import org.apache.aries.jax.rs.whiteboard.internal.utils.Utils;
 import org.apache.cxf.Bus;
 import org.apache.cxf.jaxrs.utils.AnnotationUtils;
 import org.apache.cxf.jaxrs.utils.JAXRSUtils;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.dto.ServiceReferenceDTO;
 import org.osgi.service.jaxrs.runtime.JaxrsServiceRuntime;
 import org.osgi.service.jaxrs.runtime.dto.ApplicationDTO;
 import org.osgi.service.jaxrs.runtime.dto.BaseDTO;
@@ -415,6 +419,21 @@ public class AriesJaxrsServiceRuntime implements 
JaxrsServiceRuntime {
 FailedExtensionDTO[]::new
 );
 
+ServiceReference serviceReference =
+_whiteboard.getServiceReference();
+
+ServiceReferenceDTO serviceDTO = new ServiceReferenceDTO();
+serviceDTO.bundle = serviceReference.getBundle().getBundleId();
+serviceDTO.id = (long)serviceReference.getProperty("service.id");
+serviceDTO.usingBundles = Arrays.stream(
+serviceReference.getUsingBundles()
+).mapToLong(
+Bundle::getBundleId
+).toArray();
+serviceDTO.properties = Utils.getProperties(serviceReference);
+
+runtimeDTO.serviceDTO = serviceDTO;
+
 return runtimeDTO;
 }
 
diff --git 
a/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/Whiteboard.java
 
b/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/Whiteboard.java
index bdd813f..7e52f48 100644
--- 
a/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/Whiteboard.java
+++ 
b/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/Whiteboard.java
@@ -151,10 +151,11 @@ public class Whiteboard {
 private final Map _configurationMap;
 private volatile BundleContext _bundleContext;
 private volatile ServiceRegistrationChangeCounter _counter;
-private volatile ServiceReference _runtimeReference;
+private volatile ServiceReference _runtimeReference;
 private final OSGi _program;
 private final List _endpoints;
-private volatile ServiceRegistration _runtimeRegistration;
+privat

[aries-jax-rs-whiteboard] branch master updated: [ARIES-1892] Avoid NPE

2019-02-14 Thread csierra
This is an automated email from the ASF dual-hosted git repository.

csierra pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/aries-jax-rs-whiteboard.git


The following commit(s) were added to refs/heads/master by this push:
 new 5300d16  [ARIES-1892] Avoid NPE
5300d16 is described below

commit 5300d165cc1af72c008d9e2db2c3f52dbf824e82
Author: Carlos Sierra 
AuthorDate: Thu Feb 14 16:04:53 2019 +0100

[ARIES-1892] Avoid NPE
---
 .../jax/rs/whiteboard/internal/cxf/CxfJaxrsServiceRegistrator.java| 4 
 1 file changed, 4 insertions(+)

diff --git 
a/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/cxf/CxfJaxrsServiceRegistrator.java
 
b/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/cxf/CxfJaxrsServiceRegistrator.java
index 0f8b14f..a7a34f1 100644
--- 
a/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/cxf/CxfJaxrsServiceRegistrator.java
+++ 
b/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/cxf/CxfJaxrsServiceRegistrator.java
@@ -158,6 +158,10 @@ public class CxfJaxrsServiceRegistrator {
 ArrayList> classes = new ArrayList<>();
 
 for (ClassResourceInfo resourceInfo : classResourceInfo) {
+if (resourceInfo == null) {
+continue;
+}
+
 ResourceProvider resourceProvider =
 resourceInfo.getResourceProvider();
 



[aries-jax-rs-whiteboard] branch master updated: [ARIES-1892] Avoid NPE

2019-02-14 Thread csierra
This is an automated email from the ASF dual-hosted git repository.

csierra pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/aries-jax-rs-whiteboard.git


The following commit(s) were added to refs/heads/master by this push:
 new e9e646f  [ARIES-1892] Avoid NPE
e9e646f is described below

commit e9e646f4b12abac01da7f7120690509d3b8ad324
Author: Carlos Sierra 
AuthorDate: Thu Feb 14 14:19:49 2019 +0100

[ARIES-1892] Avoid NPE
---
 .../rs/whiteboard/internal/cxf/CxfJaxrsServiceRegistrator.java| 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git 
a/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/cxf/CxfJaxrsServiceRegistrator.java
 
b/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/cxf/CxfJaxrsServiceRegistrator.java
index 7efe8d2..0f8b14f 100644
--- 
a/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/cxf/CxfJaxrsServiceRegistrator.java
+++ 
b/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/cxf/CxfJaxrsServiceRegistrator.java
@@ -158,8 +158,12 @@ public class CxfJaxrsServiceRegistrator {
 ArrayList> classes = new ArrayList<>();
 
 for (ClassResourceInfo resourceInfo : classResourceInfo) {
-if (!ServiceReferenceResourceProvider.class.isAssignableFrom(
-resourceInfo.getResourceProvider().getClass())) {
+ResourceProvider resourceProvider =
+resourceInfo.getResourceProvider();
+
+if (resourceProvider == null ||
+!ServiceReferenceResourceProvider.class.isAssignableFrom(
+resourceProvider.getClass())) {
 
 classes.add(resourceInfo.getResourceClass());
 }



[aries-rsa] branch master updated (d7344bb -> f5aa5ca)

2019-02-14 Thread cschneider
This is an automated email from the ASF dual-hosted git repository.

cschneider pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/aries-rsa.git.


from d7344bb  ARIES-1846 - Allow import of clusterinfo services
 add 148cd3f  Update Readme.md
 new f5aa5ca  Merge pull request #18 from apache/cschneider-patch-1

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 Readme.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)



[aries-rsa] 01/01: Merge pull request #18 from apache/cschneider-patch-1

2019-02-14 Thread cschneider
This is an automated email from the ASF dual-hosted git repository.

cschneider pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/aries-rsa.git

commit f5aa5ca62c3948d7e471c3a839089180650cf4f2
Merge: d7344bb 148cd3f
Author: Christian Schneider 
AuthorDate: Thu Feb 14 11:23:36 2019 +0100

Merge pull request #18 from apache/cschneider-patch-1

Update Readme.md

 Readme.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)



[aries-jpa] branch master updated: Exclude some resources

2019-02-14 Thread cschneider
This is an automated email from the ASF dual-hosted git repository.

cschneider pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/aries-jpa.git


The following commit(s) were added to refs/heads/master by this push:
 new f8a04df  Exclude some resources
f8a04df is described below

commit f8a04dfabbf0853af07926e4d8f8028b0d829bc8
Author: Christian Schneider 
AuthorDate: Thu Feb 14 11:18:46 2019 +0100

Exclude some resources
---
 jpa-parent/pom.xml | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/jpa-parent/pom.xml b/jpa-parent/pom.xml
index 93749d1..3acc567 100644
--- a/jpa-parent/pom.xml
+++ b/jpa-parent/pom.xml
@@ -32,7 +32,7 @@
 
 Apache Aries JPA parent
 pom
-
+
 
 2.6.0
 false
@@ -79,7 +79,7 @@
 org.osgi.service.jpa
 1.1.0
 
-
+
 
 org.apache.geronimo.specs
 geronimo-jta_1.1_spec
@@ -246,6 +246,7 @@
 
${project.build.directory}/${project.build.finalName}.rat
 true
 
+**/.git/**/*
 **/target/**/*
 **/appended-resources/**/*
 
**/dependency-reduced-pom.xml
@@ -272,9 +273,11 @@
 .gitignore
 osgi.bnd
 README.md
+Readme.md
 *.cfg
 derby.log
 **/*.sql
+.travis.yml