Jakarta EE (Java EE), MicroProfile & Runtimes
Jakarta EE
Jakarta EE formally Java Platform, Enterprise Edition (Java EE) is a framework for developing enterprise features such as Web Services, Messaging, Dependency Injection and many more. Those features are defined by specifications, each specification consist of
- APIs and Specification document - defining and describing the specification
- Technology Compatibility Kit (TCK) - used for testing the code implemented based on the APIs and Specification document
- Compatible Implementation - implementation that successfully passes the TCK
Unlike Java Platform, Standard Edition (Java SE) applications which are packaged in Java Archive (JAR) format and executed directly using java -jar my-app.jar
on the Java Virtual Machine (JVM), Jakarta EE applications are packaged in Web Application Archive (WAR) and Enterprise Application Archive (EAR) formats, and we don’t run them directly on the JVM, instead we deploy them into Runtimes or Application Servers which themselves run on the JVM.
Java SE | Jakarta EE |
---|---|
Application (WAR, EAR) | |
Application (JAR) | Runtime (Application Server) |
JVM | JVM |
OS | OS |
So writing code that utilizing those features (APIs) will run on any runtime that have a Compatible Implementation.
Let’s say we have a class MyShoppingCart
and need to make sure there’s one instance of if for each Session on our application, In that case we only need to annotate our class with @SessionScoped
and our instance variable with @Inject
the runtime will take care of instantiating instances according to sessions, this is a part of a Specification in Jakarta EE called Jakarta Contexts and Dependency Injection (CDI)
@SessionScoped
public class MyShoppingCart {
// rest of class
}
@Inject MyShoppingCart myCart;
myCart.getItems();
- Here are two sample Jakarta EE specifications and their Compatible Implementations.
Specification | Compatible Implementations | Description |
---|---|---|
Jakarta Contexts and Dependency Injection (CDI) | Weld, Apache OpenWebBeans | Dependency Injection |
Jakarta RESTful Web Services | Jersey, RESTEasy | Web Services following the Representational State Transfer (REST) |
MicroProfile
MicroProfile is a framework focused on Microservices Architecture and Cloud-Native features such as Configuration, Metrics, Health Checks and many more. And like Jakarta EE code that is written utilizing MicroProfile APIs will run on any runtime that have a Compatible Implementation.
Runtimes
Runtimes or application servers are products that implement all or some of Jakarta EE and MicroProfile specifications, so they are capable of running code that utilize those specifications.
- Here is a list of runtimes that are compatible with Jakarta EE some of them are also compatible with MicroProfile like Payara, Open Liberty, and others.
Comments