Camel
  1. Camel
  2. CAMEL-5145

Support cdi annotations in beans / camel-cdi refactor.

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.10.0
    • Component/s: None
    • Labels:
    • Estimated Complexity:
      Unknown

      Description

      Currently camel-cdi supports lookups by name. If user would like to use CDI-annotated class then he will not get injections done. During implementation of this feature I've done some more changes:
      1. Refactor test classes to rely on deltaspike container API. It allows to run tests with Open WebBeans (by default) or JBoss Weld (optional). There is no direct dependency to any implementation of CDI. Only public interfaces. Also I've removed long assert from test case and put equal check to test POJO.
      2. Remove BeanProvider and BeanManagerProvider, as they are already implemented in deltaspike-core (which is independent from CDI implementation)
      3. Implement CdiInjector.

      There is a issue DELTASPIKE-151 created by me today to support also Map as result of lookup which needs to be applied. If it will be not included then I'll attach another patch which will implement necessary code in camel-cdi.

      1. CAMEL-5145.diff
        44 kB
        Łukasz Dywicki
      2. CAMEL-5145-2.diff
        44 kB
        Łukasz Dywicki
      3. CAMEL-5145-3.diff
        0.6 kB
        Łukasz Dywicki
      4. CAMEL-5145-5.patch
        3 kB
        Łukasz Dywicki

        Issue Links

          Activity

          Łukasz Dywicki created issue -
          Łukasz Dywicki made changes -
          Field Original Value New Value
          Link This issue requires DELTASPIKE-151 [ DELTASPIKE-151 ]
          Hide
          Łukasz Dywicki added a comment -

          This issue needs additional effort in other project.

          Show
          Łukasz Dywicki added a comment - This issue needs additional effort in other project.
          Hide
          Łukasz Dywicki added a comment -

          Patch for CDI injections and refactor camel-cdi.

          Show
          Łukasz Dywicki added a comment - Patch for CDI injections and refactor camel-cdi.
          Łukasz Dywicki made changes -
          Attachment CAMEL-5145.diff [ 12521681 ]
          Hide
          Claus Ibsen added a comment -

          Thanks Lukasz. Is there an ETA on a new release of deltaspike, so we can avoid SNAPSHOT dependencies.

          Show
          Claus Ibsen added a comment - Thanks Lukasz. Is there an ETA on a new release of deltaspike, so we can avoid SNAPSHOT dependencies.
          Claus Ibsen made changes -
          Fix Version/s 2.10.0 [ 12317612 ]
          Hide
          Łukasz Dywicki added a comment -

          Hey,
          Deltaspike is planed to release 0.2 version soon, probably this or next week. Once issue I reported them will be closed I'll attach path to fix snapshot dependency.

          Show
          Łukasz Dywicki added a comment - Hey, Deltaspike is planed to release 0.2 version soon, probably this or next week. Once issue I reported them will be closed I'll attach path to fix snapshot dependency.
          Hide
          Claus Ibsen added a comment -

          Sounds good. Your patch looks great, so looking forward to the released deltaspike.

          Do you mind help with CDI documentation?

          Maybe a new page from the user guide about CDI? Like we have for blueprint etc.

          Using CDI with Camel
          http://camel.apache.org/user-guide.html

          Show
          Claus Ibsen added a comment - Sounds good. Your patch looks great, so looking forward to the released deltaspike. Do you mind help with CDI documentation? Maybe a new page from the user guide about CDI? Like we have for blueprint etc. Using CDI with Camel http://camel.apache.org/user-guide.html
          Hide
          Łukasz Dywicki added a comment -

          I'll take care about CDI docs too. There is bunch of features which are present for now in camel-spring but still missing in camel-cdi. I wish to implement at least part of them.

          Show
          Łukasz Dywicki added a comment - I'll take care about CDI docs too. There is bunch of features which are present for now in camel-spring but still missing in camel-cdi. I wish to implement at least part of them.
          Hide
          Łukasz Dywicki added a comment -

          New path uses method introduced in latest deltaspike commits.

          Show
          Łukasz Dywicki added a comment - New path uses method introduced in latest deltaspike commits.
          Łukasz Dywicki made changes -
          Attachment CAMEL-5145-2.diff [ 12522396 ]
          Hide
          Łukasz Dywicki added a comment -

          Change version of deltaspike to released (currently during vote).

          Show
          Łukasz Dywicki added a comment - Change version of deltaspike to released (currently during vote).
          Łukasz Dywicki made changes -
          Attachment CAMEL-5145-3.diff [ 12522755 ]
          Hide
          Claus Ibsen added a comment -

          Thanks Lukasz. Let us know when the release is in maven central, then we can apply the patch.

          Show
          Claus Ibsen added a comment - Thanks Lukasz. Let us know when the release is in maven central, then we can apply the patch.
          Hide
          Claus Ibsen added a comment -

          Lukasz you must mark [x] in grant license when you attach files. Otherwise we cannot accept your patches.

          Show
          Claus Ibsen added a comment - Lukasz you must mark [x] in grant license when you attach files. Otherwise we cannot accept your patches.
          Hide
          Łukasz Dywicki added a comment -

          Claus,
          All patches can be included in ASF works. At least the management page for attachements shows green "YES" for all of them. Btw. Do not include CAMEL-5145.diff it's outdated. Use 2nd and 3rd patch only.

          Show
          Łukasz Dywicki added a comment - Claus, All patches can be included in ASF works. At least the management page for attachements shows green "YES" for all of them. Btw. Do not include CAMEL-5145 .diff it's outdated. Use 2nd and 3rd patch only.
          Hide
          Hadrian Zbarcea added a comment -

          Lukasz, thanks for the patch(es). One thing you could try before we close this is to change the logging for org.apache.webbeans to file while running the tests, so that successful tests are silent.

          Show
          Hadrian Zbarcea added a comment - Lukasz, thanks for the patch(es). One thing you could try before we close this is to change the logging for org.apache.webbeans to file while running the tests, so that successful tests are silent.
          Hide
          Łukasz Dywicki added a comment -

          Fix java.util.logging statements printed to console.
          Fix checkstyle warnings.
          Fix duplicated slf4j binding dependencies.

          Show
          Łukasz Dywicki added a comment - Fix java.util.logging statements printed to console. Fix checkstyle warnings. Fix duplicated slf4j binding dependencies.
          Łukasz Dywicki made changes -
          Attachment CAMEL-5145-4.patch [ 12523965 ]
          Hide
          Łukasz Dywicki added a comment -

          Merge previous patch with latest changes on trunk. Fixes logging issue with open web beans. Fixes duplicated slf4j binding for weld profile.

          Show
          Łukasz Dywicki added a comment - Merge previous patch with latest changes on trunk. Fixes logging issue with open web beans. Fixes duplicated slf4j binding for weld profile.
          Łukasz Dywicki made changes -
          Attachment CAMEL-5145-5.patch [ 12523974 ]
          Łukasz Dywicki made changes -
          Attachment CAMEL-5145-4.patch [ 12523965 ]
          Hide
          Hadrian Zbarcea added a comment -

          Lukasz, patches applied with thanks. If the docs are up to date please feel free to mark this issue as resolved.

          Show
          Hadrian Zbarcea added a comment - Lukasz, patches applied with thanks. If the docs are up to date please feel free to mark this issue as resolved.
          Hide
          Claus Ibsen added a comment -

          Create new tickets for other cdi improvements

          Show
          Claus Ibsen added a comment - Create new tickets for other cdi improvements
          Claus Ibsen made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Assignee Łukasz Dywicki [ splatch ]
          Resolution Fixed [ 1 ]

            People

            • Assignee:
              Łukasz Dywicki
              Reporter:
              Łukasz Dywicki
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development