You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2022/10/21 08:01:20 UTC
[camel-karaf] 01/03: CAMEL-18411: Fix to call method via OSGi service reference in blueprint
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch camel-karaf-3.14.x
in repository https://gitbox.apache.org/repos/asf/camel-karaf.git
commit a631c5879ade06fba2dda2b83aee598bb02bd97b
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Oct 21 09:44:26 2022 +0200
CAMEL-18411: Fix to call method via OSGi service reference in blueprint
---
components/camel-bean-osgi/pom.xml | 62 ----------------------
.../services/org/apache/camel/other.properties | 7 ---
.../src/generated/resources/bean-osgi.json | 15 ------
.../camel/component/bean/osgi/Activator.java | 41 --------------
.../bean/osgi/OsgiBeanInfoTypeResolver.java | 31 -----------
.../services/org/apache/camel/other.properties | 2 +-
.../src/generated/resources/blueprint-main.json | 2 +-
.../services/org/apache/camel/other.properties | 2 +-
.../src/generated/resources/blueprint.json | 2 +-
components/pom.xml | 1 -
.../karaf/features/src/main/resources/features.xml | 1 -
11 files changed, 4 insertions(+), 162 deletions(-)
diff --git a/components/camel-bean-osgi/pom.xml b/components/camel-bean-osgi/pom.xml
deleted file mode 100644
index 5496cc04..00000000
--- a/components/camel-bean-osgi/pom.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.camel.karaf</groupId>
- <artifactId>components</artifactId>
- <version>3.14.6-SNAPSHOT</version>
- </parent>
-
- <artifactId>camel-bean-osgi</artifactId>
- <packaging>jar</packaging>
- <name>Camel Karaf :: Bean</name>
- <description>Camel Bean component</description>
-
- <properties>
- <camel.osgi.activator>
- org.apache.camel.component.bean.osgi.Activator
- </camel.osgi.activator>
- <firstVersion>1.0.0</firstVersion>
- <label>core,java</label>
- <title>Bean</title>
- </properties>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-bean</artifactId>
- </dependency>
-
- <!-- osgi support -->
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>osgi.core</artifactId>
- <scope>provided</scope>
- <optional>true</optional>
- <version>6.0.0</version>
- </dependency>
-
- </dependencies>
-
-</project>
diff --git a/components/camel-bean-osgi/src/generated/resources/META-INF/services/org/apache/camel/other.properties b/components/camel-bean-osgi/src/generated/resources/META-INF/services/org/apache/camel/other.properties
deleted file mode 100644
index 7950bf67..00000000
--- a/components/camel-bean-osgi/src/generated/resources/META-INF/services/org/apache/camel/other.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-# Generated by camel build tools - do NOT edit this file!
-name=bean-osgi
-groupId=org.apache.camel.karaf
-artifactId=camel-bean-osgi
-version=3.14.5-SNAPSHOT
-projectName=Camel Karaf :: Bean
-projectDescription=Camel Bean component
diff --git a/components/camel-bean-osgi/src/generated/resources/bean-osgi.json b/components/camel-bean-osgi/src/generated/resources/bean-osgi.json
deleted file mode 100644
index 1f27d63b..00000000
--- a/components/camel-bean-osgi/src/generated/resources/bean-osgi.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "other": {
- "kind": "other",
- "name": "bean-osgi",
- "title": "Bean",
- "description": "Camel Bean component",
- "deprecated": false,
- "firstVersion": "1.0.0",
- "label": "core,java",
- "supportLevel": "Stable",
- "groupId": "org.apache.camel.karaf",
- "artifactId": "camel-bean-osgi",
- "version": "3.14.5-SNAPSHOT"
- }
-}
diff --git a/components/camel-bean-osgi/src/main/java/org/apache/camel/component/bean/osgi/Activator.java b/components/camel-bean-osgi/src/main/java/org/apache/camel/component/bean/osgi/Activator.java
deleted file mode 100644
index b4ed2877..00000000
--- a/components/camel-bean-osgi/src/main/java/org/apache/camel/component/bean/osgi/Activator.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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.camel.component.bean.osgi;
-
-import org.apache.camel.component.bean.BeanInfoTypeResolver;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceRegistration;
-
-public class Activator implements BundleActivator {
- private ServiceRegistration<?> registration;
-
- @Override
- public void start(BundleContext context) throws Exception {
- Object factory = new OsgiBeanInfoTypeResolver();
- registration = context.registerService(BeanInfoTypeResolver.class.getName(), factory, null);
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- // release the reference
- if (registration != null) {
- context.ungetService(registration.getReference());
- }
- }
-
-}
diff --git a/components/camel-bean-osgi/src/main/java/org/apache/camel/component/bean/osgi/OsgiBeanInfoTypeResolver.java b/components/camel-bean-osgi/src/main/java/org/apache/camel/component/bean/osgi/OsgiBeanInfoTypeResolver.java
deleted file mode 100644
index 22aa8d5a..00000000
--- a/components/camel-bean-osgi/src/main/java/org/apache/camel/component/bean/osgi/OsgiBeanInfoTypeResolver.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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.camel.component.bean.osgi;
-
-import org.apache.camel.component.bean.BeanInfoTypeResolver;
-
-import java.lang.reflect.Method;
-
-public class OsgiBeanInfoTypeResolver implements BeanInfoTypeResolver {
-
- @Override
- public Object[] resolve(Class<?> type, Method explicitMethod) {
- // OSGi services wont work with the default bean info type resolver with synthetic types
- // so return null
- return null;
- }
-}
diff --git a/components/camel-blueprint-main/src/generated/resources/META-INF/services/org/apache/camel/other.properties b/components/camel-blueprint-main/src/generated/resources/META-INF/services/org/apache/camel/other.properties
index e192a1df..339f49e2 100644
--- a/components/camel-blueprint-main/src/generated/resources/META-INF/services/org/apache/camel/other.properties
+++ b/components/camel-blueprint-main/src/generated/resources/META-INF/services/org/apache/camel/other.properties
@@ -2,6 +2,6 @@
name=blueprint-main
groupId=org.apache.camel.karaf
artifactId=camel-blueprint-main
-version=3.14.5-SNAPSHOT
+version=3.14.6-SNAPSHOT
projectName=Camel Karaf :: Blueprint Main
projectDescription=Main support for OSGi Blueprint
diff --git a/components/camel-blueprint-main/src/generated/resources/blueprint-main.json b/components/camel-blueprint-main/src/generated/resources/blueprint-main.json
index 21f6c1d8..57491418 100644
--- a/components/camel-blueprint-main/src/generated/resources/blueprint-main.json
+++ b/components/camel-blueprint-main/src/generated/resources/blueprint-main.json
@@ -10,6 +10,6 @@
"supportLevel": "Stable",
"groupId": "org.apache.camel.karaf",
"artifactId": "camel-blueprint-main",
- "version": "3.14.5-SNAPSHOT"
+ "version": "3.14.6-SNAPSHOT"
}
}
diff --git a/components/camel-blueprint/src/generated/resources/META-INF/services/org/apache/camel/other.properties b/components/camel-blueprint/src/generated/resources/META-INF/services/org/apache/camel/other.properties
index 3b698d32..fbec4dd5 100644
--- a/components/camel-blueprint/src/generated/resources/META-INF/services/org/apache/camel/other.properties
+++ b/components/camel-blueprint/src/generated/resources/META-INF/services/org/apache/camel/other.properties
@@ -2,6 +2,6 @@
name=blueprint
groupId=org.apache.camel.karaf
artifactId=camel-blueprint
-version=3.14.5-SNAPSHOT
+version=3.14.6-SNAPSHOT
projectName=Camel Karaf :: Blueprint
projectDescription=Using Camel with OSGi Blueprint
diff --git a/components/camel-blueprint/src/generated/resources/blueprint.json b/components/camel-blueprint/src/generated/resources/blueprint.json
index 501f107a..8707ff00 100644
--- a/components/camel-blueprint/src/generated/resources/blueprint.json
+++ b/components/camel-blueprint/src/generated/resources/blueprint.json
@@ -10,6 +10,6 @@
"supportLevel": "Stable",
"groupId": "org.apache.camel.karaf",
"artifactId": "camel-blueprint",
- "version": "3.14.5-SNAPSHOT"
+ "version": "3.14.6-SNAPSHOT"
}
}
diff --git a/components/pom.xml b/components/pom.xml
index bdf25364..5859766b 100644
--- a/components/pom.xml
+++ b/components/pom.xml
@@ -31,7 +31,6 @@
<packaging>pom</packaging>
<modules>
- <module>camel-bean-osgi</module>
<module>camel-bean-validator-osgi</module>
<module>camel-blueprint</module>
<module>camel-blueprint-main</module>
diff --git a/platforms/karaf/features/src/main/resources/features.xml b/platforms/karaf/features/src/main/resources/features.xml
index 2cd47699..558c1675 100644
--- a/platforms/karaf/features/src/main/resources/features.xml
+++ b/platforms/karaf/features/src/main/resources/features.xml
@@ -66,7 +66,6 @@
<bundle>mvn:org.apache.camel/camel-main/${project.version}</bundle>
<bundle>mvn:org.apache.camel/camel-endpointdsl/${project.version}</bundle>
<!-- core components -->
- <bundle>mvn:org.apache.camel.karaf/camel-bean-osgi/${project.version}</bundle>
<bundle>mvn:org.apache.camel/camel-bean/${project.version}</bundle>
<bundle>mvn:org.apache.camel/camel-browse/${project.version}</bundle>
<bundle>mvn:org.apache.camel/camel-controlbus/${project.version}</bundle>