This is an automated email from the ASF dual-hosted git repository.
cgarcia pushed a commit to branch feature/merlot
in repository https://gitbox.apache.org/repos/asf/plc4x-extras.git
The following commit(s) were added to refs/heads/feature/merlot by this push:
new 5fd2ca0 Fix ManagedService for IoTDB.
5fd2ca0 is described below
commit 5fd2ca089839c085ed6517751660198912013ff0
Author: César García <[email protected]>
AuthorDate: Tue Mar 17 18:44:22 2026 -0400
Fix ManagedService for IoTDB.
---
.../org.apache.plc4x.merlot.archiver/pom.xml | 20 +++++---
.../src/main/cfg/org.apache.plc4x.merlot.iotdb.cfg | 23 +++++++++
.../archiver/core/MerlotIoTDBManagedService.java | 59 ++++++++++++++++++++++
.../OSGI-INF/blueprint/archiver-service.xml | 25 ++++++++-
.../src/main/feature/feature.xml | 9 ++--
.../{ => src/main/resources/etc}/config.properties | 0
plc4j/tools/merlot/pom.xml | 3 ++
7 files changed, 127 insertions(+), 12 deletions(-)
diff --git a/plc4j/tools/merlot/org.apache.plc4x.merlot.archiver/pom.xml
b/plc4j/tools/merlot/org.apache.plc4x.merlot.archiver/pom.xml
index 3f0633d..8662592 100644
--- a/plc4j/tools/merlot/org.apache.plc4x.merlot.archiver/pom.xml
+++ b/plc4j/tools/merlot/org.apache.plc4x.merlot.archiver/pom.xml
@@ -80,17 +80,25 @@
<configuration>
<artifacts>
<artifact>
-
<file>src/main/cfg/org.apache.plc4x.merlot.decanter-grafana.cfg</file>
+
<file>src/main/cfg/org.apache.plc4x.merlot.archiver.cfg</file>
<type>cfg</type>
+ </artifact>
+ <artifact>
+
<file>src/main/cfg/org.apache.plc4x.merlot.decanter-grafana.cfg</file>
+ <type>cfg1</type>
</artifact>
<artifact>
-
<file>src/main/cfg/org.apache.plc4x.merlot.pvhtc.cfg</file>
+
<file>src/main/cfg/org.apache.plc4x.merlot.decanter-iotdb.cfg</file>
<type>cfg2</type>
- </artifact>
+ </artifact>
<artifact>
-
<file>src/main/cfg/org.apache.plc4x.merlot.archiver.cfg</file>
+
<file>src/main/cfg/org.apache.plc4x.merlot.iotdb.cfg</file>
<type>cfg3</type>
- </artifact>
+ </artifact>
+ <artifact>
+
<file>src/main/cfg/org.apache.plc4x.merlot.pvhtc.cfg</file>
+ <type>cfg4</type>
+ </artifact>
</artifacts>
</configuration>
</execution>
@@ -181,7 +189,7 @@
<dependency>
<groupId>org.apache.iotdb</groupId>
<artifactId>iotdb-session</artifactId>
- <version>2.0.5</version>
+ <version>2.0.6</version>
</dependency>
</dependencies>
</project>
diff --git
a/plc4j/tools/merlot/org.apache.plc4x.merlot.archiver/src/main/cfg/org.apache.plc4x.merlot.iotdb.cfg
b/plc4j/tools/merlot/org.apache.plc4x.merlot.archiver/src/main/cfg/org.apache.plc4x.merlot.iotdb.cfg
new file mode 100644
index 0000000..4a56335
--- /dev/null
+++
b/plc4j/tools/merlot/org.apache.plc4x.merlot.archiver/src/main/cfg/org.apache.plc4x.merlot.iotdb.cfg
@@ -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.
+#
+################################################################################
+
+parametro_01 = 01
+parametro_02 = 02
+parametro_03 = 03
+
diff --git
a/plc4j/tools/merlot/org.apache.plc4x.merlot.archiver/src/main/java/org/apache/plc4x/merlot/archiver/core/MerlotIoTDBManagedService.java
b/plc4j/tools/merlot/org.apache.plc4x.merlot.archiver/src/main/java/org/apache/plc4x/merlot/archiver/core/MerlotIoTDBManagedService.java
new file mode 100644
index 0000000..4e6edda
--- /dev/null
+++
b/plc4j/tools/merlot/org.apache.plc4x.merlot.archiver/src/main/java/org/apache/plc4x/merlot/archiver/core/MerlotIoTDBManagedService.java
@@ -0,0 +1,59 @@
+/*
+ * 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.plc4x.merlot.archiver.core;
+
+import java.util.Dictionary;
+import org.apache.plc4x.merlot.scheduler.api.Job;
+import org.apache.plc4x.merlot.scheduler.api.JobContext;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.cm.ConfigurationEvent;
+import org.osgi.service.cm.ConfigurationException;
+import org.osgi.service.cm.ConfigurationListener;
+import org.osgi.service.cm.ManagedService;
+import org.osgi.service.cm.ManagedServiceFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class MerlotIoTDBManagedService implements ManagedService,
ConfigurationListener, Job {
+ private static final Logger LOGGER =
LoggerFactory.getLogger(MerlotIoTDBManagedService.class);
+
+ private final BundleContext ctx;
+
+ public MerlotIoTDBManagedService(BundleContext ctx) {
+ this.ctx = ctx;
+ }
+
+ @Override
+ public void execute(JobContext context) {
+// throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updated(Dictionary<String, ?> dctnr) throws
ConfigurationException {
+ System.out.println("adfgadfgasd");
+ if (null != dctnr){
+
System.out.println("sldkfgapsdkjfalskjdflkasjdflkajsdflkjasldñkfjñalskjdflñkasjdf");
+ }
+// dctnr.keys().asIterator().forEachRemaining(System.out::println);
+ }
+
+ @Override
+ public void configurationEvent(ConfigurationEvent ce) {
+ System.out.println(ce.getPid());
+ }
+
+}
diff --git
a/plc4j/tools/merlot/org.apache.plc4x.merlot.archiver/src/main/resources/OSGI-INF/blueprint/archiver-service.xml
b/plc4j/tools/merlot/org.apache.plc4x.merlot.archiver/src/main/resources/OSGI-INF/blueprint/archiver-service.xml
index 4600b91..d628918 100644
---
a/plc4j/tools/merlot/org.apache.plc4x.merlot.archiver/src/main/resources/OSGI-INF/blueprint/archiver-service.xml
+++
b/plc4j/tools/merlot/org.apache.plc4x.merlot.archiver/src/main/resources/OSGI-INF/blueprint/archiver-service.xml
@@ -15,7 +15,11 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
default-activation="eager">
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0
+ http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd"
+ default-activation="eager">
<reference
@@ -47,6 +51,13 @@
<argument ref="blueprintBundleContext" />
</bean>
+ <bean id="MerlotIoTDBManagedServiceBean"
+
class="org.apache.plc4x.merlot.archiver.core.MerlotIoTDBManagedService"
+ scope="singleton"
+ activation="eager">
+ <argument ref="blueprintBundleContext" />
+ </bean>
+
<bean id="MerlotPvHtcCollectorImplBean"
class="org.apache.plc4x.merlot.archiver.impl.MerlotPvHtcCollectorImpl"
init-method="init"
@@ -94,7 +105,17 @@
<entry key="scheduler.immediate" value="true"/>
<entry key="scheduler.concurrent" value="false"/>
</service-properties>
- </service>
+ </service>
+
+ <service ref="MerlotIoTDBManagedServiceBean" auto-export="interfaces">
+ <service-properties>
+ <entry key="service.pid" value="org.apache.plc4x.merlot.iotdb"/>
+ <entry key="scheduler.name"
value="MerlotIoTDBManagedServiceBean"/>
+ <entry key="scheduler.period" value="5000"/>
+ <entry key="scheduler.immediate" value="true"/>
+ <entry key="scheduler.concurrent" value="false"/>
+ </service-properties>
+ </service>
<service ref="MerlotPvHtcCollectorImplBean" auto-export="interfaces">
<service-properties>
diff --git
a/plc4j/tools/merlot/org.apache.plc4x.merlot.features/src/main/feature/feature.xml
b/plc4j/tools/merlot/org.apache.plc4x.merlot.features/src/main/feature/feature.xml
index 4b826f0..c84412c 100644
---
a/plc4j/tools/merlot/org.apache.plc4x.merlot.features/src/main/feature/feature.xml
+++
b/plc4j/tools/merlot/org.apache.plc4x.merlot.features/src/main/feature/feature.xml
@@ -123,8 +123,8 @@
<bundle
start-level="60">mvn:org.apache.plc4x.merlot.db/org.apache.plc4x.merlot.db/${project.version}</bundle>
<!-- <bundle
start-level="40">mvn:org.apache.plc4x.dummy/org.apache.plc4x.dummy/${project.version}</bundle>
-->
-
-
+ <!--<bundle
start-level="60">mvn:org.apache.iotdb/iotdb-session/${iotdb.session.version}</bundle>-->
+ <bundle
start-level="60">wrap:mvn:org.apache.iotdb/iotdb-session/${iotdb.session.version}/$Bundle-SymbolicName=iotdb-session&Bundle-Version=${iotdb.session.version}&Bundle-ManifestVersion="2"&Export-Package=*;version="${iotdb.session.version}",!*</bundle>
</feature>
<feature name="plc4x-core" version="${project.version}">
@@ -253,8 +253,9 @@
<bundle
start-level="90">mvn:org.apache.plc4x.merlot.archiver/org.apache.plc4x.merlot.archiver/${project.version}</bundle>
<configfile
finalname="/etc/org.apache.plc4x.merlot.decanter-grafana.cfg">mvn:org.apache.plc4x.merlot.archiver/org.apache.plc4x.merlot.archiver/${project.version}/cfg</configfile>
<configfile
finalname="/etc/org.apache.plc4x.merlot.decanter-iotdb.cfg">mvn:org.apache.plc4x.merlot.archiver/org.apache.plc4x.merlot.archiver/${project.version}/cfg</configfile>
- <configfile
finalname="/etc/org.apache.plc4x.merlot.pvhtc.cfg">mvn:org.apache.plc4x.merlot.archiver/org.apache.plc4x.merlot.archiver/${project.version}/cfg2</configfile>
- <configfile
finalname="/etc/org.apache.plc4x.merlot.pvrt.cfg">mvn:org.apache.plc4x.merlot.archiver/org.apache.plc4x.merlot.archiver/${project.version}/cfg2</configfile>
+ <configfile
finalname="/etc/org.apache.plc4x.merlot.pvhtc.cfg">mvn:org.apache.plc4x.merlot.archiver/org.apache.plc4x.merlot.archiver/${project.version}/cfg2</configfile>
+ <configfile
finalname="/etc/org.apache.plc4x.merlot.pvrt.cfg">mvn:org.apache.plc4x.merlot.archiver/org.apache.plc4x.merlot.archiver/${project.version}/cfg2</configfile>
+ <configfile
finalname="/etc/org.apache.plc4x.merlot.iotdb.cfg">mvn:org.apache.plc4x.merlot.archiver/org.apache.plc4x.merlot.archiver/${project.version}/cfg3</configfile>
</feature>
<!--
diff --git a/plc4j/tools/merlot/org.apache.plc4x.merlot/config.properties
b/plc4j/tools/merlot/org.apache.plc4x.merlot/src/main/resources/etc/config.properties
similarity index 100%
rename from plc4j/tools/merlot/org.apache.plc4x.merlot/config.properties
rename to
plc4j/tools/merlot/org.apache.plc4x.merlot/src/main/resources/etc/config.properties
diff --git a/plc4j/tools/merlot/pom.xml b/plc4j/tools/merlot/pom.xml
index e8b0a8c..e1bd14f 100644
--- a/plc4j/tools/merlot/pom.xml
+++ b/plc4j/tools/merlot/pom.xml
@@ -135,6 +135,9 @@ under the License.
<tomcat.annotation.version>6.0.53</tomcat.annotation.version>
<annotation.version>13.0</annotation.version>
<kotlin.version>1.9.21</kotlin.version>
+
+ <!-- IoTDB -->
+ <iotdb.session.version>2.0.6</iotdb.session.version>
</properties>