Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Jakarta EE 10 and Beyond

Jakarta EE 10 and Beyond

Java EE has been re-branded to Jakarta EE and moved to truly open source governance under the Eclipse Foundation. There have so far been several successful releases under the Eclipse Foundation - Jakarta EE 8, 9, 9.1 and now 10. This session overviews what this means and offers a brief tour of Jakarta EE 10. We will also look at what the future might bring.

Jakarta EE 10 brings some long pending updates to key technologies like Jakarta Security, Concurrency, REST, Persistence and Faces. It also brings the Core Profile targeted to next-generation runtimes such as Open Liberty, Helidon and Quarkus. Down the line in Jakarta EE 11, there may be further changes afoot for Jakarta Configuration, NoSQL, Messaging, Security, Concurrency, REST, Persistence/Data, gRPC and MVC. You can contribute to all this and more.

You should come to this session with your thinking caps on and your sleeves rolled up. There is much to help move forward together that really matters.

Reza Rahman

April 17, 2018
Tweet

More Decks by Reza Rahman

Other Decks in Programming

Transcript

  1. Jakarta EE 10 and
    Beyond
    Reza Rahman
    Jakarta EE Ambassador, Author, Blogger, Speaker
    [email protected]
    @reza_rahman

    View full-size slide

  2. Jakarta EE
    • Java EE transitioned from JCP to Eclipse Foundation as Jakarta EE
    • Open governance, open source, open compatibility testing
    • Well-defined specification process, clear IP flow, vendor-neutral open collaboration, level playing field
    • Key stakeholders maintained if not expanded including Oracle, IBM, Red Hat, Payara and VMware
    • Community participation and contribution key
    https://jakarta.ee

    View full-size slide

  3. The Importance of Jakarta EE
    • Jakarta EE is an important part of the Java ecosystem
    • 25-35% of Java applications run on Jakarta EE application servers
    • WildFly, Payara, GlassFish, JBoss EAP, WebSphere/Liberty, WebLogic
    • 70-80% of Java applications depend on at least one or more Jakarta EE APIs
    • Tomcat, Hibernate, ActiveMQ, Jetty, CXF, Jersey, RESTEasy, Quarkus, MicroProfile, Spring
    2022 Jakarta EE Developer Survey: https://outreach.eclipse.foundation/jakarta-ee-developer-survey-2022

    View full-size slide

  4. Jakarta EE Evolution

    View full-size slide

  5. A Lively Ecosystem

    View full-size slide

  6. Jakarta EE 9/9.1
    • Jakarta EE 9 moves all relevant specifications from javax to jakarta namespace
    • Remove older technologies
    • Jakarta EE 9.1 adapts to Java SE 11 as opposed to Java SE 8
    • Primarily aimed for ecosystem to adapt to Jakarta

    View full-size slide

  7. Ambassadors’ Jakarta EE 11 Contribution Guide
    https://jakartaee-ambassadors.io/guide-to-contributing-to-jakarta-ee-11
    @jee_ambassadors

    View full-size slide

  8. • CDI Alignment
    • @Asynchronous, @Schedule, @Lock, @MaxConcurrency in Concurrency, @MessageListener in
    Messaging, @RolesAllowed, @RunAs in Security
    • Better CDI support in Batch, REST, Concurrency
    • Java SE Alignment
    • CompletionStage in Concurrency
    • Bootstrap APIs for REST, Messaging
    • Closing standardization gaps
    • OpenID Connect, JWT alignment, batch job definition Java API, @ManagedExecutorDefinition,
    more SQL support, multipart/form-data
    • Core/Microservices Profile
    • Deprecation/removal
    • EJB Entity Beans, embeddable EJB container, deprecated Servlet/Faces/CDI features
    • Innovation
    • NoSQL, MVC, Configuration, Repositories, gRPC
    Jakarta EE 10 in Context
    Made it! On the way Gap

    View full-size slide

  9. • CDI Alignment
    • @Asynchronous in Concurrency
    • Better CDI support in Batch
    • Java SE Alignment
    • CompletionStage, ForkJoinPool, parallel streams in Concurrency
    • Bootstrap APIs for REST
    • Closing standardization gaps
    • OpenID Connect, @ManagedExecutorDefinition, UUID as entity keys, more SQL support,
    multipart/form-data, @ClientWindowScoped, @View
    • Core Profile
    • Deprecation/removal
    • EJB Entity Beans, embeddable EJB container, deprecated Servlet/Faces/CDI features
    Jakarta EE 10 Themes

    View full-size slide

  10. Jakarta EE 10 at a Glance
    Authorization 2.1
    Activation 2.1
    Batch 2.1
    Connectors 2.1
    Mail 2.1
    Messaging 3.1
    Enterprise Beans 4.0
    RESTful Web Services
    3.1
    JSON Processing 2.1
    JSON Binding 3.0
    Annotations 2.1
    CDI Lite 4.0
    Interceptors 2.1
    Dependency Injection 2.0
    Servlet 6.0
    Server Pages 3.1
    Expression Language 5.0
    Debugging Support 2.0
    Standard Tag Libraries 3.0
    Faces 4.0
    WebSocket 2.1
    Enterprise Beans Lite 4.0
    Persistence 3.1
    Transactions 2.0
    Managed Beans 2.0
    CDI 4.0
    Authentication 3.0
    Concurrency 3.0
    Security 3.0
    Bean Validation 3.0
    Updated
    Not Updated
    New
    Platform
    Web Profile
    Core Profile

    View full-size slide

  11. Jakarta Concurrency
    • Adding @ManagedExecutorDefinition, @ManagedScheduledExecutorDefinition, etc
    • CDI based, modernized equivalent for EJB @Asynchronous
    • Support for managed CompletionStage, ForkJoinPool, and parallel streams
    • CRON-like triggers

    View full-size slide

  12. @ManagedExecutorDefinition
    @ContextServiceDefinition(
    name = "java:app/concurrent/AppContextOnly",
    propagated = APPLICATION,
    cleared = { TRANSACTION, SECURITY },
    unchanged = ALL_REMAINING)
    @ManagedExecutorDefinition(
    name = "java:app/concurrent/MyExecutorService",
    context = "java:app/concurrent/AppContextOnly",
    maxAsync = 5)
    ...
    @Resource(name = "java:app/concurrent/MyExecutorService")
    private ManagedExecutorService executor;

    View full-size slide

  13. @Asynchronous
    @Asynchronous(executor = "java:app/concurrent/MyExecutorService")
    public CompletableFuture processPayment(Order order) {
    try {
    ...
    Confirmation status = ...;
    return Asynchronous.Result.complete(status);
    } catch (...) {
    throw new CompletionException(x);
    ...
    }
    paymentService
    .processPayment(order)
    .thenAccept(
    confirmation -> System.out.println(confirmation));

    View full-size slide

  14. Jakarta REST
    • Standalone bootstrap API
    • Support for multipart/form-data
    • @Context deprecated in preparation for better alignment with CDI
    • Better support for HTTP cookies
    • Better default exception mapping

    View full-size slide

  15. Bootstrap API
    SeBootstrap.Instance instance = SeBootstrap.start(new Application() {
    @Override
    public Set> getClasses() {
    return Collections.singleton(GreetingResource.class);
    }
    }).toCompletableFuture().get();
    try (Client client = ClientBuilder.newClient()) {
    final Response response = client.target(instance.configuration()
    .baseUriBuilder().path("greet/World"))
    .request().get();
    System.out.println(response.readEntity(String.class));
    }
    instance.stop().toCompletableFuture().get();

    View full-size slide

  16. multipart/form-data
    @Path("/apply")
    @POST
    @Consumes(MediaType.MULTIPART_FORM_DATA)
    public Response applyForJob(
    @FormParam("name") String name,
    @FormParam("recentPhoto") EntityPart photo,
    @FormParam("resume") EntityPart resume) {
    processApplication(name,
    photo.getMediaType(), photo.getContent(),
    resume.getMediaType(), resume.getContent());
    return Response.ok("Application received").build();
    }

    View full-size slide

  17. Jakarta Security
    • OpenID Connect support
    • Serializable principal
    • Generics, default methods, exception cause added to Jakarta Authentication
    • Generic type added to Jakarta Authorization

    View full-size slide

  18. @OpenIdAuthenticationDefinition
    @OpenIdAuthenticationDefinition(
    providerURI = "https://accounts.google.com",
    clientId = "${config.clientId}",
    clientSecret = "${config.clientSecret}",
    redirectURI = "${baseURL}/callback",
    redirectToOriginalResource = true
    )

    View full-size slide

  19. Jakarta Persistence
    • Support for UUID for keys
    • CEILING, EXP, FLOOR, LN, POWER, ROUND, SIGN added to JPQL
    • LOCAL DATE, LOCAL DATETIME, and LOCAL TIME added to JPQL
    • EXTRACT added to JPQL
    • EntityManagerFactory/EntityManager extends AutoCloseable

    View full-size slide

  20. UUID Key
    @Entity
    public class Item {
    @Id @GeneratedValue(strategy=GenerationType.UUID)
    private java.util.UUID id;
    private String description;
    ...
    }

    View full-size slide

  21. Jakarta Faces
    • @ClientWindowScoped
    • Pure Java Programmatic @View
    • Automatic extensionless mapping

    jakarta.faces.AUTOMATIC_EXTENSIONLESS_MAPPING
    true

    • type attribute in

    • multiple and accept attributes in

    • layout="list" for and
    • onerror attribute in

    • and
    • Removal of JSP support, managed beans

    View full-size slide

  22. Pure Java Faces View
    @View("/hello.xhtml") @ApplicationScoped
    public class Hello extends Facelet {
    ...
    HtmlForm form = components.create(HtmlForm.COMPONENT_TYPE);
    body.getChildren().add(form);
    HtmlOutputText message = components.create(HtmlOutputText.COMPONENT_TYPE);
    form.getChildren().add(message);
    HtmlCommandButton actionButton = components.create(HtmlCommandButton.COMPONENT_TYPE);
    actionButton.addActionListener(e -> message.setValue("Hello, World"));
    actionButton.setValue("Do action");
    form.getChildren().add(actionButton);
    ...
    }

    View full-size slide

  23. Core Profile
    Updated
    Not
    Updated
    New
    RESTful Web Services
    3.1
    JSON Processing 2.1
    JSON Binding 3.0
    Annotations 2.1
    CDI Lite 4.0
    Interceptors 2.1
    Dependency Injection
    2.0

    View full-size slide

  24. CDI
    • CDI Lite targets Jakarta EE Core Profile and native compiled runtimes/build-time injection
    • CDI Lite excludes some features
    • Session/conversation scope, bean discovery mode = all, portable extensions, decorators, passivation
    • New build-compatible extensions API added as an alternative to portable extensions
    • Empty beans.xml means bean discovery mode = all annotated

    View full-size slide

  25. Other Changes
    • Java SE 11 required; Java SE 17 supported
    • Batch
    • Formalize CDI beans as Batch artifacts
    • @Inject JobOperator
    • @BatchProperty supports more Java types, @BatchProperty in methods/constructors
    • JSON Binding
    • Polymorphic serialization/deserialization
    • JPMS support

    View full-size slide

  26. Jakarta EE 11 Themes
    • CDI Alignment
    • @Schedule, @Lock, @MaxConcurrency in Concurrency, @MessageListener in Messaging,
    @RolesAllowed, @RunAs in Security
    • Better CDI support in REST, Batch, Concurrency
    • Java SE Alignment
    • Adapting to Records
    • Bootstrap API for Messaging
    • Modularity, standalone TCKs
    • Closing standardization gaps
    • JWT/OAuth alignment, batch job definition Java API, @Service
    • Deprecation
    • EJB
    • Innovation
    • NoSQL, MVC, Configuration, Repositories, gRPC

    View full-size slide

  27. Ways of Contributing
    • Follow Jakarta EE technologies that interest you and share opinion
    • https://jakarta.ee/connect/mailing-lists/
    • Advocate for a specific change or feature
    • https://jakarta.ee/projects/
    • Help implement a change in API, specification, TCK or implementation
    • Sign Eclipse Contributor Agreement
    • https://www.eclipse.org/legal/ECA.php
    • Becoming a committer comes much later
    • Engage an Ambassador if needed
    • https://jakartaee-ambassadors.io

    View full-size slide

  28. Summary
    • Jakarta EE 8, 9, 9.1 very significant for the future of Java
    • Many important changes for Jakarta EE 10 and beyond
    • Jakarta EE 11 work already started - time to get involved is now!

    View full-size slide

  29. Resources
    • JakartaOne Livestream recordings
    • https://jakartaone.org
    • Jakarta EE Community alias
    • https://accounts.eclipse.org/mailing-list/jakarta.ee-community
    • Jakarta EE Twitter handle
    • @JakartaEE
    • Jakarta Tech Talks
    • https://www.meetup.com/jakartatechtalks_

    View full-size slide