Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

OSGi CDI Integration Specification - Ray Augé (Liferay)

16 views

Published on

OSGi Community Event 2018 Presentation by Ray Augé (Liferay)

Abstract: This talk discusses the upcoming OSGi CDI Integration Specification and demonstrates common usage patterns and its component model that brings OSGi dynamics; like services and configuration, to CDI and provides for an ecosystem of CDI portable extentions.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

OSGi CDI Integration Specification - Ray Augé (Liferay)

  1. 1. Replace with icon 100x100 OSGI CDI Integration Specification Raymond Augé <raymond.auge@liferay.com>
  2. 2. Replace with icon 100x100 https://osgi.org/specification/osgi.enterprise /7.0.0/service.cdi.html Can I see the spec?
  3. 3. Replace with icon 100x100 https://github.com/apache/aries/tree/trunk/cdi Can I see the RI?
  4. 4. Replace with icon 100x100 Business requirements contingent on CDI Internal application model Extensible feature set Why CDI in OSGi?
  5. 5. Replace with icon 100x100 We 💖 DS! 99.9% of all Liferay bundles are DS and the vast majority will remain DS forever. But DS (Declarative Services)?
  6. 6. Replace with icon 100x100 DS by design is ultra light weight, and the DS annotations are merely convenient CLASS retention annotations processed at build time. I.e. DS is not an annotation processor. But DS …. 😿
  7. 7. Replace with icon 100x100 CDI, as part of its feature set, is an extensible annotation processing engine. Custom annotations! CDI
  8. 8. Replace with icon 100x100 CDI, allows for completely internal, private wiring. CDI
  9. 9. 2 31Replace with icon 100x100 Internal wiring - @Inject
  10. 10. 2 31Replace with icon 100x100 Services: singleton
  11. 11. 2 31Replace with icon 100x100 Services: singleton
  12. 12. 2 31Replace with icon 100x100 Services: bundle
  13. 13. 2 31Replace with icon 100x100 Services: prototype
  14. 14. 2 31Replace with icon 100x100 References
  15. 15. 2 31Replace with icon 100x100 Cardinality: mandatory
  16. 16. 2 31Replace with icon 100x100 Cardinality: optional
  17. 17. 2 31Replace with icon 100x100 Cardinality: multiple
  18. 18. 2 31Replace with icon 100x100 Cardinality: at least one (or n)
  19. 19. 2 31Replace with icon 100x100 Reference Policy: reluctant GREEDY by default
  20. 20. 2 31Replace with icon 100x100 Dynamic: mandatory
  21. 21. 2 31Replace with icon 100x100 Dynamic: optional
  22. 22. 2 31Replace with icon 100x100 Dynamic: multiple
  23. 23. 2 31Replace with icon 100x100 Components @ApplicationScoped @Service class Controller { @Inject @Reference ConfigurationAdmin cm; @Inject DRManager brm; @Inject @Reference Optional<Pojo> pojo; } class DRManager { @Inject @Reference Provider<List<DR>> foo; } class Web { @Inject Controller ctlr; } @FactoryComponent @Service class DR {} @SingleComponent class Pojo { @Inject @Reference Other other; } Container Component CDI Bundle
  24. 24. 2 31Replace with icon 100x100 OSGi Logger
  25. 25. 2 31Replace with icon 100x100 Configuration

×