Polymorphism + Java EE = Polymorph-EE-c
This post covers the various avatars of Java EE containers of various shapes, sizes and flavours !
Good old ‘full-blown’ application server
- Java EE Full Profile : everything you need !
- Tried, tested and successful for years in enterprises as well as start ups
The Java EE Web Profile
- Stripped down version of the full Java EE stack
- Support for limited (yet significant) Java EE APIs. The list of specifications is available in section WP.2.1 of the Web Profile specification document
- Vendors can choose to be compliant with only the Web Profile (e.g. Apache TomEE) or provide additional API support on top of the pre-defined list in the Web Profile
Embedded app servers
- The app server as a library concept allows you to launch a Java EE container as a process from existing Java code using specific APIs (not very different from putting another JAR in your classpath)
- Examples: Glassfish is the most prominent example of an embedded container
- Advantages: Good for testing, no setup/installation needed,
Embedded versions of Java EE APIs
- Some of the Java EE APIs specifications support execution in an embedded mode. What this means is that instead of using a Java EE (full or web profile) container, one can just leverage the services of a specific technology. This is generally achieved by using the specification centric library (JAR) invoking a bootstrap API (to be invoked by your Java code) which launches the container inside the same JVM – think of it as another (Java) process
- Embeddable API examples: EJB (OpenEJB), CDI (Weld, OpenWebBeans), Servlet (Jetty, Undertow)
Micro and BYOR (Build Your Own Runtime) frameworks
- These are lightweight breed of containers which revolves around the notion of supporting a limited set of specific APIs (in a pre-defined or flexible manner)
- Relatively new & fuelled by microservices, Docker etc.
- The BYOR style frameworks (e.g. Wildfly Swarm, KumuluzEE) allow you to pick and choose different Java EE APIs as per your requirements, build a fat JAR and kick start your application using java -jar
- As far as Micro mode is concerned, I am only aware of Payara Micro. Here is a previous blog post on this topic
- Similarities b/w Micro & BYOR: both embrace java -jar style
- Differences b/w Micro & BYOR: Micro version has pre-defined set of APIs as opposed to a more modular approach followed by BYOR style solutions
Have you seen/used Java EE in other avatars? Drop in a comment
Cheers!
For Apache Tomcat, TomEE and OpenWebBeans there are quite a few different ways to get it done:
Use Tomcat-embedded: servlet-3.1
Use Tomcat-embedded + OpenWebBeans: servlet-3.1 + cdi-1.2. All that takes about 5MB
Use TomEE shades (basically Tomcat + OpenWebBeans + JPA + MyFaces + CXF + + +): webprofile up to full EE in about 20..35MB
Fazit: with the Apache Tomcat++ stack you can scale up from tiny to full EE by maintaining full EE compat for the parts you really use.
LikeLike
Thanks for your inputs Mark !
LikeLike