Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

Adopt a JSR: CDI 2.0 at Devoxx UK

Slides of CDI 2.0 session for adopt a JSR at Devoxx UK

Audiolibros relacionados

Gratis con una prueba de 30 días de Scribd

Ver todo
  • Sé el primero en comentar

Adopt a JSR: CDI 2.0 at Devoxx UK

  1. 1. @antoine_sd @cdispec#AdoptAJSR Adopt a JSR, why not CDI 2.0 ? Antoine Sabot-Durand Red Hat @antoine_sd @cdispec
  2. 2. @antoine_sd @cdispec#AdoptAJSR • A brief story of CDI • Main Goal of CDI 2.0 • What will be in EDR1 • Adopt CDI Adopt a JSR, why not CDI 2.0 ?
  3. 3. @YourTwitterHandle#DVXFR14{session hashtag} @antoine_sd @cdispec#AdoptAJSR A brief history of CDI
  4. 4. @antoine_sd @cdispec#AdoptAJSR •CDI stands for Contexts and Dependency Injection •At the origin CDI was thought to fill the gap between Front spec and EJB - All EJB session beans are also CDI beans - CDI integrates Servlet scope as its core built-in contexts •CDI propose a programming model which provides: - A well-defined lifecycle for stateful objects bound to lifecycle contexts, where the set of contexts is extensible - A typesafe dependency injection mechanism - The ability to decorate or to associate interceptors to objects with a typesafe approach - An event notification model - An SPI allowing portable extensions to integrate cleanly with the container What is CDI
  5. 5. CDI Timeline Dec 2009 June 2013 Apr 2014 Sep 2014 CDI1.0 (Java EE 6) CDI1.1 (Java EE 7) CDI1.2 (1.1 MR) CDI2.0 Starts 2016 CDI2.0 released
  6. 6. @YourTwitterHandle#DVXFR14{session hashtag} @antoine_sd @cdispec#AdoptAJSR M ain Goals of CDI 2.0
  7. 7. @antoine_sd @cdispec#AdoptAJSR •We had strong feedback from the community: - Users feedback: - Need CDI to be more widely available in other Java EE specifications as a transverse integration solution - Be able to run CDI outside of a Java EE container. - 3rd parties spec and framework feedback: - Need to have an enhance SPI to ease integration - Need to have a lighter footprint of CDI API / Impl Goals
  8. 8. @antoine_sd @cdispec#AdoptAJSR •Java SE support (the spec was renamed Contexts and Dependency Injection for Java): - Use in desktop or alternative containers •Modularity allowing us to work on a CDI light “part”: - Removing parts of spec requiring proxies in implementation - Ease 3rd parties to develop CDI integration - This could make CDI compatible with embedded platform… CDI 2.0 main goals
  9. 9. @YourTwitterHandle#DVXFR14{session hashtag} @antoine_sd @cdispec#AdoptAJSR CDI 2.0 Early Draft 1
  10. 10. @antoine_sd @cdispec#AdoptAJSR •Early Draft 1 is about to be released •We are a bit late on our schedule but the work was bigger than expected •Some very old and important request were included in it •Features are in the 10 first requested ones by the survey Early Draft
  11. 11. @antoine_sd @cdispec#AdoptAJSR •We specified API to boot CDI in Java SE: •Desktop and non Java EE application can now use a standard way to boot CDI Early Draft content, Java SE support public static void main(String... args) {
 CDIProvider provider = CDI.getCDIProvider();
 CDI<Object> cdi = provider.initialize();
 // retrieve a bean and do work with it
 MyBean myBean =;
 // when done
  12. 12. @antoine_sd @cdispec#AdoptAJSR •The specification is now split in 3 parts - CDI core: the common specification regardless of the platform - CDI for Java SE: specific features for Java SE - Mainly SE boot - CDI for Java EE: specific feature for Java - EJB, servlet, EL, JSF integration •This split was necessary for Java SE support •It’s also the first step for a future CDI light Early Draft content, spec split
  13. 13. @antoine_sd @cdispec#AdoptAJSR •One of the oldest user request : •We decided to use the @Priority from commons annotation (JSR 250) •JSR 250 will need a Maintenance Release to have @Priority targeting a parameter Early Draft content, Event Ordering void afterLogin(@Observes @Priority(APPLICATION) LoggedInEvent event) { ... }
  14. 14. @antoine_sd @cdispec#AdoptAJSR •The most popular feature in the survey: •Based on Java 8 new Async API •Introducing a new kind of observes for backward compatibility with @ObservesAsync Early Draft content, Asynchronous public interface Event<T> { … public <U extends T> CompletionStage<U> fireAsync(U event); public <U extends T> CompletionStage<U> fireAsync(U event, Executor executor); … }
  15. 15. @YourTwitterHandle@antoine_sd @cdispec#AdoptAJSR More info on CDI 2.0 in our talk on Friday 3pm
  16. 16. @YourTwitterHandle#DVXFR14{session hashtag} @antoine_sd @cdispec#AdoptAJSR Adopt CDI 2.0
  17. 17. @antoine_sd @cdispec#AdoptAJSR •Reading and checking the spec after the split •Feedback on Java SE and other features •Vote on features on the CDI Jira •Propose new features or IDEAS CDI needs you!
  18. 18. @antoine_sd @cdispec#AdoptAJSR •CDI Website: •Weld website: •Mailing list: dev •Discussion: IRC / Freenode / #cdispec •Keep in touch: @cdispec Resources
  19. 19. Which JSR you’ll use 365 days a year? … JSR 365

    Sé el primero en comentar

    Inicia sesión para ver los comentarios

  • heathervc

    Aug. 5, 2015
  • luiz58

    Nov. 14, 2015

Slides of CDI 2.0 session for adopt a JSR at Devoxx UK


Total de vistas


En Slideshare


De embebidos


Número de embebidos









Me gusta