Post on 02-Jun-2018
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 1/51
Introduction to
Java EE (J2EE)
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 2/51
CSE, IITBUmesh Bellur
Session Objectives
Understanding the value propositions ofJ2EE
Getting a big picture of J2EE architecture andplatform
Getting high-level exposure of APIs andTechnologies that constitute J2EE
You don't have to understand all the details
Understanding why J2EE can be used for asa platform for development and deploymentof web services
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 3/51
CSE, IITBUmesh Bellur
What is J2EE?
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 4/51
CSE, IITBUmesh Bellur
Challenges
Portability
DiverseEnvironments
Time-to-marketCore Competence
Assembly
Integration
KeyTechnologies
J2SE™
J2EE™
JMSServlet
JSP
Connector
XMLDataBinding
XSLT
Products
App Servers
Web Servers
Components
Databases
Object to DBtools
LegacySystems
Databases
TP Monitors
EIS Systems
Enterprise Computing
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 5/51
CSE, IITBUmesh Bellur
What Is the J2EE?
Open and standard based platform for developing, deploying and managing
n-tier, Web-enabled, server-centric, and
component-based enterprise applications
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 6/51
CSE, IITBUmesh Bellur
The Java™ Platform
High-EndServer
Java TechnologyEnabled Desktop
WorkgroupServer
Java TechnologyEnabled Devices
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 7/51
The Java TM Platform
OptionalPackages
Java 2
EnterpriseEdition(J2EE)
Java 2
StandardEdition(J2SE)
JVM
JavaCardAPIs
CardVM
OptionalPackages
PersonalBasis Profile
PersonalProfile
Foundation Profile
CDC
MIDP
CLDC
KVM
Java 2 Platform Micro Edition(J2METM)
* Under development in JCP
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 8/51
CSE, IITBUmesh Bellur
Open and Standard Solution
Use "component and container" model inwhich container provides system services in
a well-defined and as industry standard
J2EE is that standard that also provides
portability of code because it is based on
Java technology and standard-based Java
programming APIs
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 9/51
CSE, IITBUmesh Bellur
Why J2EE?
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 10/51
CSE, IITBUmesh Bellur
Platform Value to Developers
Can use any J2EE implementat ion fordevelopment and deployment Use production-quality standard implementation which is
free for development/deployment
Use high-end commercial J2EE products for scalability andfault-tolerance
Vast amount of J2EE communi ty resources
Many J2EE related books, articles, tutorials, quality code
you can use, best practice guidelines, design patterns etc.
Can use off-the-shelf 3rd-party businesscomponents
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 11/51
CSE, IITBUmesh Bellur
Platform Value to Vendors
Vendors work together on specifications andthen compete in implementations
In the areas of Scalability, Performance,
Reliability, Availability, Management and
development tools, and so on
Freedom to innovate while maintaining the
portability of applications
Do not have create/maintain their ownpropr ietary APIs
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 12/51
CSE, IITBUmesh Bellur
Platform Value to Business Customers
App l ication po rtab i l ity Many implementation choices are possible
based on various requirements
Price (free to high-end), scalability (single CPU toclustered model), reliability, performance, tools,
and more
Best of breed of applications and platforms
Large developer pool
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 13/51
CSE, IITBUmesh Bellur
J2EE APIs &Technologies
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 14/51
CSE, IITBUmesh Bellur
J2EE 1.4 APIs and Technologies
J2SE 1.4 (improved) JAX-RPC (new)
Web Service for J2EE
J2EE Management
J2EE Deployment
JMX 1.1
JMS 1.1
JTA 1.0
Servlet 2.4 JSP 2.0
EJB 2.1
JAXR
Connector 1.5
JACC
JAXP 1.2
JavaMail 1.3 JAF 1.0
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 15/51
CSE, IITBUmesh Bellur
Java EE 5
JAX-WS 2.0 & JSR 181 Java Persistence
EJB 3.0
JAXB 2.0 JavaSever Faces 1.2 – new to Platform
JSP 2.1 – Unification w/ JSF 1.2
StAX – Pull Parser – new to Platform
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 16/51
CSE, IITBUmesh Bellur
Servlet &
JSP (JavaServerPages)
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 17/51
CSE, IITBUmesh Bellur
What is a Servlet?
Java™ objects which extend the functionalityof a HTTP server
Dynamic contents generation
Better alternative to CGI, NSAPI, ISAPI, etc. Efficient
Platform and server independent
Session management
Java-based
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 18/51
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 19/51
CSE, IITBUmesh Bellur
What is JSP Technology?
Enables separation of business logicfrom presentation
Presentation is in the form of HTML or
XML/XSLT
Business logic is implemented as Java Beansor custom tags
Better maintainability, reusability
Extensible via custom tags Builds on Servlet technology
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 20/51
CSE, IITBUmesh Bellur
EJB
(Enterprise JavaBeans)
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 21/51
CSE, IITBUmesh Bellur
What is EJB Technology?
A server-side component technology Easy development and deployment of Java
technology-based application that are:
Transactional, distributed, multi-tier, portable,scalable, secure, …
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 22/51
CSE, IITBUmesh Bellur
Why EJB Technology?
● Leverages the benefits of component-model on the server side
● Separates business logic from system code
Container provides system services
● Provides framework for portable components
Over different J2EE-compliant servers
Over different operational environments
● Enables deployment-time configuration Deployment descriptor
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 23/51
CSE, IITBUmesh Bellur
EJB Architecture
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 24/51
CSE, IITBUmesh Bellur
Enterprise JavaBeans
Enterprise JavaBeans
Entity Bean Message-Driven Bean
Synchronous communication Asynchronous communication
Stateless Stateful
Bean managedPersistence
(BMP)
Container managedPersistence
(CMP)
Session Bean
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 25/51
CSE, IITBUmesh Bellur
JMS
(Java MessageService)
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 26/51
CSE, IITBUmesh Bellur
Java Message Service (JMS)
Messaging systems (MOM) provide De-coupled communication
Asynchronous communication
Plays a role of centralized post office
Benefits of Messaging systems Flexible, Reliable, Scalable communication
systems
Point-to-Point, Publish and Subscribe
JMS defines standard Java APIs tomessaging systems
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 27/51
CSE, IITBUmesh Bellur
Connector
Architecture
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 28/51
CSE, IITBUmesh Bellur
Connector Architecture
Defines standard API for integrating J2EEtechnology with EIS systems CICS, SAP, PeopleSoft, etc.
Before Connector architecture, each App server hasto provide an proprietary adaptor for each EISsystem m (# of App servers) x n (# of EIS's) Adaptors
With Connector architecture, same adaptor workswith all J2EE compliant containers 1 (common to all App servers) x n (# of EIS's) Adaptors
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 29/51
CSE, IITBUmesh Bellur
m x n Problem Before Connector
Architecture
App
Server1
App
Server
App
Server3
AppServer2
SAP
EIS4
EIS3
m n
EIS2
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 30/51
CSE, IITBUmesh Bellur
JAAS (Part of J2SE1.4)(Java Authentication &Authorization Service)
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 31/51
CSE, IITBUmesh Bellur
JAAS: Authentication
Pluggable authentication framework Userid/password
Smartcard
Kerberos
Biometric
Application portability regardless of authentication
schemes underneath
JAAS provides authentication scheme independent API
Authentication schemes are specified Login configuration
file, which will be read by JAAS
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 32/51
CSE, IITBUmesh Bellur
JAAS Pluggable Authentication
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 33/51
CSE, IITBUmesh Bellur
Other J2EE APIs &
Technologies
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 34/51
CSE, IITBUmesh Bellur
JNDI
Java Naming and Directory Interface
Utilized by J2EE applications to locate
resources and objects in portable fashion Applications use symbolic names to find object
references to resources via JNDI
The symbolic names and object references have
to be configured by system administrator whenthe application is deployed.
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 35/51
CSE, IITBUmesh Bellur
JDBC
Provides standard Java programming API
to relational database
Uses SQL
Vendors provide JDBC compliant driver
which can be invoked via standard Java
programming API
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 36/51
CSE, IITBUmesh Bellur
J2EE Management (JSR-77)
Management applications should be able todiscover and interpret the managed data of
any J2EE platform
Single management platform can manage
multiple J2EE servers from different vendors
Management protocol specifications ensure a
uniform view by SNMP and WBEM
management stations
Leverages JMX
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 37/51
CSE, IITBUmesh Bellur
J2EE Deployment (JSR-88) - J2EE 1.4
Tools J2EE PlatformsStandard
Deployment API(Universal Remote)
IDEs
Vendor DeployTools
ManagementTools
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 38/51
CSE, IITBUmesh Bellur
J2EE App ServerApp
JMX
JMX
JMX defacto
Dynamic DeploymentJMX API intothe J2EE 1.4 platform
A single technology for the J2EE platform
JMX
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 39/51
CSE, IITBUmesh Bellur
J2EE is an End-to-End Architecture
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 40/51
CSE, IITBUmesh Bellur
N-tier J2EE Architecture
Web Tier EJB Tier
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 41/51
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 42/51
CSE, IITBUmesh Bellur
J N D I
J2SE
J M S
R M I / I I O P
J D B C
Database
AppClient
App Client Container
HTTP/HTTPS
J2SE
RMI
J2SE
J N D I
J M S
R M I / I I O P
J D B C
J T A
JavaMail
JAF J N D I
J M S
R M I / I I O P
J D B C
J T A
JavaMail
JAF
HTTP/HTTPS
Applet Container
Applet JSP Servlet EJB
Web Container EJB Container
RMI
J2SE
J2EE Containers & Components
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 43/51
CSE, IITBUmesh Bellur
Components
Handle Concurrency
Security
Availability
Scalability
Persistence
Transaction
Life-cyclemanagement
Management
Presentation
Business Logic
Containers
Handle
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 44/51
CSE, IITBUmesh Bellur
Containers & Components
Containers do their work invisibly
– No complicated APIs
– They control by interposition
Containers implement J2EE
– Look the same to components
– Vendors making the containers have great
freedom to innovate
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 45/51
CSE, IITBUmesh Bellur
J2EE Application
Anatomies
P ibl J2EE A li i
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 46/51
CSE, IITBUmesh Bellur
DB & EIS
Resources
Browser
Stand-alone
Web Server EJB Server
Web Server EJB Server
Possible J2EE Application
Anatomies
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 47/51
CSE, IITBUmesh Bellur
J2EE Application Anatomies
● 4-tier J2EE applications
– HTML client, JSP/Servlets, EJB, JDBC/Connector
● 3-tier J2EE applications
– HTML client, JSP/Servlets, JDBC
● 3-tier J2EE applications
– EJB standalone applications, EJB, JDBC/Connector
● B2B Enterprise applications
– J2EE platform to J2EE platform through theexchange of JMS or XML-based messages
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 48/51
CSE, IITBUmesh Bellur
Which One to Use?
● Depends on several factors Requirements of applications
Availability of EJB tier
Availability of developer resource
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 49/51
Assignment 3
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 50/51
CSE, IITBUmesh Bellur
Assignment 3 – Deadline Feb 5
Client
(Browser)
JSP1 SB1
MDB SB2
JMS Topic
Booking server
Posting &
Display server
Xaction. #
JSP2
8/10/2019 Breif about JAVA & J2EE
http://slidepdf.com/reader/full/breif-about-java-j2ee 51/51
Notes on Assignment JSP 1 – takes in a a stock trade to do as input
(Ticker symbol & quantity) Assume all trades are buys.
Invokes the SB
SB posts trade into a “Transactions” table (ID, Ticker
symbol and trade amount) and the transaction ID(Unique) into the queue.
The MDB gets notified from the queue and invokesthe SB2
SB2 reads the transaction and adjusts the“Positions” table. (Ticker symbol, Current position)
JSP2 is used to read the current positions.
Build a delay into the MDB.