Chapter 3243
Chapter 3243
(As Per the New Syllabus 2018-19 of Mumbai University for B.Sc. - IT, Semester V)
Published by : Mrs. Meena Pandey for Himalaya Publishing House Pvt. Ltd.,
“Ramdoot”, Dr. Bhalerao Marg, Girgaon, Mumbai - 400 004.
Phone: 022-23860170, 23863863; Fax: 022-23877178
E-mail: [email protected]; Website: www.himpub.com
Branch Offices :
New Delhi : “Pooja Apartments”, 4-B, Murari Lal Street, Ansari Road, Darya Ganj,
New Delhi - 110 002. Phone: 011-23270392, 23278631; Fax: 011-23256286
Nagpur : Kundanlal Chandak Industrial Estate, Ghat Road, Nagpur - 440 018.
Phone: 0712-2738731, 3296733; Telefax: 0712-2721216
Bengaluru : Plot No. 91-33, 2nd Main Road, Seshadripuram, Behind Nataraja Theatre,
Bengaluru - 560 020. Phone: 080-41138821;
Mobile: 09379847017, 09379847005
Hyderabad : No. 3-4-184, Lingampally, Besides Raghavendra Swamy Matham,
Kachiguda, Hyderabad - 500 027. Phone: 040-27560041, 27550139
Chennai : New No. 48/2, Old No. 28/2, Ground Floor, Sarangapani Street, T. Nagar,
Chennai - 600 012. Mobile: 09380460419
Pune : “Laksha” Apartment, First Floor, No. 527, Mehunpura,
Shaniwarpeth (Near Prabhat Theatre), Pune - 411 030.
Phone: 020-24496323, 24496333; Mobile: 09370579333
Lucknow : House No. 731, Shekhupura Colony, Near B.D. Convent School, Aliganj,
Lucknow - 226 022. Phone: 0522-4012353; Mobile: 09307501549
Ahmedabad : 114, “SHAIL”, 1st Floor, Opp. Madhu Sudan House, C.G. Road, Navrang
Pura, Ahmedabad - 380 009. Phone: 079-26560126; Mobile: 09377088847
Ernakulam : 39/176 (New No. 60/251), 1st Floor, Karikkamuri Road, Ernakulam,
Kochi - 682 011. Phone: 0484-2378012, 2378016; Mobile: 09387122121
Bhubaneswar : Plot No. 214/1342, Budheswari Colony, Behind Durga Mandap,
Bhubaneswar - 751 006. Phone: 0674-2575129; Mobile: 09338746007
Kolkata : 108/4, Beliaghata Main Road, Near ID Hospital, Opp. SBI Bank,
Kolkata - 700 010. Phone: 033-32449649; Mobile: 07439040301
DTP by : Bhakti S. Gaonkar
Printed at : M/s. Aditya Offset Process (I) Pvt. Ltd., Hyderabad. On behalf of HPH.
DEDICATION
First and foremost, I would like to thank God. In the process of putting this book together, I
realized how true this gift of writing is for me. You gave me the power to believe in my passion and
pursue my dreams.
I would like to dedicate this book to my Mom (Kavita S. Bajaj) and my son (Chirag Gurbani).
There is a reason my mom being whole and sole support towards my dedication, she is such an
identity who makes me rise each and every moment.
Finally, I would like to take this opportunity to express my deep sense of gratitude for lifetime to
a special person Mr. S.K. Srivastava of Himalaya Publishing House Pvt. Ltd. for his valuable
guidance, constant encouragement, immense motivation and new positivity in my life that has
appeared as a gift which is sent from God and he left figureprints of grace in my life. Really, I am
sincerely grateful to him for sharing his truthful and illuminating views which has motivated
throughout to write such fantastic content. Last but not Least would Like to Thanks to whole
Himalaya Production Team mainly to Archana maam for her great support
Prof. Kiran Gurbani
I would like to dedicate this book to my mother and father Mrs. Savitri Devi and (Late) Shri Jai
Prakash Vishwakarma. I would like to thank my wife Mrs. Archana for motivating me to write the
book. Special thanks to my son Himanshu and Priyanshu who always ask about Enterprise Java Book
I would like to thank all my family members for their support.
I am also grateful to my principal Mrs. Pratima Singh for motivation and encouragement.
Special thanks to my colleague Mr. Nitesh Shukla for completing the Enterprise Java Book.
Prof. Sandeep Vishwakarma
I Would like to dedicate this book to my mother, Anjum Shaikh – My first teacher
and
father, Arif Shaikh – my best teacher and mentor.
Prof. Shaikh Ahtesham Arif
Chapter
Understanding
1 Java EE
Chapter Outline
1.1 What is an Enterprise Application?
1.2 Architecture of an Enterprise Application
1.3 What is Java Enterprise Edition?
1.4 Java EE Technologies
1.5 Java EE Evolution
1.6 Glassfish Server
1.7 Chapter Based Questions
Java EE platform, for example, in Java SE applications. The Java Data Objects (JDO) API is
another standard for Java persistence, developed under the Java Community Process.
Java Message Service API: The Java Message Service (JMS) API is a messaging standard
that allows application components based on the Java 2 Platform, Enterprise Edition (J2EE)
to create, send, receive, and read messages. It enables distributed communication that is
loosely coupled, reliable, and asynchronous.
Java Transaction API (JTA): JTA specifies standard Java interfaces between a transaction
manager and the parties involved in a distributed transaction system: the resource manager,
the application server, and the transactional applications. The JTA specification was
developed by Sun Microsystems in cooperation with leading industry partners in the
transaction processing and database system arena.
1. Java EE5
It is introduced in May 11, 2006 by Oracle.
The aim of the Java EE 5 platform is to provide developers a powerful set of APIs while
reducing development time, reducing application complexity, and improving application
performance.
6 Enterprise JAVA
2. Java EE6
It is introduced in December 10, 2009.
The most important goal of the Java EE 6 platform is to simplify development by providing
a common foundation for the various kinds of components in the Java EE platform.
Developers benefit from productivity improvements with more annotations and less XML
configuration, more Plain Old Java Objects (POJOs), and simplified packaging.
Features of Java EE6
1. Profiles: configurations of the Java EE platform targeted at specific classes of applications.
Specifically, the Java EE 6 platform introduces a lightweight Web Profile targeted at next-
generation web applications, as well as a Full Profile that contains all Java EE technologies
and provides the full power of the Java EE 6 platform for enterprise applications.
2. New technologies, including the following:
(a) Java API for RESTful Web Services (JAX-RS)
(b) Managed Beans
(c) Contexts and Dependency Injection for the Java EE Platform (JSR 299), informally
known as CDI
(d) Dependency Injection for Java (JSR 330)
(e) Bean Validation (JSR 303)
(f) Java Authentication Service Provider Interface for Containers (JASPIC)
Understanding Java EE 7
(g) All this functionality is available using standard Java APIs and XML-based
configuration files.
6. In the Java EE 6 platform, new features of JavaServer Faces include the following:
(a) The ability to use annotations instead of a configuration file to specify managed beans
and other components
(b) Facelets, a display technology that replaces JavaServer Pages (JSP) technology using
XHTML files
(c) Ajax support
(d) Composite components
(e) Implicit navigation
7. The Java EE 6 platform requires JavaServer Faces 2.0 and Expression Language 2.2.
Java EE7
This technology is introduced in May 28, 2013.
The most important goal of the Java EE 7 platform is to simplify development by providing
a common foundation for the various kinds of components in the Java EE platform.
Developers benefit from productivity improvements with more annotations and less XML
configuration, more Plain Old Java Objects (POJOs), and simplified packaging.
The Java EE 7 Platform includes the following New Features
1. New technologies, including the following:
(a) Batch Applications for the Java Platform
(b) Concurrency Utilities for Java EE
(c) Java API for JSON Processing (JSON-P)
(d) Java API for WebSocket
2. Implement the new Java API for Batch Applications, JSON and Websocket in your code
(JSRs 352, 353 and 356).
3. Enable JAX-RS 2.0, EL 3.0 and JMS 2.0 Major enhancements in your code.
4. Implement the enhancements in JSF and JSP in your code.
5. Implement the enhancements in CDI and Bean Validation in your code.
6. Implement the enhancements in EJB and JPA in your code.
7. Describe and leverage the enhancements in the Java EE 7 platform.
8. Understand the new features for Java EE 7: JSON, WebSockets, HTML 5, JSF & Servlets.
9. Update existing applications to EE 7
10. Write applications for Java EE 7 and take advantage of the benefits of a cloud environment
and of the Java EE 7 improved simplification. Extend the range of the Java EE platform to
encompass emerging technologies in the web space.
GlassFish Server Open Source Edition is an open source application server built within the
GlassFish community.
Oracle GlassFish Server is based on GlassFish Server Open Source Edition.
GlassFish Server users benefit from a vibrant community that offers self-support,
contributes code and product features, product ideas and feedback, bug reports, and more.
It is a free, dual-licensed software under the GNU General Public License (GPL) and the
Common Development and Distribution License (CDDL). GlassFish was acquired by
Oracle in 2010.
GlassFish was developed based on a source code that was released by Sun and Oracle’s
TopLink persistence system.
The project was launched in 2005 and the first version that supported Java EE 5 was
released in 2006.
The reference implementation of Java EE is GlassFish, so it supports JMS, JavaServer Pages,
Enterprise JavaBeans, RMI, JPA and servlets. Because of its nature, developers can create
scalable and portable applications that easily integrate with legacy systems and technologies.
Oracle GlassFish Server provides a server for the development and deployment of Java
Platform, Enterprise Edition (Java EE platform) applications and web technologies based on
Java technology.
GlassFish Server 3.1 provides the following:
A lightweight and extensible core based on OSGi (Open Service Gateway Initiative)
Alliance standards
A web container
An easy-to-use Administration Console for configuration and management
Update Tool connectivity for updates and add-on components
Support for high availability clustering and load balancing