You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by ti...@apache.org on 2021/09/14 15:17:41 UTC
[aries-rsa] branch master updated (f2d2503 -> 3357982)
This is an automated email from the ASF dual-hosted git repository.
timothyjward pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/aries-rsa.git.
from f2d2503 ARIES-2043 - Fix LocalDiscovery not updated when listener scope changes
new 568642c Ensure that Export References are closed when the service unregisters
new 3357982 Ensure that Local Discovery tracks all listeners
The 2 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:
.../java/org/apache/aries/rsa/discovery/local/LocalDiscovery.java | 8 +++++++-
.../java/org/apache/aries/rsa/core/RemoteServiceAdminCore.java | 4 ++--
2 files changed, 9 insertions(+), 3 deletions(-)
[aries-rsa] 02/02: Ensure that Local Discovery tracks all listeners
Posted by ti...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
timothyjward pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/aries-rsa.git
commit 33579827bc4533fde8fdedca8313a6ec039475ce
Author: Tim Ward <ti...@apache.org>
AuthorDate: Tue Sep 14 16:15:37 2021 +0100
Ensure that Local Discovery tracks all listeners
---
.../java/org/apache/aries/rsa/discovery/local/LocalDiscovery.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/discovery/local/src/main/java/org/apache/aries/rsa/discovery/local/LocalDiscovery.java b/discovery/local/src/main/java/org/apache/aries/rsa/discovery/local/LocalDiscovery.java
index 63e5cf2..03350f6 100644
--- a/discovery/local/src/main/java/org/apache/aries/rsa/discovery/local/LocalDiscovery.java
+++ b/discovery/local/src/main/java/org/apache/aries/rsa/discovery/local/LocalDiscovery.java
@@ -41,6 +41,8 @@ import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Deactivate;
import org.osgi.service.component.annotations.Reference;
+import org.osgi.service.component.annotations.ReferenceCardinality;
+import org.osgi.service.component.annotations.ReferencePolicy;
import org.osgi.service.remoteserviceadmin.EndpointDescription;
import org.osgi.service.remoteserviceadmin.EndpointEvent;
import org.osgi.service.remoteserviceadmin.EndpointEventListener;
@@ -83,7 +85,7 @@ public class LocalDiscovery implements BundleListener {
}
}
- @Reference
+ @Reference(cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC)
void bindListener(ServiceReference<EndpointEventListener> endpointListenerRef, EndpointEventListener endpointListener) {
List<String> filters = StringPlus.normalize(endpointListenerRef.getProperty(EndpointEventListener.ENDPOINT_LISTENER_SCOPE));
if (filters.isEmpty()) {
@@ -128,6 +130,10 @@ public class LocalDiscovery implements BundleListener {
void updatedListener(ServiceReference<EndpointEventListener> endpointListenerRef, EndpointEventListener endpointListener) {
// if service properties have been updated, the filter (scope)
// might have changed so we remove and re-add the listener
+ // TODO fix this so that we don't:
+ // 1. remove and add when there is no change
+ // 2. remove and add instead of modifying
+ // 3. remove instead of modified end match
synchronized (listenerToFilters) {
unbindListener(endpointListener);
bindListener(endpointListenerRef, endpointListener);
[aries-rsa] 01/02: Ensure that Export References are closed when
the service unregisters
Posted by ti...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
timothyjward pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/aries-rsa.git
commit 568642c463239e8081c93eead94cb010cc598bcf
Author: Tim Ward <ti...@apache.org>
AuthorDate: Tue Sep 14 16:04:34 2021 +0100
Ensure that Export References are closed when the service unregisters
---
.../main/java/org/apache/aries/rsa/core/RemoteServiceAdminCore.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rsa/src/main/java/org/apache/aries/rsa/core/RemoteServiceAdminCore.java b/rsa/src/main/java/org/apache/aries/rsa/core/RemoteServiceAdminCore.java
index cc6349c..93f73e7 100644
--- a/rsa/src/main/java/org/apache/aries/rsa/core/RemoteServiceAdminCore.java
+++ b/rsa/src/main/java/org/apache/aries/rsa/core/RemoteServiceAdminCore.java
@@ -501,8 +501,8 @@ public class RemoteServiceAdminCore implements RemoteServiceAdmin {
synchronized (exportedServices) {
for (Collection<ExportRegistration> value : exportedServices.values()) {
for (ExportRegistration er : value) {
- if (er.getException() != null &&
- er.getExportReference() != null &&
+ if (er.getException() != null ||
+ er.getExportReference() == null ||
er.getExportReference().getExportedService().equals(sref)) {
regs.add(er);
}