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

Jakarta EE 10 and Beyond

Jakarta EE 10 and Beyond

This session explores the current state and future of Jakarta EE - the technology platform formerly Java EE. We will include a high-level feature tour of the current version - Jakarta EE 10. We will also discuss how the community can contribute to Jakarta EE.

Java EE has been re-branded to Jakarta EE and moved to genuinely 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 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 critical technologies like Jakarta Security, Concurrency, REST, Persistence and JSON. It also targets the Core Profile to next-generation runtimes such as Quarkus and Helidon. Down the line in Jakarta EE 11, there may be further changes afoot for Jakarta Configuration, NoSQL, Messaging, Security, Concurrency, REST, Persistence/Data and MVC. You can contribute to all this and more.

It would be best if you came to this session with your thinking caps on and your sleeves rolled up. There is much to help move forward together that matters.

A N M Bazlur Rahman

June 09, 2022
Tweet

More Decks by A N M Bazlur Rahman

Other Decks in Technology

Transcript

  1. Jakarta EE 10 and Beyond A N M Bazlur Rahman

    Java Champion, Jakarta EE Ambassador, Author, Blogger, Speaker [email protected] @bazlur_rahman
  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
  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
  4. 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
  5. • 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
  6. • 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
  7. 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
  8. Jakarta Concurrency • Adding @ManagedExecutorDefinition, @ManagedScheduledExecutorDefinition, etc • CDI based,

    modernized equivalent for EJB @Asynchronous • Support for managed CompletionStage, ForkJoinPool, and parallel streams • CRON-like triggers
  9. @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;
  10. @Asynchronous @Asynchronous(executor = "java:app/concurrent/MyExecutorService") public CompletableFuture<Confirmation> 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));
  11. 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
  12. Bootstrap API SeBootstrap.Instance instance = SeBootstrap.start(new Application() { @Override public

    Set<Class<?>> 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();
  13. 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(); }
  14. Jakarta Security • OpenID Connect support • Serializable principal •

    Generics, default methods, exception cause added to Jakarta Authentication • Generic type added to Jakarta Authorization
  15. 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
  16. Jakarta Faces • @ClientWindowScoped • Pure Java Programmatic @View •

    Automatic extensionless mapping <context-param> <param-name>jakarta.faces.AUTOMATIC_EXTENSIONLESS_MAPPING</param-name> <param-value>true</param-value> </context-param> • type attribute in <h:inputText> <h:inputText type="email"/> • multiple and accept attributes in <h:inputFile> <h:inputFile value="#{bean.files}" multiple="true" accept="image/jpeg,image/png,image/gif"/> • layout="list" for <h:selectManyCheckbox> and <h:selectOneRadio> • onerror attribute in <f:websocket> <f:websocket channel="push" onerror="errorListener" onclose="closeListener"/> • <f:selectItemGroups> and <f:selectItemGroup> • Removal of JSP support, managed beans
  17. 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); ... }
  18. Core Profile Possible 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
  19. 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
  20. 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
  21. 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
  22. 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
  23. 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!
  24. 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_