You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2026/07/13 07:14:12 UTC
(plc4x) 02/02: fix(plc4j): Migrated the OSGi TransportActivator to the new transports SPI.
This is an automated email from the ASF dual-hosted git repository.
sruehl pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git
commit 83dd291816f9218d4370da63781f489e3a69cd70
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Mon Jul 13 09:07:37 2026 +0200
fix(plc4j): Migrated the OSGi TransportActivator to the new transports SPI.
The SPI rework moved Transport from org.apache.plc4x.java.spi.transport
(old plc4j-spi jar, now a pom-only aggregator) to
org.apache.plc4x.java.spi.transports.api in plc4j-transports-api,
breaking compilation of plc4j-osgi.
---
plc4j/osgi/pom.xml | 2 +-
.../main/java/org/apache/plc4x/java/osgi/TransportActivator.java | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/plc4j/osgi/pom.xml b/plc4j/osgi/pom.xml
index c9c28309e8..bf37a95664 100644
--- a/plc4j/osgi/pom.xml
+++ b/plc4j/osgi/pom.xml
@@ -46,7 +46,7 @@
</dependency>
<dependency>
<groupId>org.apache.plc4x</groupId>
- <artifactId>plc4j-spi</artifactId>
+ <artifactId>plc4j-transports-api</artifactId>
<version>0.14.0-SNAPSHOT</version>
</dependency>
</dependencies>
diff --git a/plc4j/osgi/src/main/java/org/apache/plc4x/java/osgi/TransportActivator.java b/plc4j/osgi/src/main/java/org/apache/plc4x/java/osgi/TransportActivator.java
index f62960dc23..4091963889 100644
--- a/plc4j/osgi/src/main/java/org/apache/plc4x/java/osgi/TransportActivator.java
+++ b/plc4j/osgi/src/main/java/org/apache/plc4x/java/osgi/TransportActivator.java
@@ -24,14 +24,14 @@ import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
import org.osgi.framework.wiring.BundleWiring;
-import org.apache.plc4x.java.spi.transport.Transport;
+import org.apache.plc4x.java.spi.transports.api.Transport;
import java.util.Hashtable;
import java.util.ServiceLoader;
public class TransportActivator implements BundleActivator {
- private final List<ServiceRegistration<Transport>> registrations = new ArrayList<>();
+ private final List<ServiceRegistration<?>> registrations = new ArrayList<>();
private final String TRANSPORT_CODE ="org.apache.plc4x.transport.code";
private final String TRANSPORT_NAME ="org.apache.plc4x.transport.name";
@@ -39,7 +39,7 @@ public class TransportActivator implements BundleActivator {
@Override
public void start(BundleContext context) throws Exception {
ServiceLoader<Transport> transports = ServiceLoader.load(Transport.class, context.getBundle().adapt(BundleWiring.class).getClassLoader());
- for (Transport transport : transports) {
+ for (Transport<?> transport : transports) {
Hashtable<String, String> props = new Hashtable<>();
props.put(TRANSPORT_CODE, transport.getTransportCode());
props.put(TRANSPORT_NAME, transport.getTransportName());