You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2020/11/04 09:17:13 UTC

[GitHub] [camel] rmannibucau opened a new pull request #4562: setting up basic OSGi-CDI metadata in the manifest

rmannibucau opened a new pull request #4562:
URL: https://github.com/apache/camel/pull/4562


   - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it).  Trivial changes like typos do not require a JIRA issue.  Your pull request should address just this issue, without pulling in other changes.
   - [ ] Each commit in the pull request should have a meaningful subject line and body.
   - [ ] If you're unsure, you can format the pull request title like `[CAMEL-XXX] Fixes bug in camel-file component`, where you replace `CAMEL-XXX` with the appropriate JIRA issue.
   - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   - [ ] Run `mvn clean install -Psourcecheck` in your module with source check enabled to make sure basic checks pass and there are no checkstyle violations. A more thorough check will be performed on your pull request automatically.
   Below are the contribution guidelines:
   https://github.com/apache/camel/blob/master/CONTRIBUTING.md


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] astefanutti commented on a change in pull request #4562: [CAMEL-15725] setting up basic OSGi-CDI metadata in the manifest

Posted by GitBox <gi...@apache.org>.
astefanutti commented on a change in pull request #4562:
URL: https://github.com/apache/camel/pull/4562#discussion_r520594089



##########
File path: components/camel-cdi/src/main/java/org/apache/camel/cdi/AnnotatedDelegate.java
##########
@@ -21,11 +21,13 @@
 import java.util.HashSet;
 import java.util.Set;
 
+import javax.enterprise.inject.Vetoed;

Review comment:
       @rmannibucau can you confirm `mvn test -Powb-1.0` pass?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] astefanutti commented on a change in pull request #4562: [CAMEL-15725] setting up basic OSGi-CDI metadata in the manifest

Posted by GitBox <gi...@apache.org>.
astefanutti commented on a change in pull request #4562:
URL: https://github.com/apache/camel/pull/4562#discussion_r520594089



##########
File path: components/camel-cdi/src/main/java/org/apache/camel/cdi/AnnotatedDelegate.java
##########
@@ -21,11 +21,13 @@
 import java.util.HashSet;
 import java.util.Set;
 
+import javax.enterprise.inject.Vetoed;

Review comment:
       @rmannibucau can you confirm `mvn test -Powb-1.0` passes?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] rmannibucau commented on a change in pull request #4562: [CAMEL-15725] setting up basic OSGi-CDI metadata in the manifest

Posted by GitBox <gi...@apache.org>.
rmannibucau commented on a change in pull request #4562:
URL: https://github.com/apache/camel/pull/4562#discussion_r521197031



##########
File path: components/camel-cdi/pom.xml
##########
@@ -37,10 +37,37 @@
         <label>java</label>
         <title>CDI</title>
 
+        <camel.osgi.provide.capability>
+            osgi.cdi.extension;osgi.cdi.extension="org.apache.camel.cdi";
+                version:Version="${camel.osgi.version}";
+                aries.cdi.extension.bean.classes:List&lt;String&gt;="org.apache.camel.cdi.CdiCamelFactory,org.apache.camel.cdi.CdiEventComponent";
+                    uses:="javax.annotation,javax.enterprise.event,javax.enterprise.inject.spi",
+            osgi.service;objectClass:List&lt;String&gt;="javax.enterprise.inject.spi.Extension",
+                osgi.service;objectClass:List&lt;String&gt;="javax.enterprise.inject.spi.Extension";
+                    uses:="javax.enterprise.inject.spi";
+                    osgi.cdi.extension="org.apache.camel.cdi";
+                service.scope=prototype;service.vendor="Apache Software Foundation";
+                version:Version="${camel.osgi.version}";
+                effective:=active,
+            osgi.serviceloader;osgi.serviceloader="javax.enterprise.inject.spi.Extension";
+                register:="org.apache.camel.cdi.CdiCamelExtension";
+                    uses:="javax.enterprise.inject.spi";
+                    osgi.cdi.extension="org.apache.camel.cdi";
+                    service.scope=prototype;
+                    service.vendor="Apache Software Foundation";
+                version:Version="${camel.osgi.version}"
+        </camel.osgi.provide.capability>
+        <camel.osgi.require.capability>
+            osgi.extender;filter:="(&amp;(osgi.extender=osgi.cdi)(version>=1.0.0)(!(version>=2.0.0)))",

Review comment:
       Yes, osgi.cdi v1 (= cdi 2)




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] davsclaus commented on a change in pull request #4562: [CAMEL-15725] setting up basic OSGi-CDI metadata in the manifest

Posted by GitBox <gi...@apache.org>.
davsclaus commented on a change in pull request #4562:
URL: https://github.com/apache/camel/pull/4562#discussion_r522394538



##########
File path: components/camel-cdi/pom.xml
##########
@@ -37,10 +37,37 @@
         <label>java</label>
         <title>CDI</title>
 
+        <camel.osgi.provide.capability>
+            osgi.cdi.extension;osgi.cdi.extension="org.apache.camel.cdi";
+                version:Version="${camel.osgi.version}";
+                aries.cdi.extension.bean.classes:List&lt;String&gt;="org.apache.camel.cdi.CdiCamelFactory,org.apache.camel.cdi.CdiEventComponent";
+                    uses:="javax.annotation,javax.enterprise.event,javax.enterprise.inject.spi",
+            osgi.service;objectClass:List&lt;String&gt;="javax.enterprise.inject.spi.Extension",
+                osgi.service;objectClass:List&lt;String&gt;="javax.enterprise.inject.spi.Extension";
+                    uses:="javax.enterprise.inject.spi";
+                    osgi.cdi.extension="org.apache.camel.cdi";
+                service.scope=prototype;service.vendor="Apache Software Foundation";
+                version:Version="${camel.osgi.version}";
+                effective:=active,
+            osgi.serviceloader;osgi.serviceloader="javax.enterprise.inject.spi.Extension";
+                register:="org.apache.camel.cdi.CdiCamelExtension";
+                    uses:="javax.enterprise.inject.spi";
+                    osgi.cdi.extension="org.apache.camel.cdi";
+                    service.scope=prototype;
+                    service.vendor="Apache Software Foundation";
+                version:Version="${camel.osgi.version}"
+        </camel.osgi.provide.capability>
+        <camel.osgi.require.capability>
+            osgi.extender;filter:="(&amp;(osgi.extender=osgi.cdi)(version>=1.0.0)(!(version>=2.0.0)))",

Review comment:
       Yeah sure I would assume you have tried it so its safe to merge




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] davsclaus commented on pull request #4562: [CAMEL-15725] setting up basic OSGi-CDI metadata in the manifest

Posted by GitBox <gi...@apache.org>.
davsclaus commented on pull request #4562:
URL: https://github.com/apache/camel/pull/4562#issuecomment-725221324


   @astefanutti yeah I have created a ticket
   https://issues.apache.org/jira/browse/CAMEL-15842


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] astefanutti commented on a change in pull request #4562: [CAMEL-15725] setting up basic OSGi-CDI metadata in the manifest

Posted by GitBox <gi...@apache.org>.
astefanutti commented on a change in pull request #4562:
URL: https://github.com/apache/camel/pull/4562#discussion_r520623062



##########
File path: components/camel-cdi/src/main/java/org/apache/camel/cdi/AnnotatedDelegate.java
##########
@@ -21,11 +21,13 @@
 import java.util.HashSet;
 import java.util.Set;
 
+import javax.enterprise.inject.Vetoed;

Review comment:
       Wow, I see. It's aeecbc47c5accd0425c5cc6c2b5ba8b968d51274 that changed the compilation from using CDI 1.0 to CDI 2.0, and broke binary compatibility as the `Bean` interface changed its hierarchy to use the new `BeanAttributes` interface. So CDI 1.0 compatibility got broken starting Camel 3.0. AFAIK, nobody has ever complained so it may be a good empirical test to considered dropping support safe.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] davsclaus commented on a change in pull request #4562: [CAMEL-15725] setting up basic OSGi-CDI metadata in the manifest

Posted by GitBox <gi...@apache.org>.
davsclaus commented on a change in pull request #4562:
URL: https://github.com/apache/camel/pull/4562#discussion_r521256327



##########
File path: components/camel-cdi/pom.xml
##########
@@ -37,10 +37,37 @@
         <label>java</label>
         <title>CDI</title>
 
+        <camel.osgi.provide.capability>
+            osgi.cdi.extension;osgi.cdi.extension="org.apache.camel.cdi";
+                version:Version="${camel.osgi.version}";
+                aries.cdi.extension.bean.classes:List&lt;String&gt;="org.apache.camel.cdi.CdiCamelFactory,org.apache.camel.cdi.CdiEventComponent";
+                    uses:="javax.annotation,javax.enterprise.event,javax.enterprise.inject.spi",
+            osgi.service;objectClass:List&lt;String&gt;="javax.enterprise.inject.spi.Extension",
+                osgi.service;objectClass:List&lt;String&gt;="javax.enterprise.inject.spi.Extension";
+                    uses:="javax.enterprise.inject.spi";
+                    osgi.cdi.extension="org.apache.camel.cdi";
+                service.scope=prototype;service.vendor="Apache Software Foundation";
+                version:Version="${camel.osgi.version}";
+                effective:=active,
+            osgi.serviceloader;osgi.serviceloader="javax.enterprise.inject.spi.Extension";
+                register:="org.apache.camel.cdi.CdiCamelExtension";
+                    uses:="javax.enterprise.inject.spi";
+                    osgi.cdi.extension="org.apache.camel.cdi";
+                    service.scope=prototype;
+                    service.vendor="Apache Software Foundation";
+                version:Version="${camel.osgi.version}"
+        </camel.osgi.provide.capability>
+        <camel.osgi.require.capability>
+            osgi.extender;filter:="(&amp;(osgi.extender=osgi.cdi)(version>=1.0.0)(!(version>=2.0.0)))",

Review comment:
       OSGi is lovely ;)
   
   All that osgi metadata above is written by hand and can get out of cruft as its woodo for most people what has to be there. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] rmannibucau commented on a change in pull request #4562: [CAMEL-15725] setting up basic OSGi-CDI metadata in the manifest

Posted by GitBox <gi...@apache.org>.
rmannibucau commented on a change in pull request #4562:
URL: https://github.com/apache/camel/pull/4562#discussion_r521307998



##########
File path: components/camel-cdi/pom.xml
##########
@@ -37,10 +37,37 @@
         <label>java</label>
         <title>CDI</title>
 
+        <camel.osgi.provide.capability>
+            osgi.cdi.extension;osgi.cdi.extension="org.apache.camel.cdi";
+                version:Version="${camel.osgi.version}";
+                aries.cdi.extension.bean.classes:List&lt;String&gt;="org.apache.camel.cdi.CdiCamelFactory,org.apache.camel.cdi.CdiEventComponent";
+                    uses:="javax.annotation,javax.enterprise.event,javax.enterprise.inject.spi",
+            osgi.service;objectClass:List&lt;String&gt;="javax.enterprise.inject.spi.Extension",
+                osgi.service;objectClass:List&lt;String&gt;="javax.enterprise.inject.spi.Extension";
+                    uses:="javax.enterprise.inject.spi";
+                    osgi.cdi.extension="org.apache.camel.cdi";
+                service.scope=prototype;service.vendor="Apache Software Foundation";
+                version:Version="${camel.osgi.version}";
+                effective:=active,
+            osgi.serviceloader;osgi.serviceloader="javax.enterprise.inject.spi.Extension";
+                register:="org.apache.camel.cdi.CdiCamelExtension";
+                    uses:="javax.enterprise.inject.spi";
+                    osgi.cdi.extension="org.apache.camel.cdi";
+                    service.scope=prototype;
+                    service.vendor="Apache Software Foundation";
+                version:Version="${camel.osgi.version}"
+        </camel.osgi.provide.capability>
+        <camel.osgi.require.capability>
+            osgi.extender;filter:="(&amp;(osgi.extender=osgi.cdi)(version>=1.0.0)(!(version>=2.0.0)))",

Review comment:
       You can make it generated with bnd 5 using osgi.annotations (which is fine for camel since scope would be provided) but not sure it is better ;).
   At the end I don't care much how but I'd like to be able to use camel-cdi with osgi-cdi :).




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] davsclaus commented on a change in pull request #4562: [CAMEL-15725] setting up basic OSGi-CDI metadata in the manifest

Posted by GitBox <gi...@apache.org>.
davsclaus commented on a change in pull request #4562:
URL: https://github.com/apache/camel/pull/4562#discussion_r521132404



##########
File path: components/camel-cdi/pom.xml
##########
@@ -37,10 +37,37 @@
         <label>java</label>
         <title>CDI</title>
 
+        <camel.osgi.provide.capability>
+            osgi.cdi.extension;osgi.cdi.extension="org.apache.camel.cdi";
+                version:Version="${camel.osgi.version}";
+                aries.cdi.extension.bean.classes:List&lt;String&gt;="org.apache.camel.cdi.CdiCamelFactory,org.apache.camel.cdi.CdiEventComponent";
+                    uses:="javax.annotation,javax.enterprise.event,javax.enterprise.inject.spi",
+            osgi.service;objectClass:List&lt;String&gt;="javax.enterprise.inject.spi.Extension",
+                osgi.service;objectClass:List&lt;String&gt;="javax.enterprise.inject.spi.Extension";
+                    uses:="javax.enterprise.inject.spi";
+                    osgi.cdi.extension="org.apache.camel.cdi";
+                service.scope=prototype;service.vendor="Apache Software Foundation";
+                version:Version="${camel.osgi.version}";
+                effective:=active,
+            osgi.serviceloader;osgi.serviceloader="javax.enterprise.inject.spi.Extension";
+                register:="org.apache.camel.cdi.CdiCamelExtension";
+                    uses:="javax.enterprise.inject.spi";
+                    osgi.cdi.extension="org.apache.camel.cdi";
+                    service.scope=prototype;
+                    service.vendor="Apache Software Foundation";
+                version:Version="${camel.osgi.version}"
+        </camel.osgi.provide.capability>
+        <camel.osgi.require.capability>
+            osgi.extender;filter:="(&amp;(osgi.extender=osgi.cdi)(version>=1.0.0)(!(version>=2.0.0)))",

Review comment:
       Is this correct, it seems to be cdi 1.x only? We are CDI 2.0 onwards only for Camel 3.x.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] oscerd commented on a change in pull request #4562: [CAMEL-15725] setting up basic OSGi-CDI metadata in the manifest

Posted by GitBox <gi...@apache.org>.
oscerd commented on a change in pull request #4562:
URL: https://github.com/apache/camel/pull/4562#discussion_r520512810



##########
File path: components/camel-cdi/src/main/java/org/apache/camel/cdi/AnnotatedDelegate.java
##########
@@ -21,11 +21,13 @@
 import java.util.HashSet;
 import java.util.Set;
 
+import javax.enterprise.inject.Vetoed;

Review comment:
       @astefanutti can you provide your review?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] astefanutti commented on a change in pull request #4562: [CAMEL-15725] setting up basic OSGi-CDI metadata in the manifest

Posted by GitBox <gi...@apache.org>.
astefanutti commented on a change in pull request #4562:
URL: https://github.com/apache/camel/pull/4562#discussion_r517207009



##########
File path: components/camel-cdi/src/main/java/org/apache/camel/cdi/AnnotatedDelegate.java
##########
@@ -21,11 +21,13 @@
 import java.util.HashSet;
 import java.util.Set;
 
+import javax.enterprise.inject.Vetoed;

Review comment:
       IIRC, we did not used the `@Vetoed` annotation to maintain compatibility with CDI 1.0.
   
   It works because the default profile `weld-3.0` uses CDI 2.0, but other profiles may fail.
   
   That being said, we may want to consider dropping CDI 1.0 support.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] davsclaus merged pull request #4562: [CAMEL-15725] setting up basic OSGi-CDI metadata in the manifest

Posted by GitBox <gi...@apache.org>.
davsclaus merged pull request #4562:
URL: https://github.com/apache/camel/pull/4562


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] rmannibucau commented on a change in pull request #4562: [CAMEL-15725] setting up basic OSGi-CDI metadata in the manifest

Posted by GitBox <gi...@apache.org>.
rmannibucau commented on a change in pull request #4562:
URL: https://github.com/apache/camel/pull/4562#discussion_r517294396



##########
File path: components/camel-cdi/src/main/java/org/apache/camel/cdi/AnnotatedDelegate.java
##########
@@ -21,11 +21,13 @@
 import java.util.HashSet;
 import java.util.Set;
 
+import javax.enterprise.inject.Vetoed;

Review comment:
       It does not break CDI 1.0 compatibility since it does not add more beans. Will just enable aries-cdi to drop the beans early and does not affect OWB/Weld/Arc.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] rmannibucau commented on a change in pull request #4562: [CAMEL-15725] setting up basic OSGi-CDI metadata in the manifest

Posted by GitBox <gi...@apache.org>.
rmannibucau commented on a change in pull request #4562:
URL: https://github.com/apache/camel/pull/4562#discussion_r522421928



##########
File path: components/camel-cdi/pom.xml
##########
@@ -37,10 +37,37 @@
         <label>java</label>
         <title>CDI</title>
 
+        <camel.osgi.provide.capability>
+            osgi.cdi.extension;osgi.cdi.extension="org.apache.camel.cdi";
+                version:Version="${camel.osgi.version}";
+                aries.cdi.extension.bean.classes:List&lt;String&gt;="org.apache.camel.cdi.CdiCamelFactory,org.apache.camel.cdi.CdiEventComponent";
+                    uses:="javax.annotation,javax.enterprise.event,javax.enterprise.inject.spi",
+            osgi.service;objectClass:List&lt;String&gt;="javax.enterprise.inject.spi.Extension",
+                osgi.service;objectClass:List&lt;String&gt;="javax.enterprise.inject.spi.Extension";
+                    uses:="javax.enterprise.inject.spi";
+                    osgi.cdi.extension="org.apache.camel.cdi";
+                service.scope=prototype;service.vendor="Apache Software Foundation";
+                version:Version="${camel.osgi.version}";
+                effective:=active,
+            osgi.serviceloader;osgi.serviceloader="javax.enterprise.inject.spi.Extension";
+                register:="org.apache.camel.cdi.CdiCamelExtension";
+                    uses:="javax.enterprise.inject.spi";
+                    osgi.cdi.extension="org.apache.camel.cdi";
+                    service.scope=prototype;
+                    service.vendor="Apache Software Foundation";
+                version:Version="${camel.osgi.version}"
+        </camel.osgi.provide.capability>
+        <camel.osgi.require.capability>
+            osgi.extender;filter:="(&amp;(osgi.extender=osgi.cdi)(version>=1.0.0)(!(version>=2.0.0)))",

Review comment:
       Tried in a fake osgi container (winegrower) but happy to get some real osgi container test.
   That said it cant be worse than today evennif broken ;)




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] astefanutti commented on pull request #4562: [CAMEL-15725] setting up basic OSGi-CDI metadata in the manifest

Posted by GitBox <gi...@apache.org>.
astefanutti commented on pull request #4562:
URL: https://github.com/apache/camel/pull/4562#issuecomment-725324875


   @davsclaus great, thanks for creating the ticket.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] rmannibucau commented on a change in pull request #4562: [CAMEL-15725] setting up basic OSGi-CDI metadata in the manifest

Posted by GitBox <gi...@apache.org>.
rmannibucau commented on a change in pull request #4562:
URL: https://github.com/apache/camel/pull/4562#discussion_r520607787



##########
File path: components/camel-cdi/src/main/java/org/apache/camel/cdi/AnnotatedDelegate.java
##########
@@ -21,11 +21,13 @@
 import java.util.HashSet;
 import java.util.Set;
 
+import javax.enterprise.inject.Vetoed;

Review comment:
       Indeed it does not but not because of @vetoed, because it was compiled with cdi 2.0 API (bean attributes) so binary is not CDI 1.0 compatible. See org.apache.camel.cdi.CdiCamelBeanRepository#findByTypeWithName which uses javax.enterprise.inject.spi.BeanAttributes#getName for a single example.
   
   side note for that: pom setup breaks multiimpl setup for java > 8 (java 9 profile forces weld).




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org