Java Enterprise Edition Malik SAHEB malik.saheb@gmail.com, saheb@ece.fr
Course Objectives Understanding the value propositions of Java EE Getting a big picture of Java EE architecture and platform Getting high-level exposure of APIs and Technologies that constitute Java EE Developing Java EE Applications, using Eclipse Knowing the big actors in the market Going beyond Java EE and discovering Solutions for complete integration or SOA solutions around Java
Introduction What is Java EE? What are Java EE components? How applications are packaged? En quoi consiste une application Java EE empaquetée? Java EE in the market?
History In the beginning, there was darkness and cold. Then, mainframe terminals terminals Centralized, non-distributed
And then In the 90 s, systems should be client-server
These days Today, most enterprise applications use the multi-tier model
Typical Scenario Create a web application that is secure, reliable and can serve large quantities of data to thousands of concurrent users. One Solution: Hire lots of programmers to implement security, scalability, database features Difficult to find skillset High cost to build and maintain application Could be error prone
Key Observations Key observation made by application server vendors Most web applications require similar features such as database access, security, scalability, etc. Provide these features that are fully tested in a container to be leveraged by application developers Similar to Java and C++ libraries Allows application programmers to focus on business logic instead of writing all features from scratch
Java EE play into the game Java EE stand for Java Enterprise Edition Prefered Java EE and JEE (https://java.net/projects/javaee-spec/pages/jee) It is a public specification that embodies several technologies JNDI, JMS, JTA, JPA, EJB, JSP/Servlet, JCA, JAXRS,... JEE defines a model for developing multi-tier, web based, enterprise applications with distributed components Current version is Java EE 6, and Java EE 7 in progress Main goal of JEE 6 : simplify development. Using annotations and less XML configuration, more Plain Old Java Objects (POJOs), and simplified packaging.
Java EE Components Java EE an Architecture for Multitiered Applications Client Components Web Components Business Components Image source : http://docs.oracle.com/javaee/6/tutorial/doc/bnaay.html EIS = Enterprise information system-tier software runs on the EIS server, ex. ERP
Java EE Servers and Containers Image source : http://docs.oracle.com/javaee/6/tutorial/doc/bnabo.html
Services Provided by Java EE Web Services Remote Invocations for distributed applications Load balancing / clustering Database integration Persistence Transaction System, memory management Message-oriented middleware Security Dynamic deployment and many others.
Packaging Applications A Java EE application is a component delivered as an archive: Java Archive (JAR) (file with.jar extension) Web Archive (WAR), (file with.war extension) Enterprise Archive (EAR) (file with.ear extension) Archives allow to assemble a number of different Java EE applications using some of the same components. Ex : An EAR file contains Java EE modules and, optionally, deployment descriptors. A deployment descriptor, (.xml file), describes the deployment settings of an application, a module, or a component. Descriptor information can be changed without the need to modify the source code. Such information read at runtime by Java EE server.
Packaging Applications app.ear app.war META-INF application.xml app.jar file.jsp index. html WEB-INF META-INF web.xml vendor.xml lib classes EJB1.class EJB2.class ejb-jar.xml vendor.xml support.jar Servlet1.class Servlet2.class
Java EE Roles Java EE Product Provider the company/organisation that designs and makes available the Java EE platform Tool Provider Application Component Provider Enterprise Bean Developer Web Component Developer Application Client Developer Application Assembler Application Deployer and Administrator
Relationship among Java EE Containers Several defined Java EE APIs, used by all some or all container Web Container : JSP, JSF, Servlet, Bean Validation, Java Persistence, Connectors, Web Services,.. EJB Container : EJB, Bean Validation, Java Persistence, Connectors, Web Services, JTA, JMS,..
Architecture Java EE A typical scenario Client Web Niveau Web Serveur d'applications (JBoss) Navigateur HTTP Servlet JNDI JMS JMX HTTP JSP Session sans état Bean session sans état Session avec état Bean session avec état Client autonome App Java Entité Bean entité Entité Bean entité JDBC JDBC Serveur BdD Base de données
Vendors Traditional vendors (closed source) IBM WebSphere Application Server Oracle WebLogic Open Source JBoss Application Server / Red Hat Apache Tomcat (only a web container) Apache Geronimo ObjectWeb JoNas
Alternatives to Java EE Spring / Hibernate solution Spring and Hibernate are good tools but not standardized Widely used due to the complexity of previous Java EE specification A better productivity is delivered by Java EE 6 Microsoft.Net Similar functionality Forced into one platform and one vendor One of the key features of web services is the interoperability of.net and Java EE.
Java EE est un standard dominant Plusieurs fournisseurs: Large gamme de prix (gratuit à exorbitant). Le marché est dominé par une poignée de fournisseurs (IBM, Oracle, Red Hat) JBoss domine le secteur open source Jeu de composants mature développé sur une plate-forme mature (Java). Portabilité des applications entre plusieurs systèmes d exploitation et implémentations de serveur. Code écrit une fois et exécuté sur plusieurs serveurs d applications. Les outils de fournisseurs tiers profitent de la portabilité d une plate-forme standardisée.
Discovering The JBoss Application Server
22 Jboss Architecture Fully Compliant to Java EE 6 support profile Full et Web
JBoss EAP 6: Meilleure gestion des Applications On-premise and in the Cloud Utilisable sur toute environnement Intégré avec OpenShift (PaaS) Outils de Management/Supervision Déploiement/ Provisioning Monitoring Deploy Manage Console / scripts Auto scale & Performance Services utilisés à la demande Plusieurs modèles de programmation EE, Spring, OSGi, Ruby Monitor 23
Modes d'exploitation de JBoss EAP 6 Standalone servers Équivalent EAP 5/4/3 Full features (clusters,...) Domains Nouveauté EAP 6 Controlleur de domaine Gestion centralisée Configurations & déploiements multi-serveurs Full features (clusters,...) 24
25 Technologies Modernes
Eclipse by Red Hat Java EE6 JBoss Developer Studio (JBDS) Agile, Flexible, Pour développer vos applications HTML 5 and Mobile Maven Support WFK 2 Spring 2.5, 3.0, 3.1 GWT 1.7, 2.4 RichFaces 2.4 TorqueBox (TP) 26
27 Cloud Ready Platform
28 Web Console for administration JBoss provides also a command line interface for scripting
Lab 1 Installation JBoss