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

Basic method for Java EE Web Profile

Basic method for Java EE Web Profile

HASUNUMA Kenji

November 18, 2017
Tweet

More Decks by HASUNUMA Kenji

Other Decks in Programming

Transcript

  1. Java EE 7 Platform • Web Application • Enterprise Application

    • Web Services • Management and Security • Java EE-related Specs in Java SE
  2. Why Web profile? • Java EE Servers is too large,

    complex and slow to use quickly • For Web applications, some of Java EE feature is unused • Web container is often powerless for large Web applications
  3. Main features • Web application (JSF, MVC [*1] ) •

    RESTful Web service (JAX-RS) • Persistence and Transaction (JPA/JTA) • Dependency Injection (CDI) *1 : 3rd party framework or MVC (Java EE 8 Draft)
  4. Omit from Web profile • Inter-systems interfaces
 e.g. JAX-WS, JMS,

    JavaMail, JCA • Authentication/Authorization
 e.g. JACC/JAAS, JASPIC • Server management (JSR 77) • J2EE legacy components
  5. EJB Notice • Web profile contains EJB Lite; subset of

    EJB (Full specs.) • Incl. Session Bean (Local/No I/F), JPA/JTA, Async, Timer (Not persist), etc. • Excl. Session Bean (Remote), MDB, JAX-WS, Timer (Persist) etc.
  6. EJB Timer (Not persist) @Schedule(..., persistent = false) void polling()

    { // processing } (By default, the value of 'persistent' is true)
  7. History of Web Profile • Introduction as a part of

    Java EE 6
 (JAX-RS is excluded) • Add JAX-RS, WebSocket, JSON-P to Java EE 7 Web Profile • Add MVC to Java EE 8 Web Profile (by Early Draft)
  8. How to use? • Download 'Web Profile'
 e.g. GlassFish, WAS

    Liberty • Run as 'Web Profile'
 e.g. WildFly, JBoss EAP • Not Compatible
 e.g. WebLogic (Coming soon?)
  9. How small? Size (Installed) Size (Packaged) GlassFish 4.1.1 Full Platform

    126 MBytes 104 MBytes GlassFish 4.1.1 Web Profile 75.8 MBytes 57.9 MBytes
  10. How fast? Startup time (*) 1 2 3 WildFly 10

    Full Platform 4959 ms 5085 ms 5090 ms WildFly 10 Web Profile 3907 ms 4164 ms 3952 ms * Surface Pro 2 (Windows 10 / Core i5 4300U / 4GB RAM)
  11. Full vs. Web Profile Full Platform Web Profile Target System

    Web application Features Complete Restrict Speed Slow Fast Footprint Large Small Security Strict Basic
  12. How to use JavaMail? • JavaMail is not in Web

    Profile • But we can use JavaMail as a library of our applications • Other feature that is not in Web Profile can use as library of applications
  13. What's Microservice • The microservice architectural style is an approach

    to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms
 -- Martin Fowler • Spring Boot is a famous technology for implementation of microservices
  14. Java EE Microservice • Some technologies are available; Payara Micro,

    WAS Liberty, 
 WildFly Swarm, kumuluzEE, etc. • They consists of a subset of Java EE API (such a Web Profile) • They also run on Java SE runtime 
 -- Their footprint is so small
  15. Why needs Web Profile? • Java EE specs. are too

    large to build Web applications • Some of Java EE specs. are so often unused • We needed the standard that subset of Java EE for Web applications
  16. • Development of almost web apps. • In particular case:

    • Migration from Tomcat • Real time web apps. (WebSocket) • RESTful Web services (JAX-RS) Use case of Web Profile
  17. Attentions • Web Profile is NOT for systems but for

    applications • Web Profile is lightweight, but some important feature is omitted • There is not "Golden Hammer". We'd use the two specs. for purpose
  18. Basic method for 
 Java EE Web Profile HASUNUMA Kenji

    GlassFish Users Group Japan [email protected] Twitter: @khasunuma