You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by am...@apache.org on 2026/05/29 16:30:06 UTC
(aries-rsa) branch master updated (91365008 -> 0f8ce1be)
This is an automated email from the ASF dual-hosted git repository.
amichair pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/aries-rsa.git
from 91365008 Bump logback.version from 1.5.32 to 1.5.33
new a3be8f90 ARIES-2224 Fix ZooKeeper modified events published for unchanged endpoints
new 3b954b09 Add reuse address socket option to fastbin TCP server
new 60cf0297 ARIES-2225 Fix FastBinProvider intents handling to comply with spec
new a4543664 ARIES-2226 Fix FastBinProvider handling of config-type properties to comply with TCK
new 41b1bbdc ARIES-2228 Fix FastBinProvider socket not closed on shutdown
new abbb9b63 Simplify EventListenerBridge ignoring its own listener
new 09afffad Fix EventListenerBridge ignoring scope modifying events
new 86144b24 Fix EventListenerBridge missing previously registered consumers
new 0f8ce1be ARIES-2227 Add TCK test run with ZooKeeper discovery and Fastbin distribution provider
The 9 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:
.../client/ZookeeperEndpointListener.java | 21 +++++
.../org.apache.aries.rsa.discovery.tcp.cfg | 2 +
.../org.apache.aries.rsa.discovery.zookeeper.cfg | 1 +
...apache.aries.rsa.discovery.zookeeper.server.cfg | 1 +
.../org.apache.aries.rsa.provider.fastbin.cfg | 1 +
.../configs/framework1/org.ops4j.pax.logging.cfg | 27 +++++++
.../org.apache.aries.rsa.discovery.tcp.cfg | 2 +
.../org.apache.aries.rsa.discovery.zookeeper.cfg | 1 +
.../org.apache.aries.rsa.provider.fastbin.cfg | 1 +
.../configs/framework2/org.ops4j.pax.logging.cfg | 27 +++++++
itests/tck/pom.xml | 88 +++++++++++++++++++--
itests/tck/{tck.bndrun => tck-tcp-tcp.bndrun} | 63 ++++++++-------
.../{tck.bndrun => tck-zookeeper-fastbin.bndrun} | 90 ++++++++++++++--------
.../aries/rsa/provider/fastbin/Activator.java | 2 +-
.../rsa/provider/fastbin/FastBinProvider.java | 79 +++++++++++--------
.../provider/fastbin/tcp/TcpTransportServer.java | 41 +++++++---
.../apache/aries/rsa/core/EventListenerBridge.java | 30 +++++---
17 files changed, 356 insertions(+), 121 deletions(-)
create mode 100644 itests/tck/configs/framework1/org.apache.aries.rsa.discovery.tcp.cfg
create mode 100644 itests/tck/configs/framework1/org.apache.aries.rsa.discovery.zookeeper.cfg
create mode 100644 itests/tck/configs/framework1/org.apache.aries.rsa.discovery.zookeeper.server.cfg
create mode 100644 itests/tck/configs/framework1/org.apache.aries.rsa.provider.fastbin.cfg
create mode 100644 itests/tck/configs/framework1/org.ops4j.pax.logging.cfg
create mode 100644 itests/tck/configs/framework2/org.apache.aries.rsa.discovery.tcp.cfg
create mode 100644 itests/tck/configs/framework2/org.apache.aries.rsa.discovery.zookeeper.cfg
create mode 100644 itests/tck/configs/framework2/org.apache.aries.rsa.provider.fastbin.cfg
create mode 100644 itests/tck/configs/framework2/org.ops4j.pax.logging.cfg
copy itests/tck/{tck.bndrun => tck-tcp-tcp.bndrun} (89%)
rename itests/tck/{tck.bndrun => tck-zookeeper-fastbin.bndrun} (67%)
(aries-rsa) 06/09: Simplify EventListenerBridge ignoring its own listener
Posted by am...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
amichair pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/aries-rsa.git
commit abbb9b6330b5cc0f2bb385f160154e4495afdcea
Author: Amichai Rothman <am...@apache.org>
AuthorDate: Fri May 22 23:29:31 2026 +0300
Simplify EventListenerBridge ignoring its own listener
---
.../java/org/apache/aries/rsa/core/EventListenerBridge.java | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/rsa/src/main/java/org/apache/aries/rsa/core/EventListenerBridge.java b/rsa/src/main/java/org/apache/aries/rsa/core/EventListenerBridge.java
index 1030d0cf..716ced68 100644
--- a/rsa/src/main/java/org/apache/aries/rsa/core/EventListenerBridge.java
+++ b/rsa/src/main/java/org/apache/aries/rsa/core/EventListenerBridge.java
@@ -161,8 +161,8 @@ public class EventListenerBridge implements ServiceListener, ListenerHook {
OWN_LISTENER_PROP = EventListenerBridge.class.getName(),
ENDPOINT_LISTENER_CLASS_NAME = EndpointListener.class.getName(),
ENDPOINT_EVENT_LISTENER_CLASS_NAME = EndpointEventListener.class.getName(),
- SERVICE_LISTENER_FILTER = "(|" + getObjectClass(EndpointListener.class)
- + getObjectClass(EndpointEventListener.class) + "(" + OWN_LISTENER_PROP + "=true))";
+ SERVICE_LISTENER_FILTER = "(&(|" + getObjectClass(EndpointListener.class)
+ + getObjectClass(EndpointEventListener.class) + ")(!(" + OWN_LISTENER_PROP + "=*)))";
private final Set<ServiceReference<EndpointListener>> oldConsumers =
Collections.newSetFromMap(new ConcurrentHashMap<>());
@@ -251,12 +251,10 @@ public class EventListenerBridge implements ServiceListener, ListenerHook {
@SuppressWarnings("unchecked")
public void serviceChanged(ServiceEvent event) {
ServiceReference<?> sref = event.getServiceReference();
- boolean ignore = sref.getProperty(OWN_LISTENER_PROP) != null; // ignore our own listener
- List<String> classes = Arrays.asList(
- (String[])event.getServiceReference().getProperty(Constants.OBJECTCLASS));
+ List<String> classes = Arrays.asList((String[])sref.getProperty(Constants.OBJECTCLASS));
boolean el = classes.contains(ENDPOINT_LISTENER_CLASS_NAME);
boolean eel = classes.contains(ENDPOINT_EVENT_LISTENER_CLASS_NAME);
- if (event.getType() == ServiceEvent.UNREGISTERING || ignore)
+ if (event.getType() == ServiceEvent.UNREGISTERING)
el = eel = false; // remove both
// update our consumer lists with relevant one-interface-only consumers
boolean modified = false;
(aries-rsa) 01/09: ARIES-2224 Fix ZooKeeper modified events published for unchanged endpoints
Posted by am...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
amichair pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/aries-rsa.git
commit a3be8f906f3965edbd8af524168dde7d08df8242
Author: Amichai Rothman <am...@apache.org>
AuthorDate: Fri May 22 23:25:46 2026 +0300
ARIES-2224 Fix ZooKeeper modified events published for unchanged endpoints
---
.../zookeeper/client/ZookeeperEndpointListener.java | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/discovery/zookeeper/src/main/java/org/apache/aries/rsa/discovery/zookeeper/client/ZookeeperEndpointListener.java b/discovery/zookeeper/src/main/java/org/apache/aries/rsa/discovery/zookeeper/client/ZookeeperEndpointListener.java
index beaab10d..f137112d 100644
--- a/discovery/zookeeper/src/main/java/org/apache/aries/rsa/discovery/zookeeper/client/ZookeeperEndpointListener.java
+++ b/discovery/zookeeper/src/main/java/org/apache/aries/rsa/discovery/zookeeper/client/ZookeeperEndpointListener.java
@@ -21,8 +21,11 @@ package org.apache.aries.rsa.discovery.zookeeper.client;
import java.io.ByteArrayInputStream;
import java.io.Closeable;
import java.util.Collection;
+import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Consumer;
@@ -113,6 +116,10 @@ public class ZookeeperEndpointListener implements Closeable {
private void onChanged(String path, EndpointDescription endpoint) {
EndpointDescription old = endpoints.put(path, endpoint);
+ if (old != null && getChangedProps(old.getProperties(), endpoint.getProperties()).isEmpty()) {
+ LOG.trace("ignoring endpoint that hasn't changed: {}", endpoint);
+ return;
+ }
int type = old == null ? EndpointEvent.ADDED : EndpointEvent.MODIFIED;
EndpointEvent event = new EndpointEvent(type, endpoint);
listener.accept(event);
@@ -136,4 +143,18 @@ public class ZookeeperEndpointListener implements Closeable {
}
}
+ private static Set<String> getChangedProps(Map<String, Object> p1, Map<String, Object> p2) {
+ Set<String> changed = new LinkedHashSet<>();
+ for (Map.Entry<String, Object> entry : p1.entrySet()) {
+ Object v = p2.get(entry.getKey());
+ if (!Objects.deepEquals(entry.getValue(), v) || v == null && !p2.containsKey(entry.getKey()))
+ changed.add(entry.getKey());
+ }
+ for (String k : p2.keySet()) {
+ if (!p1.containsKey(k))
+ changed.add(k);
+ }
+ return changed;
+ }
+
}
(aries-rsa) 09/09: ARIES-2227 Add TCK test run with ZooKeeper discovery and Fastbin distribution provider
Posted by am...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
amichair pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/aries-rsa.git
commit 0f8ce1be11745b3e50b6dacb127e788ba9c226ff
Author: Amichai Rothman <am...@apache.org>
AuthorDate: Fri May 22 23:49:22 2026 +0300
ARIES-2227 Add TCK test run with ZooKeeper discovery and Fastbin distribution provider
---
.../org.apache.aries.rsa.discovery.tcp.cfg | 2 +
.../org.apache.aries.rsa.discovery.zookeeper.cfg | 1 +
...apache.aries.rsa.discovery.zookeeper.server.cfg | 1 +
.../org.apache.aries.rsa.provider.fastbin.cfg | 1 +
.../configs/framework1/org.ops4j.pax.logging.cfg | 27 +++++++
.../org.apache.aries.rsa.discovery.tcp.cfg | 2 +
.../org.apache.aries.rsa.discovery.zookeeper.cfg | 1 +
.../org.apache.aries.rsa.provider.fastbin.cfg | 1 +
.../configs/framework2/org.ops4j.pax.logging.cfg | 27 +++++++
itests/tck/pom.xml | 88 +++++++++++++++++++--
itests/tck/{tck.bndrun => tck-tcp-tcp.bndrun} | 63 ++++++++-------
.../{tck.bndrun => tck-zookeeper-fastbin.bndrun} | 90 ++++++++++++++--------
12 files changed, 239 insertions(+), 65 deletions(-)
diff --git a/itests/tck/configs/framework1/org.apache.aries.rsa.discovery.tcp.cfg b/itests/tck/configs/framework1/org.apache.aries.rsa.discovery.tcp.cfg
new file mode 100644
index 00000000..312a7908
--- /dev/null
+++ b/itests/tck/configs/framework1/org.apache.aries.rsa.discovery.tcp.cfg
@@ -0,0 +1,2 @@
+address=localhost:7668
+peers=localhost:7669
diff --git a/itests/tck/configs/framework1/org.apache.aries.rsa.discovery.zookeeper.cfg b/itests/tck/configs/framework1/org.apache.aries.rsa.discovery.zookeeper.cfg
new file mode 100644
index 00000000..3c35b62f
--- /dev/null
+++ b/itests/tck/configs/framework1/org.apache.aries.rsa.discovery.zookeeper.cfg
@@ -0,0 +1 @@
+zookeeper.timeout=300000
diff --git a/itests/tck/configs/framework1/org.apache.aries.rsa.discovery.zookeeper.server.cfg b/itests/tck/configs/framework1/org.apache.aries.rsa.discovery.zookeeper.server.cfg
new file mode 100644
index 00000000..d8060cca
--- /dev/null
+++ b/itests/tck/configs/framework1/org.apache.aries.rsa.discovery.zookeeper.server.cfg
@@ -0,0 +1 @@
+# if this config exists, the zookeeper server will be started
diff --git a/itests/tck/configs/framework1/org.apache.aries.rsa.provider.fastbin.cfg b/itests/tck/configs/framework1/org.apache.aries.rsa.provider.fastbin.cfg
new file mode 100644
index 00000000..5b6ce67c
--- /dev/null
+++ b/itests/tck/configs/framework1/org.apache.aries.rsa.provider.fastbin.cfg
@@ -0,0 +1 @@
+uri=tcp://0.0.0.0:2543
diff --git a/itests/tck/configs/framework1/org.ops4j.pax.logging.cfg b/itests/tck/configs/framework1/org.ops4j.pax.logging.cfg
new file mode 100644
index 00000000..733f0c31
--- /dev/null
+++ b/itests/tck/configs/framework1/org.ops4j.pax.logging.cfg
@@ -0,0 +1,27 @@
+# Root log level
+log4j2.rootLogger.level = WARN
+
+# Console appender (keep it, but quieter)
+log4j2.rootLogger.appenderRef.console.ref = console
+log4j2.appender.console.type = Console
+log4j2.appender.console.name = console
+log4j2.appender.console.layout.type = PatternLayout
+log4j2.appender.console.layout.pattern = %d{HH:mm:ss.SSS} FW1 %-5p [%t] %c - %m%n
+
+# File appender
+log4j2.rootLogger.appenderRef.file.ref = file
+log4j2.appender.file.type = RollingFile
+log4j2.appender.file.name = file
+log4j2.appender.file.fileName = target/framework1.log
+log4j2.appender.file.filePattern = target/framework1-%i.log
+log4j2.appender.file.layout.type = PatternLayout
+log4j2.appender.file.layout.pattern = %d{ISO8601} %-5p [%t] %c - %m%n
+log4j2.appender.file.policies.type = Policies
+log4j2.appender.file.policies.size.type = SizeBasedTriggeringPolicy
+log4j2.appender.file.policies.size.size = 100MB
+log4j2.appender.file.strategy.type = DefaultRolloverStrategy
+log4j2.appender.file.strategy.max = 5
+
+# Per-package overrides
+log4j2.logger.aries.name = org.apache.aries.rsa
+log4j2.logger.aries.level = WARN
diff --git a/itests/tck/configs/framework2/org.apache.aries.rsa.discovery.tcp.cfg b/itests/tck/configs/framework2/org.apache.aries.rsa.discovery.tcp.cfg
new file mode 100644
index 00000000..62326d9e
--- /dev/null
+++ b/itests/tck/configs/framework2/org.apache.aries.rsa.discovery.tcp.cfg
@@ -0,0 +1,2 @@
+address=localhost:7669
+peers=localhost:7668
diff --git a/itests/tck/configs/framework2/org.apache.aries.rsa.discovery.zookeeper.cfg b/itests/tck/configs/framework2/org.apache.aries.rsa.discovery.zookeeper.cfg
new file mode 100644
index 00000000..3c35b62f
--- /dev/null
+++ b/itests/tck/configs/framework2/org.apache.aries.rsa.discovery.zookeeper.cfg
@@ -0,0 +1 @@
+zookeeper.timeout=300000
diff --git a/itests/tck/configs/framework2/org.apache.aries.rsa.provider.fastbin.cfg b/itests/tck/configs/framework2/org.apache.aries.rsa.provider.fastbin.cfg
new file mode 100644
index 00000000..0dbe2946
--- /dev/null
+++ b/itests/tck/configs/framework2/org.apache.aries.rsa.provider.fastbin.cfg
@@ -0,0 +1 @@
+uri=tcp://0.0.0.0:2544
diff --git a/itests/tck/configs/framework2/org.ops4j.pax.logging.cfg b/itests/tck/configs/framework2/org.ops4j.pax.logging.cfg
new file mode 100644
index 00000000..767f09c8
--- /dev/null
+++ b/itests/tck/configs/framework2/org.ops4j.pax.logging.cfg
@@ -0,0 +1,27 @@
+# Root log level
+log4j2.rootLogger.level = WARN
+
+# Console appender (keep it, but quieter)
+log4j2.rootLogger.appenderRef.console.ref = console
+log4j2.appender.console.type = Console
+log4j2.appender.console.name = console
+log4j2.appender.console.layout.type = PatternLayout
+log4j2.appender.console.layout.pattern = %d{HH:mm:ss.SSS} FW2 %-5p [%t] %c - %m%n
+
+# File appender
+log4j2.rootLogger.appenderRef.file.ref = file
+log4j2.appender.file.type = RollingFile
+log4j2.appender.file.name = file
+log4j2.appender.file.fileName = target/framework2.log
+log4j2.appender.file.filePattern = target/framework2-%i.log
+log4j2.appender.file.layout.type = PatternLayout
+log4j2.appender.file.layout.pattern = %d{ISO8601} %-5p [%t] %c - %m%n
+log4j2.appender.file.policies.type = Policies
+log4j2.appender.file.policies.size.type = SizeBasedTriggeringPolicy
+log4j2.appender.file.policies.size.size = 100MB
+log4j2.appender.file.strategy.type = DefaultRolloverStrategy
+log4j2.appender.file.strategy.max = 5
+
+# Per-package overrides
+log4j2.logger.aries.name = org.apache.aries.rsa
+log4j2.logger.aries.level = WARN
diff --git a/itests/tck/pom.xml b/itests/tck/pom.xml
index 2cdd19ae..347965ce 100644
--- a/itests/tck/pom.xml
+++ b/itests/tck/pom.xml
@@ -60,11 +60,80 @@
<artifactId>org.apache.aries.rsa.discovery.tcp</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.aries.rsa.discovery</groupId>
+ <artifactId>org.apache.aries.rsa.discovery.zookeeper</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>org.apache.aries.rsa.provider</groupId>
<artifactId>org.apache.aries.rsa.provider.tcp</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.aries.rsa.provider</groupId>
+ <artifactId>org.apache.aries.rsa.provider.fastbin</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <!-- ZooKeeper discovery dependencies -->
+ <dependency>
+ <groupId>io.dropwizard.metrics</groupId>
+ <artifactId>metrics-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.xerial.snappy</groupId>
+ <artifactId>snappy-java</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-handler</artifactId>
+ <version>${netty.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-buffer</artifactId>
+ <version>${netty.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-transport</artifactId>
+ <version>${netty.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-common</artifactId>
+ <version>${netty.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-resolver</artifactId>
+ <version>${netty.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-transport-native-unix-common</artifactId>
+ <version>${netty.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-codec</artifactId>
+ <version>${netty.version}</version>
+ </dependency>
+
+ <!-- fastbin provider dependencies -->
+ <dependency>
+ <groupId>org.fusesource.hawtbuf</groupId>
+ <artifactId>hawtbuf</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.fusesource.hawtdispatch</groupId>
+ <artifactId>hawtdispatch</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.fusesource.hawtbuf</groupId>
+ <artifactId>hawtbuf-proto</artifactId>
+ </dependency>
<!-- JAXB dependencies (used by e.g. discovery.local) -->
<dependency>
@@ -154,6 +223,16 @@
</dependency>
<!-- OSGi compendium services -->
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.scr</artifactId>
+ <version>2.2.18</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.fileinstall</artifactId>
+ <version>3.7.4</version>
+ </dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.configadmin</artifactId>
@@ -164,11 +243,6 @@
<artifactId>org.apache.felix.eventadmin</artifactId>
<version>1.6.4</version>
</dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.scr</artifactId>
- <version>2.2.18</version>
- </dependency>
</dependencies>
@@ -196,7 +270,8 @@
<version>${bnd.version}</version>
<configuration>
<bndruns>
- <bndrun>tck.bndrun</bndrun>
+ <bndrun>tck-tcp-tcp.bndrun</bndrun>
+ <bndrun>tck-zookeeper-fastbin.bndrun</bndrun>
</bndruns>
<failOnChanges>false</failOnChanges>
<!-- enables passing -Dtck.test=<TestClass> on maven command line to run specific tests -->
@@ -215,4 +290,3 @@
</build>
</project>
-
diff --git a/itests/tck/tck.bndrun b/itests/tck/tck-tcp-tcp.bndrun
similarity index 89%
copy from itests/tck/tck.bndrun
copy to itests/tck/tck-tcp-tcp.bndrun
index 756f0dd2..029cca36 100644
--- a/itests/tck/tck.bndrun
+++ b/itests/tck/tck-tcp-tcp.bndrun
@@ -17,6 +17,10 @@
# under the License.
#-standalone: target/index.xml
+
+# runs the TCK test suite with TCP discovery and TCP distribution provider
+
+
-runtrace: true
-target: org.osgi.test.cases.remoteserviceadmin
@@ -26,7 +30,7 @@
osgi.resolverMode="strict",\
rsa.ct.timeout=30000,\
rsa.ct.timeout.factor=3,\
- rsa.tck.timeout=10000,\
+ rsa.tck.timeout=30000,\
service.exported.configs="aries.tcp",\
org.osgi.framework.system.packages.extra="\
org.osgi.service.remoteserviceadmin",\
@@ -35,37 +39,39 @@
junit.framework",\
org.osgi.test.cases.remoteserviceadmin.serverconfig="service.exported.configs",\
org.osgi.test.cases.remoteserviceadmin.bundles="\
- ${repo;org.apache.aries.rsa.core;2.0.0.SNAPSHOT},\
- ${repo;org.apache.aries.rsa.spi;2.0.0.SNAPSHOT},\
- ${repo;org.apache.aries.rsa.topology-manager;2.0.0.SNAPSHOT},\
- ${repo;org.apache.aries.rsa.discovery.local;2.0.0.SNAPSHOT},\
- ${repo;org.apache.aries.rsa.discovery.tcp;2.0.0.SNAPSHOT},\
- ${repo;org.apache.aries.rsa.provider.tcp;2.0.0.SNAPSHOT},\
+ ${repo;org.ops4j.pax.logging.pax-logging-api;2.3.3},\
+ ${repo;org.ops4j.pax.logging.pax-logging-log4j2;2.3.3},\
${repo;org.osgi.service.component;1.5.1},\
${repo;org.osgi.util.function;1.2.0},\
${repo;org.osgi.util.promise;1.3.0},\
+ ${repo;org.apache.felix.scr;2.2.18},\
+ ${repo;org.apache.felix.fileinstall;3.7.4},\
${repo;org.apache.felix.configadmin;1.9.26},\
${repo;org.apache.felix.eventadmin;1.6.4},\
- ${repo;org.apache.felix.scr;2.2.18},\
+ ${repo;org.glassfish.hk2.osgi-resource-locator;3.0.0},\
${repo;org.apache.servicemix.bundles.junit;4.13.2},\
- ${repo;org.ops4j.pax.logging.pax-logging-api;2.3.3},\
- ${repo;org.ops4j.pax.logging.pax-logging-log4j2;2.3.3},\
${repo;jakarta.activation-api;2.1.4},\
${repo;jakarta.xml.bind-api;4.0.5},\
- ${repo;com.sun.xml.bind.jaxb-impl;4.0.8},\
${repo;com.sun.xml.bind.jaxb-core;4.0.8},\
+ ${repo;com.sun.xml.bind.jaxb-impl;4.0.8},\
${repo;com.sun.istack.commons-runtime;4.2.0},\
- ${repo;org.glassfish.hk2.osgi-resource-locator;3.0.0}",\
- org.apache.aries.rsa.discovery.tcp.address=localhost:7668,\
- org.apache.aries.rsa.discovery.tcp.peers=localhost:7669,\
+ ${repo;org.apache.aries.rsa.spi;2.0.0.SNAPSHOT},\
+ ${repo;org.apache.aries.rsa.discovery.local;2.0.0.SNAPSHOT},\
+ ${repo;org.apache.aries.rsa.discovery.tcp;2.0.0.SNAPSHOT},\
+ ${repo;org.apache.aries.rsa.provider.tcp;2.0.0.SNAPSHOT},\
+ ${repo;org.apache.aries.rsa.core;2.0.0.SNAPSHOT},\
+ ${repo;org.apache.aries.rsa.topology-manager;2.0.0.SNAPSHOT}",\
+ felix.fileinstall.dir=${.}/configs/framework1,\
+ felix.fileinstall.noInitialDelay=true,\
org.apache.aries.rsa.bridge=true,\
org.osgi.test.cases.remoteserviceadmin.framework.properties="\
- org.apache.aries.rsa.discovery.tcp.address=localhost:7669,\
- org.apache.aries.rsa.discovery.tcp.peers=localhost:7668,\
+ felix.fileinstall.dir=${.}/configs/framework2,\
+ felix.fileinstall.noInitialDelay=true,\
org.apache.aries.rsa.bridge=true"
-runvm:\
- -Xmx512m
+ -Xmx512m,\
+ -Dorg.ops4j.pax.logging.DefaultServiceLog.level=WARN
#,"-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"
-runsystempackages:\
@@ -81,27 +87,28 @@
-runblacklist:\
osgi.identity;filter:='(osgi.identity=osgi.cmpn)'
-runbundles:\
- org.apache.aries.rsa.core;version='[2.0.0,2.0.1)',\
- org.apache.aries.rsa.spi;version='[2.0.0,2.0.1)',\
- org.apache.aries.rsa.topology-manager;version='[2.0.0,2.0.1)',\
- org.apache.aries.rsa.discovery.local;version='[2.0.0,2.0.1)',\
- org.apache.aries.rsa.discovery.tcp;version='[2.0.0,2.0.1)',\
- org.apache.aries.rsa.provider.tcp;version='[2.0.0,2.0.1)',\
+ org.ops4j.pax.logging.pax-logging-api;version='[2.3.3,2.3.4)',\
+ org.ops4j.pax.logging.pax-logging-log4j2;version='[2.3.3,2.3.4)',\
org.osgi.service.component;version='[1.5.1,1.5.2)',\
org.osgi.util.function;version='[1.2.0,1.2.1)',\
org.osgi.util.promise;version='[1.3.0,1.3.1)',\
+ org.apache.felix.scr;version='[2.2.18,2.2.19)',\
+ org.apache.felix.fileinstall;version='[3.7.4,3.7.5)',\
org.apache.felix.configadmin;version='[1.9.26,1.9.27)',\
org.apache.felix.eventadmin;version='[1.6.4,1.6.5)',\
- org.apache.felix.scr;version='[2.2.18,2.2.19)',\
+ org.glassfish.hk2.osgi-resource-locator;version='[3.0.0,3.0.1)',\
org.apache.servicemix.bundles.junit;version='[4.13.2,4.13.3)',\
assertj-core;version='[3.27.7,3.27.8)',\
net.bytebuddy.byte-buddy;version='[1.18.8,1.18.9)',\
- org.ops4j.pax.logging.pax-logging-api;version='[2.3.3,2.3.4)',\
- org.ops4j.pax.logging.pax-logging-log4j2;version='[2.3.3,2.3.4)',\
jakarta.activation-api;version='[2.1.4,2.1.5)',\
jakarta.xml.bind-api;version='[4.0.5,4.0.6)',\
- com.sun.xml.bind.jaxb-impl;version='[4.0.8,4.0.9)',\
com.sun.xml.bind.jaxb-core;version='[4.0.8,4.0.9)',\
+ com.sun.xml.bind.jaxb-impl;version='[4.0.8,4.0.9)',\
com.sun.istack.commons-runtime;version='[4.2.0,4.2.1)',\
- org.glassfish.hk2.osgi-resource-locator;version='[3.0.0,3.0.1)',\
+ org.apache.aries.rsa.spi;version='[2.0.0,2.0.1)',\
+ org.apache.aries.rsa.discovery.local;version='[2.0.0,2.0.1)',\
+ org.apache.aries.rsa.discovery.tcp;version='[2.0.0,2.0.1)',\
+ org.apache.aries.rsa.provider.tcp;version='[2.0.0,2.0.1)',\
+ org.apache.aries.rsa.core;version='[2.0.0,2.0.1)',\
+ org.apache.aries.rsa.topology-manager;version='[2.0.0,2.0.1)',\
org.osgi.test.cases.remoteserviceadmin;version='[8.1.0,8.1.1)'
diff --git a/itests/tck/tck.bndrun b/itests/tck/tck-zookeeper-fastbin.bndrun
similarity index 67%
rename from itests/tck/tck.bndrun
rename to itests/tck/tck-zookeeper-fastbin.bndrun
index 756f0dd2..8f8d90f4 100644
--- a/itests/tck/tck.bndrun
+++ b/itests/tck/tck-zookeeper-fastbin.bndrun
@@ -17,6 +17,10 @@
# under the License.
#-standalone: target/index.xml
+
+# runs the TCK test suite with ZooKeeper discovery and FastBin distribution provider
+
+
-runtrace: true
-target: org.osgi.test.cases.remoteserviceadmin
@@ -26,8 +30,8 @@
osgi.resolverMode="strict",\
rsa.ct.timeout=30000,\
rsa.ct.timeout.factor=3,\
- rsa.tck.timeout=10000,\
- service.exported.configs="aries.tcp",\
+ rsa.tck.timeout=30000,\
+ service.exported.configs="aries.fastbin",\
org.osgi.framework.system.packages.extra="\
org.osgi.service.remoteserviceadmin",\
org.osgi.test.cases.remoteserviceadmin.system.packages.extra="\
@@ -35,37 +39,51 @@
junit.framework",\
org.osgi.test.cases.remoteserviceadmin.serverconfig="service.exported.configs",\
org.osgi.test.cases.remoteserviceadmin.bundles="\
- ${repo;org.apache.aries.rsa.core;2.0.0.SNAPSHOT},\
- ${repo;org.apache.aries.rsa.spi;2.0.0.SNAPSHOT},\
- ${repo;org.apache.aries.rsa.topology-manager;2.0.0.SNAPSHOT},\
- ${repo;org.apache.aries.rsa.discovery.local;2.0.0.SNAPSHOT},\
- ${repo;org.apache.aries.rsa.discovery.tcp;2.0.0.SNAPSHOT},\
- ${repo;org.apache.aries.rsa.provider.tcp;2.0.0.SNAPSHOT},\
+ ${repo;org.ops4j.pax.logging.pax-logging-api;2.3.3},\
+ ${repo;org.ops4j.pax.logging.pax-logging-log4j2;2.3.3},\
${repo;org.osgi.service.component;1.5.1},\
${repo;org.osgi.util.function;1.2.0},\
${repo;org.osgi.util.promise;1.3.0},\
+ ${repo;org.apache.felix.scr;2.2.18},\
+ ${repo;org.apache.felix.fileinstall;3.7.4},\
${repo;org.apache.felix.configadmin;1.9.26},\
${repo;org.apache.felix.eventadmin;1.6.4},\
- ${repo;org.apache.felix.scr;2.2.18},\
+ ${repo;org.glassfish.hk2.osgi-resource-locator;3.0.0},\
${repo;org.apache.servicemix.bundles.junit;4.13.2},\
- ${repo;org.ops4j.pax.logging.pax-logging-api;2.3.3},\
- ${repo;org.ops4j.pax.logging.pax-logging-log4j2;2.3.3},\
${repo;jakarta.activation-api;2.1.4},\
${repo;jakarta.xml.bind-api;4.0.5},\
- ${repo;com.sun.xml.bind.jaxb-impl;4.0.8},\
${repo;com.sun.xml.bind.jaxb-core;4.0.8},\
+ ${repo;com.sun.xml.bind.jaxb-impl;4.0.8},\
${repo;com.sun.istack.commons-runtime;4.2.0},\
- ${repo;org.glassfish.hk2.osgi-resource-locator;3.0.0}",\
- org.apache.aries.rsa.discovery.tcp.address=localhost:7668,\
- org.apache.aries.rsa.discovery.tcp.peers=localhost:7669,\
+ ${repo;org.fusesource.hawtbuf.hawtbuf;1.11.0},\
+ ${repo;org.fusesource.hawtdispatch.hawtdispatch;1.22.0},\
+ ${repo;io.dropwizard.metrics.core;4.2.39},\
+ ${repo;io.netty.handler;4.1.121},\
+ ${repo;io.netty.buffer;4.1.121},\
+ ${repo;io.netty.transport;4.1.121},\
+ ${repo;io.netty.common;4.1.121},\
+ ${repo;io.netty.resolver;4.1.121},\
+ ${repo;io.netty.transport-native-unix-common;4.1.121},\
+ ${repo;io.netty.codec;4.1.121},\
+ ${repo;org.apache.aries.rsa.spi;2.0.0.SNAPSHOT},\
+ ${repo;org.apache.aries.rsa.discovery.local;2.0.0.SNAPSHOT},\
+ ${repo;org.apache.aries.rsa.discovery.zookeeper;2.0.0.SNAPSHOT},\
+ ${repo;org.apache.aries.rsa.provider.fastbin;2.0.0.SNAPSHOT},\
+ ${repo;org.apache.aries.rsa.core;2.0.0.SNAPSHOT},\
+ ${repo;org.apache.aries.rsa.topology-manager;2.0.0.SNAPSHOT}",\
+ felix.fileinstall.dir=${.}/configs/framework1,\
+ felix.fileinstall.noInitialDelay=true,\
org.apache.aries.rsa.bridge=true,\
+ zookeeper.admin.enableServer=false,\
org.osgi.test.cases.remoteserviceadmin.framework.properties="\
- org.apache.aries.rsa.discovery.tcp.address=localhost:7669,\
- org.apache.aries.rsa.discovery.tcp.peers=localhost:7668,\
- org.apache.aries.rsa.bridge=true"
+ felix.fileinstall.dir=${.}/configs/framework2,\
+ felix.fileinstall.noInitialDelay=true,\
+ org.apache.aries.rsa.bridge=true,\
+ zookeeper.admin.enableServer=false"
-runvm:\
- -Xmx512m
+ -Xmx512m,\
+ -Dorg.ops4j.pax.logging.DefaultServiceLog.level=WARN
#,"-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"
-runsystempackages:\
@@ -81,27 +99,39 @@
-runblacklist:\
osgi.identity;filter:='(osgi.identity=osgi.cmpn)'
-runbundles:\
- org.apache.aries.rsa.core;version='[2.0.0,2.0.1)',\
- org.apache.aries.rsa.spi;version='[2.0.0,2.0.1)',\
- org.apache.aries.rsa.topology-manager;version='[2.0.0,2.0.1)',\
- org.apache.aries.rsa.discovery.local;version='[2.0.0,2.0.1)',\
- org.apache.aries.rsa.discovery.tcp;version='[2.0.0,2.0.1)',\
- org.apache.aries.rsa.provider.tcp;version='[2.0.0,2.0.1)',\
+ org.ops4j.pax.logging.pax-logging-api;version='[2.3.3,2.3.4)',\
+ org.ops4j.pax.logging.pax-logging-log4j2;version='[2.3.3,2.3.4)',\
org.osgi.service.component;version='[1.5.1,1.5.2)',\
org.osgi.util.function;version='[1.2.0,1.2.1)',\
org.osgi.util.promise;version='[1.3.0,1.3.1)',\
+ org.apache.felix.scr;version='[2.2.18,2.2.19)',\
+ org.apache.felix.fileinstall;version='[3.7.4,3.7.5)',\
org.apache.felix.configadmin;version='[1.9.26,1.9.27)',\
org.apache.felix.eventadmin;version='[1.6.4,1.6.5)',\
- org.apache.felix.scr;version='[2.2.18,2.2.19)',\
+ org.glassfish.hk2.osgi-resource-locator;version='[3.0.0,3.0.1)',\
org.apache.servicemix.bundles.junit;version='[4.13.2,4.13.3)',\
assertj-core;version='[3.27.7,3.27.8)',\
net.bytebuddy.byte-buddy;version='[1.18.8,1.18.9)',\
- org.ops4j.pax.logging.pax-logging-api;version='[2.3.3,2.3.4)',\
- org.ops4j.pax.logging.pax-logging-log4j2;version='[2.3.3,2.3.4)',\
jakarta.activation-api;version='[2.1.4,2.1.5)',\
jakarta.xml.bind-api;version='[4.0.5,4.0.6)',\
- com.sun.xml.bind.jaxb-impl;version='[4.0.8,4.0.9)',\
com.sun.xml.bind.jaxb-core;version='[4.0.8,4.0.9)',\
+ com.sun.xml.bind.jaxb-impl;version='[4.0.8,4.0.9)',\
com.sun.istack.commons-runtime;version='[4.2.0,4.2.1)',\
- org.glassfish.hk2.osgi-resource-locator;version='[3.0.0,3.0.1)',\
+ org.fusesource.hawtbuf.hawtbuf;version='[1.11.0,1.11.1)',\
+ org.fusesource.hawtdispatch.hawtdispatch;version='[1.22.0,1.22.1)',\
+ io.dropwizard.metrics.core;version='[4.2.39,4.2.40)',\
+ org.xerial.snappy.snappy-java;version='[1.1.10.8,1.1.10.9)',\
+ io.netty.handler;version='[4.1.121,4.1.122)',\
+ io.netty.buffer;version='[4.1.121,4.1.122)',\
+ io.netty.transport;version='[4.1.121,4.1.122)',\
+ io.netty.common;version='[4.1.121,4.1.122)',\
+ io.netty.resolver;version='[4.1.121,4.1.122)',\
+ io.netty.transport-native-unix-common;version='[4.1.121,4.1.122)',\
+ io.netty.codec;version='[4.1.121,4.1.122)',\
+ org.apache.aries.rsa.spi;version='[2.0.0,2.0.1)',\
+ org.apache.aries.rsa.discovery.local;version='[2.0.0,2.0.1)',\
+ org.apache.aries.rsa.discovery.zookeeper;version='[2.0.0,2.0.1)',\
+ org.apache.aries.rsa.provider.fastbin;version='[2.0.0,2.0.1)',\
+ org.apache.aries.rsa.core;version='[2.0.0,2.0.1)',\
+ org.apache.aries.rsa.topology-manager;version='[2.0.0,2.0.1)',\
org.osgi.test.cases.remoteserviceadmin;version='[8.1.0,8.1.1)'
(aries-rsa) 02/09: Add reuse address socket option to fastbin TCP server
Posted by am...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
amichair pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/aries-rsa.git
commit 3b954b09ba353552420961d56b8ed7ef079da41e
Author: Amichai Rothman <am...@apache.org>
AuthorDate: Thu May 21 08:42:12 2026 +0300
Add reuse address socket option to fastbin TCP server
---
.../org/apache/aries/rsa/provider/fastbin/tcp/TcpTransportServer.java | 2 ++
1 file changed, 2 insertions(+)
diff --git a/provider/fastbin/src/main/java/org/apache/aries/rsa/provider/fastbin/tcp/TcpTransportServer.java b/provider/fastbin/src/main/java/org/apache/aries/rsa/provider/fastbin/tcp/TcpTransportServer.java
index a1475c5c..729b53d7 100644
--- a/provider/fastbin/src/main/java/org/apache/aries/rsa/provider/fastbin/tcp/TcpTransportServer.java
+++ b/provider/fastbin/src/main/java/org/apache/aries/rsa/provider/fastbin/tcp/TcpTransportServer.java
@@ -21,6 +21,7 @@ package org.apache.aries.rsa.provider.fastbin.tcp;
import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
+import java.net.StandardSocketOptions;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.UnknownHostException;
@@ -94,6 +95,7 @@ public class TcpTransportServer implements TransportServer {
try {
channel = ServerSocketChannel.open();
channel.configureBlocking(false);
+ channel.setOption(StandardSocketOptions.SO_REUSEADDR, true);
channel.socket().bind(bindAddress, backlog);
} catch (IOException e) {
throw new IOException("Failed to bind to server socket: " + bindAddress + " due to: " + e, e);
(aries-rsa) 03/09: ARIES-2225 Fix FastBinProvider intents handling to comply with spec
Posted by am...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
amichair pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/aries-rsa.git
commit 60cf02978822adc64ff763f860eaeb9f3a7c44d3
Author: Amichai Rothman <am...@apache.org>
AuthorDate: Thu May 21 09:04:05 2026 +0300
ARIES-2225 Fix FastBinProvider intents handling to comply with spec
---
.../aries/rsa/provider/fastbin/Activator.java | 2 +-
.../rsa/provider/fastbin/FastBinProvider.java | 65 +++++++++++-----------
2 files changed, 33 insertions(+), 34 deletions(-)
diff --git a/provider/fastbin/src/main/java/org/apache/aries/rsa/provider/fastbin/Activator.java b/provider/fastbin/src/main/java/org/apache/aries/rsa/provider/fastbin/Activator.java
index 17db549a..d1855340 100644
--- a/provider/fastbin/src/main/java/org/apache/aries/rsa/provider/fastbin/Activator.java
+++ b/provider/fastbin/src/main/java/org/apache/aries/rsa/provider/fastbin/Activator.java
@@ -67,7 +67,7 @@ public class Activator extends BaseActivator implements ManagedService {
client = provider.getClient();
server = provider.getServer();
Dictionary<String, Object> props = new Hashtable<>();
- props.put(RemoteConstants.REMOTE_INTENTS_SUPPORTED, new String[]{});
+ props.put(RemoteConstants.REMOTE_INTENTS_SUPPORTED, FastBinProvider.SUPPORTED_INTENTS);
props.put(RemoteConstants.REMOTE_CONFIGS_SUPPORTED, provider.getSupportedTypes());
register(DistributionProvider.class, provider, props);
}
diff --git a/provider/fastbin/src/main/java/org/apache/aries/rsa/provider/fastbin/FastBinProvider.java b/provider/fastbin/src/main/java/org/apache/aries/rsa/provider/fastbin/FastBinProvider.java
index 200a8e35..a707a894 100644
--- a/provider/fastbin/src/main/java/org/apache/aries/rsa/provider/fastbin/FastBinProvider.java
+++ b/provider/fastbin/src/main/java/org/apache/aries/rsa/provider/fastbin/FastBinProvider.java
@@ -22,7 +22,11 @@ import java.io.IOException;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;
import java.net.URI;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
import java.util.Map;
+import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;
@@ -37,6 +41,7 @@ import org.apache.aries.rsa.spi.DistributionProvider;
import org.apache.aries.rsa.spi.Endpoint;
import org.apache.aries.rsa.spi.ImportedService;
import org.apache.aries.rsa.spi.IntentUnsatisfiedException;
+import org.apache.aries.rsa.util.StringPlus;
import org.fusesource.hawtdispatch.Dispatch;
import org.fusesource.hawtdispatch.DispatchQueue;
import org.osgi.framework.BundleContext;
@@ -50,6 +55,14 @@ public class FastBinProvider implements DistributionProvider {
private static final Logger LOG = LoggerFactory.getLogger(FastBinProvider.class);
+ /**
+ * All intents supported by this provider.
+ * <p>
+ * We currently don't support any intents, but the TCK requires at least
+ * one to exist, so we add a placeholder default one that does nothing.
+ */
+ static final String[] SUPPORTED_INTENTS = { "aries.rsa.default" };
+
public static final String FASTBIN_CONFIG_TYPE = "aries.fastbin";
public static final String FASTBIN_ADDRESS = FASTBIN_CONFIG_TYPE + ".address";
@@ -101,56 +114,42 @@ public class FastBinProvider implements DistributionProvider {
return new String[] {FASTBIN_CONFIG_TYPE};
}
+ @SafeVarargs
+ private static <T> Set<T> union(Collection<T>... collections) {
+ Set<T> union = new HashSet<>();
+ for (Collection<T> c : collections)
+ if (c != null)
+ union.addAll(c);
+ return union;
+ }
+
@Override
public Endpoint exportService(final Object serviceO,
BundleContext serviceContext,
Map<String, Object> effectiveProperties,
Class[] exportedInterfaces) {
- // Compute properties
- /*
- Map<String, Object> properties = new TreeMap<String, Object>(String.CASE_INSENSITIVE_ORDER);
- for (String k : reference.getPropertyKeys()) {
- properties.put(k, reference.getProperty(k));
- }
- // Bail out if there is any intents specified, we don't support any
- Set<String> intents = Utils.normalize(properties.get(SERVICE_EXPORTED_INTENTS));
- Set<String> extraIntents = Utils.normalize(properties.get(SERVICE_EXPORTED_INTENTS_EXTRA));
- if (!intents.isEmpty() || !extraIntents.isEmpty()) {
- throw new UnsupportedOperationException();
- }
- // Bail out if there are any configurations specified, we don't support any
- Set<String> configs = Utils.normalize(properties.get(SERVICE_EXPORTED_CONFIGS));
- if (configs.isEmpty()) {
- configs.add(CONFIG);
- } else if (!configs.contains(CONFIG)) {
- throw new UnsupportedOperationException();
+ effectiveProperties.put(RemoteConstants.SERVICE_IMPORTED_CONFIGS, getSupportedTypes());
+ Set<String> intents = union(
+ StringPlus.normalize(effectiveProperties.get(RemoteConstants.SERVICE_EXPORTED_INTENTS)),
+ StringPlus.normalize(effectiveProperties.get(RemoteConstants.SERVICE_EXPORTED_INTENTS_EXTRA)));
+ intents.removeAll(Arrays.asList(SUPPORTED_INTENTS));
+ if (!intents.isEmpty()) {
+ LOG.warn("Unsupported intents found: {}. Not exporting service", intents);
+ return null;
}
- URI connectUri = new URI(this.server.getConnectAddress());
- String fabricAddress = connectUri.getScheme() + "://" + exportedAddress + ":" + connectUri.getPort();
-
- properties.remove(SERVICE_EXPORTED_CONFIGS);
- properties.put(SERVICE_IMPORTED_CONFIGS, new String[] { CONFIG });
- properties.put(ENDPOINT_FRAMEWORK_UUID, this.uuid);
- properties.put(FABRIC_ADDRESS, fabricAddress);
-
- String uuid = UuidGenerator.getUUID();
- properties.put(ENDPOINT_ID, uuid);
- */
-
String endpointId = UuidGenerator.getUUID();
effectiveProperties.put(RemoteConstants.ENDPOINT_ID, endpointId);
URI connectUri = URI.create(this.server.getConnectAddress());
String fastbinAddress = connectUri.getScheme() + "://" + exportedAddress + ":" + connectUri.getPort();
effectiveProperties.put(FASTBIN_ADDRESS, fastbinAddress);
- effectiveProperties.put(RemoteConstants.SERVICE_IMPORTED_CONFIGS, getSupportedTypes());
+ effectiveProperties.put(RemoteConstants.SERVICE_INTENTS, Arrays.asList(SUPPORTED_INTENTS));
- // Now, export the service
final EndpointDescription description = new EndpointDescription(effectiveProperties);
- // Export it
+ // export it
server.registerService(description.getId(), new ServerInvoker.ServiceFactory() {
public Object get() {
return serviceO;
(aries-rsa) 08/09: Fix EventListenerBridge missing previously registered consumers
Posted by am...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
amichair pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/aries-rsa.git
commit 86144b249af5785b75c313f4dd90585488fd02cb
Author: Amichai Rothman <am...@apache.org>
AuthorDate: Fri May 22 23:35:11 2026 +0300
Fix EventListenerBridge missing previously registered consumers
---
.../org/apache/aries/rsa/core/EventListenerBridge.java | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/rsa/src/main/java/org/apache/aries/rsa/core/EventListenerBridge.java b/rsa/src/main/java/org/apache/aries/rsa/core/EventListenerBridge.java
index 8d43a0c0..719cfb14 100644
--- a/rsa/src/main/java/org/apache/aries/rsa/core/EventListenerBridge.java
+++ b/rsa/src/main/java/org/apache/aries/rsa/core/EventListenerBridge.java
@@ -171,7 +171,7 @@ public class EventListenerBridge implements ServiceListener, ListenerHook {
private final Map<Long, Integer> producers = new ConcurrentHashMap<>(); // bundleId to producer types bitmap
private final BundleContext context;
- private ServiceRegistration<ServiceFactory<Adapter>> factoryRegistration;
+ private volatile ServiceRegistration<ServiceFactory<Adapter>> factoryRegistration;
private ServiceRegistration<ListenerHook> hookRegistration;
public EventListenerBridge(BundleContext context) {
@@ -215,11 +215,18 @@ public class EventListenerBridge implements ServiceListener, ListenerHook {
@SuppressWarnings("unchecked")
public void start() throws InvalidSyntaxException {
- // ServiceListener to track consumers
+ // add ServiceListener to track new/updated consumers
context.addServiceListener(this, SERVICE_LISTENER_FILTER);
- // ListenerHook to track what producers are looking for
+ // process previously registered consumers
+ ServiceReference<?>[] existing = context.getServiceReferences((String)null, SERVICE_LISTENER_FILTER);
+ if (existing != null) {
+ for (ServiceReference<?> sref : existing) {
+ serviceChanged(new ServiceEvent(ServiceEvent.REGISTERED, sref));
+ }
+ }
+ // register ListenerHook to track what producers are looking for
hookRegistration = context.registerService(ListenerHook.class, this, null);
- // our listener, backed by a ServiceFactory, to be used by producers
+ // register our listener, backed by a ServiceFactory, to be used by producers
factoryRegistration = (ServiceRegistration<ServiceFactory<Adapter>>)
context.registerService(
new String[] { ENDPOINT_LISTENER_CLASS_NAME, ENDPOINT_EVENT_LISTENER_CLASS_NAME },
@@ -268,7 +275,7 @@ public class EventListenerBridge implements ServiceListener, ListenerHook {
else if (!el) // only EEL (not EL)
modified |= newConsumers.add((ServiceReference<EndpointEventListener>)sref);
// update our own listener's scopes accordingly
- if (modified) {
+ if (modified && factoryRegistration != null) {
factoryRegistration.setProperties(getListenerProperties());
}
}
(aries-rsa) 05/09: ARIES-2228 Fix FastBinProvider socket not closed on shutdown
Posted by am...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
amichair pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/aries-rsa.git
commit 41b1bbdc96d4bf06b65f12fdabd545f8e53e61e7
Author: Amichai Rothman <am...@apache.org>
AuthorDate: Thu May 21 09:12:44 2026 +0300
ARIES-2228 Fix FastBinProvider socket not closed on shutdown
---
.../rsa/provider/fastbin/FastBinProvider.java | 7 +++-
.../provider/fastbin/tcp/TcpTransportServer.java | 39 ++++++++++++++++------
2 files changed, 35 insertions(+), 11 deletions(-)
diff --git a/provider/fastbin/src/main/java/org/apache/aries/rsa/provider/fastbin/FastBinProvider.java b/provider/fastbin/src/main/java/org/apache/aries/rsa/provider/fastbin/FastBinProvider.java
index 2962b684..16388e60 100644
--- a/provider/fastbin/src/main/java/org/apache/aries/rsa/provider/fastbin/FastBinProvider.java
+++ b/provider/fastbin/src/main/java/org/apache/aries/rsa/provider/fastbin/FastBinProvider.java
@@ -45,6 +45,7 @@ import org.apache.aries.rsa.spi.IntentUnsatisfiedException;
import org.apache.aries.rsa.util.StringPlus;
import org.fusesource.hawtdispatch.Dispatch;
import org.fusesource.hawtdispatch.DispatchQueue;
+import org.fusesource.hawtdispatch.ShutdownException;
import org.osgi.framework.BundleContext;
import org.osgi.service.remoteserviceadmin.EndpointDescription;
import org.osgi.service.remoteserviceadmin.RemoteConstants;
@@ -90,7 +91,11 @@ public class FastBinProvider implements DistributionProvider {
}
public void close() {
- client.stop();
+ try {
+ client.stop();
+ } catch (ShutdownException se) {
+ LOG.trace("exception while shutting down client", se);
+ }
final Semaphore counter = new Semaphore(0);
server.stop(() -> counter.release(1));
try {
diff --git a/provider/fastbin/src/main/java/org/apache/aries/rsa/provider/fastbin/tcp/TcpTransportServer.java b/provider/fastbin/src/main/java/org/apache/aries/rsa/provider/fastbin/tcp/TcpTransportServer.java
index 729b53d7..6fa593a4 100644
--- a/provider/fastbin/src/main/java/org/apache/aries/rsa/provider/fastbin/tcp/TcpTransportServer.java
+++ b/provider/fastbin/src/main/java/org/apache/aries/rsa/provider/fastbin/tcp/TcpTransportServer.java
@@ -30,6 +30,8 @@ import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
import java.util.HashMap;
import java.util.Map;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
import org.apache.aries.rsa.provider.fastbin.io.TransportAcceptListener;
import org.apache.aries.rsa.provider.fastbin.io.TransportServer;
@@ -163,22 +165,39 @@ public class TcpTransportServer implements TransportServer {
public void stop() {
stop(null);
}
+
public void stop(final Runnable onCompleted) {
if (acceptSource.isCanceled()) {
onCompleted.run();
} else {
- acceptSource.setCancelHandler(new Runnable() {
- public void run() {
- try {
- channel.close();
- } catch (IOException e) {
- }
- if (onCompleted != null) {
- onCompleted.run();
- }
- }
+ CountDownLatch latch = new CountDownLatch(1);
+ acceptSource.setCancelHandler(() -> {
+ closeChannel(onCompleted);
+ latch.countDown();
});
acceptSource.cancel();
+ // due to a race condition, sometimes during shutdown the hawt dispatcher
+ // bundle is stopped before we get here, so the handler above will never
+ // get executed. We give it a chance, but make sure to ultimately close
+ // the channel anyway to avoid leaving the socket in use.
+ try {
+ latch.await(5, TimeUnit.SECONDS);
+ } catch (InterruptedException ie) {
+ Thread.currentThread().interrupt();
+ }
+ if (channel.isOpen()) { // always close at the end
+ closeChannel(onCompleted);
+ }
+ }
+ }
+
+ private void closeChannel(Runnable onCompleted) {
+ try {
+ channel.close();
+ } catch (IOException ioe) {
+ }
+ if (onCompleted != null) {
+ onCompleted.run();
}
}
(aries-rsa) 04/09: ARIES-2226 Fix FastBinProvider handling of config-type properties to comply with TCK
Posted by am...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
amichair pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/aries-rsa.git
commit a4543664950198008b34b71fcd5cec732c808b4e
Author: Amichai Rothman <am...@apache.org>
AuthorDate: Thu May 21 09:05:21 2026 +0300
ARIES-2226 Fix FastBinProvider handling of config-type properties to comply with TCK
---
.../org/apache/aries/rsa/provider/fastbin/FastBinProvider.java | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/provider/fastbin/src/main/java/org/apache/aries/rsa/provider/fastbin/FastBinProvider.java b/provider/fastbin/src/main/java/org/apache/aries/rsa/provider/fastbin/FastBinProvider.java
index a707a894..2962b684 100644
--- a/provider/fastbin/src/main/java/org/apache/aries/rsa/provider/fastbin/FastBinProvider.java
+++ b/provider/fastbin/src/main/java/org/apache/aries/rsa/provider/fastbin/FastBinProvider.java
@@ -30,6 +30,7 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
import org.apache.aries.rsa.provider.fastbin.api.SerializationStrategy;
import org.apache.aries.rsa.provider.fastbin.io.ClientInvoker;
@@ -139,6 +140,14 @@ public class FastBinProvider implements DistributionProvider {
return null;
}
+ // to please the TCK - throw IAE for invalid config-type properties (we don't support any)
+ Map<String, Object> configProperties = effectiveProperties.entrySet().stream()
+ .filter(e -> e.getKey().startsWith(FASTBIN_CONFIG_TYPE))
+ .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
+ if (!configProperties.isEmpty()) {
+ throw new IllegalArgumentException("invalid config-type properties: " + configProperties);
+ }
+
String endpointId = UuidGenerator.getUUID();
effectiveProperties.put(RemoteConstants.ENDPOINT_ID, endpointId);
(aries-rsa) 07/09: Fix EventListenerBridge ignoring scope modifying events
Posted by am...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
amichair pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/aries-rsa.git
commit 09afffad95fd30786633f0cb0ca24f75af96dfec
Author: Amichai Rothman <am...@apache.org>
AuthorDate: Fri May 22 23:32:02 2026 +0300
Fix EventListenerBridge ignoring scope modifying events
---
rsa/src/main/java/org/apache/aries/rsa/core/EventListenerBridge.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/rsa/src/main/java/org/apache/aries/rsa/core/EventListenerBridge.java b/rsa/src/main/java/org/apache/aries/rsa/core/EventListenerBridge.java
index 716ced68..8d43a0c0 100644
--- a/rsa/src/main/java/org/apache/aries/rsa/core/EventListenerBridge.java
+++ b/rsa/src/main/java/org/apache/aries/rsa/core/EventListenerBridge.java
@@ -257,7 +257,8 @@ public class EventListenerBridge implements ServiceListener, ListenerHook {
if (event.getType() == ServiceEvent.UNREGISTERING)
el = eel = false; // remove both
// update our consumer lists with relevant one-interface-only consumers
- boolean modified = false;
+ boolean modified = event.getType() == ServiceEvent.MODIFIED
+ && (oldConsumers.contains(sref) || newConsumers.contains(sref));
if (!el)
modified |= oldConsumers.remove(sref);
else if (!eel) // only EL (not EEL)