KEMBAR78
J2ee web services(overview) | PPTX
J2EE WEB-SERVICES
BY PRAFULL JAIN
2016BCEX1056
SEC-B , VIITH SEM
LIST OF CONTENTS:-
1. Application servers
2. What is J2EE?
3. Main Technologies
4. Application Scenarios
5. J2EE APIs and Services
6. EJB – a closer look
APPLICATION SERVERS
â€ĸ In the beginning
Centralized, non-distributed
terminals
mainframe
terminals
3
In the 90’s, systems should be
client- server
APPLICATION SERVERS
4
Today, enterprise applications use the multi-tier model
“Multi-tier applications” have several independent components.
An application server provides the infrastructure and services to run such applications
Application server products can be separated into 3 categories:
īŽ J2EE-based solutions
īŽ Non-J2EE solutions (PHP, ColdFusion, Perl, etc.)
īŽ And the Microsoft solution (ASP/COM and now .NET with ASP.NET, VB.NET,
C#,
etc.)
WHAT IS J2EE?
 It is a public specification that embodies several
technologies
 Current version is 1.5
 J2EE defines a model for developing multi-tier, web based,
enterprise applications with distributed components
J2EE BENEFITS
 High availability
 Scalability
 Integration with existing systems
 Freedom to choose vendors of application servers, tools, components
 Multi-platform
J2EE BENEFITS
 Flexibility of scenarios and support to several types of clients
 Programming productivity:
Services allow developer to focus on business.
Component development facilitates maintenance and reuse
Enables deploy-time behaviors Supports division of labor
MAIN TECHNOLOGIES
 JavaServer Pages (JSP)
 Servlet
 Enterprise JavaBeans (EJB)
JSPs, servlets and EJBs are application components.
JSP
 Used for web pages with dynamic content
 Processes HTTP requests (non-blocking call-and-return)
 Accepts HTML tags, special JSP tags, and scriptlets of Java code
 Separates static content from presentation logic
 Can be created by web designer using HTML tools
SERVLET
 Used for web pages with dynamic content
 Processes HTTP requests (non-blocking call- and-return)
 Written in Java; uses print statements to render HTML
 Loaded into memory once and then called many times
 Provides APIs for session management
EJB
 EJBs are distributed components used to implement business logic
(no UI)
 Developer concentrates on business logic
 Availability, scalability, security, interoperability and integrability
handled by the J2EE server
 Client of EJBs can be JSPs, servlets, other EJBs and external
aplications
Copyright 2002 Š Paulo Merson
J2EE MULTI-TIER MODEL
J2EE Application Scenarios
 Multi-tier typicalapplication
J2EE Application Scenarios
 Stand-aloneclient
J2EE Application Scenarios
 Web-centricapplication
J2EE SERVICES AND APIS
 Java Message Service (JMS)
īŽ Implicit invocation
īŽ Communication is loosely coupled, reliable and asynchronous
īŽ Supports 2 models:
 point-to-point
 publish/subscribe
JMS
 Point-to-point
īŽ Destination is “queue”
JMS
 Publish-subscribe
īŽ Destination is “topic”
J2EE SERVICES AND APIS
 JNDI - Naming and directory services
īŽ Applications use JNDI to locate objects, such as environment
entries, EJBs, datasources, message queues
īŽ JNDI is implementation independent
īŽ Underlying implementation varies: LDAP, DNS, DBMS, etc.
 Transaction service:
īŽ Controls transactions automatically
īŽ You can limit the transactions explicitly
īŽ Or you can specify relationships between methods that make up a
single transaction
J2EE SERVICES AND APIS
 Security
īŽ
īŽ
īŽ
īŽ
Java Authentication and Authorization Service (JAAS) is the new (J2EE 1.3)
standard for J2EE security
Authentication via userid/password or digital certificates
Role-based authorization limits access of users to resources (URLs, EJB methods)
Embedded security realm
 J2EE Connector Architecture
īŽ Integration to non-J2EE systems, such as mainframes and ERPs.
īŽ Standard API to access different EIS (GlassFish Server)
īŽ Vendors implement EIS-specific resource adapters
J2EE SERVICES AND APIS
 JDBC
 JavaMail
 Java API for XML Parsing (JAXP)
 Web services APIs
EJB – A CLOSER LOOK
HOME INTERFACE
 Methods to create, remove or locate EJB objects
 The home interface implementation is the home object
(generated)
 The home object is a factory
REMOTE INTERFACE
 Business methods available to clients
 The remote interface implementation is the EJB object
(generated)
 The EJB object acts as a proxy to the EJB instance
Copyright 2002 Š Paulo Merson 34
EJB – THE BIG PICTURE
EJB AT RUNTIME
TYPES OF EJB
StateFul
Statless
SessionBean Entity Bean Message Driven
Bean
BMP
CMP
Enterprise Bean
SESSION BEAN
 Stateful session bean:
īŽ Retains conversational state (data) on behalf of an individual
client
īŽ If state changed during this invocation, the same state will be
available upon the following invocation
īŽ Example: shopping cart
 Stateless session bean:
īŽ Contains no user-specific data
īŽ Business process that provides a generic service
īŽ Container can pool stateless beans
īŽ Example: shopping catalog
ENTITY BEAN
 Represents business data stored in a database  persistent
object
 Underlying data is normally one row of a table
 A primary key uniquely identifies each bean instance
 Allows shared access from multiple clients
 Can live past the duration of client’s session
 Example: shopping order
 Bean-managed persistence (BMP): bean developer writes JDBC code
to access the database; allows better control for the developer
 Container-managed persistence (CMP): container generates all JDBC
code to access the database; developer has less code to write, but also
less control
MESSAGE-DRIVEN BEAN
 Message consumer for a JMS queue or topic
 Benefits from EJB container services that are not available
to standard JMS consumers
 Has no home or remote interface
 Example: order processing – stock info
SOURCES & RESOURCES
 The J2EE Tutorial. Sun Microsystems
 www.java.sun.com/j2ee
 www.theserverside.com
 www.Wikipedia.com/j2ee
 www.javatpoint.com
QUESTIONS
THANK YOU!

J2ee web services(overview)

  • 1.
    J2EE WEB-SERVICES BY PRAFULLJAIN 2016BCEX1056 SEC-B , VIITH SEM
  • 2.
    LIST OF CONTENTS:- 1.Application servers 2. What is J2EE? 3. Main Technologies 4. Application Scenarios 5. J2EE APIs and Services 6. EJB – a closer look
  • 3.
    APPLICATION SERVERS â€ĸ Inthe beginning Centralized, non-distributed terminals mainframe terminals 3 In the 90’s, systems should be client- server
  • 4.
    APPLICATION SERVERS 4 Today, enterpriseapplications use the multi-tier model “Multi-tier applications” have several independent components. An application server provides the infrastructure and services to run such applications Application server products can be separated into 3 categories: īŽ J2EE-based solutions īŽ Non-J2EE solutions (PHP, ColdFusion, Perl, etc.) īŽ And the Microsoft solution (ASP/COM and now .NET with ASP.NET, VB.NET, C#, etc.)
  • 5.
    WHAT IS J2EE? It is a public specification that embodies several technologies  Current version is 1.5  J2EE defines a model for developing multi-tier, web based, enterprise applications with distributed components J2EE BENEFITS  High availability  Scalability  Integration with existing systems  Freedom to choose vendors of application servers, tools, components  Multi-platform
  • 6.
    J2EE BENEFITS  Flexibilityof scenarios and support to several types of clients  Programming productivity: Services allow developer to focus on business. Component development facilitates maintenance and reuse Enables deploy-time behaviors Supports division of labor
  • 7.
    MAIN TECHNOLOGIES  JavaServerPages (JSP)  Servlet  Enterprise JavaBeans (EJB) JSPs, servlets and EJBs are application components. JSP  Used for web pages with dynamic content  Processes HTTP requests (non-blocking call-and-return)  Accepts HTML tags, special JSP tags, and scriptlets of Java code  Separates static content from presentation logic  Can be created by web designer using HTML tools
  • 8.
    SERVLET  Used forweb pages with dynamic content  Processes HTTP requests (non-blocking call- and-return)  Written in Java; uses print statements to render HTML  Loaded into memory once and then called many times  Provides APIs for session management EJB  EJBs are distributed components used to implement business logic (no UI)  Developer concentrates on business logic  Availability, scalability, security, interoperability and integrability handled by the J2EE server  Client of EJBs can be JSPs, servlets, other EJBs and external aplications
  • 9.
    Copyright 2002 ŠPaulo Merson J2EE MULTI-TIER MODEL
  • 10.
    J2EE Application Scenarios Multi-tier typicalapplication
  • 11.
  • 12.
    J2EE Application Scenarios Web-centricapplication
  • 13.
    J2EE SERVICES ANDAPIS  Java Message Service (JMS) īŽ Implicit invocation īŽ Communication is loosely coupled, reliable and asynchronous īŽ Supports 2 models:  point-to-point  publish/subscribe
  • 14.
  • 15.
  • 16.
    J2EE SERVICES ANDAPIS  JNDI - Naming and directory services īŽ Applications use JNDI to locate objects, such as environment entries, EJBs, datasources, message queues īŽ JNDI is implementation independent īŽ Underlying implementation varies: LDAP, DNS, DBMS, etc.  Transaction service: īŽ Controls transactions automatically īŽ You can limit the transactions explicitly īŽ Or you can specify relationships between methods that make up a single transaction
  • 17.
    J2EE SERVICES ANDAPIS  Security īŽ īŽ īŽ īŽ Java Authentication and Authorization Service (JAAS) is the new (J2EE 1.3) standard for J2EE security Authentication via userid/password or digital certificates Role-based authorization limits access of users to resources (URLs, EJB methods) Embedded security realm  J2EE Connector Architecture īŽ Integration to non-J2EE systems, such as mainframes and ERPs. īŽ Standard API to access different EIS (GlassFish Server) īŽ Vendors implement EIS-specific resource adapters
  • 18.
    J2EE SERVICES ANDAPIS  JDBC  JavaMail  Java API for XML Parsing (JAXP)  Web services APIs
  • 19.
    EJB – ACLOSER LOOK
  • 20.
    HOME INTERFACE  Methodsto create, remove or locate EJB objects  The home interface implementation is the home object (generated)  The home object is a factory REMOTE INTERFACE  Business methods available to clients  The remote interface implementation is the EJB object (generated)  The EJB object acts as a proxy to the EJB instance
  • 21.
    Copyright 2002 ŠPaulo Merson 34
  • 22.
    EJB – THEBIG PICTURE
  • 23.
  • 24.
    TYPES OF EJB StateFul Statless SessionBeanEntity Bean Message Driven Bean BMP CMP Enterprise Bean
  • 25.
    SESSION BEAN  Statefulsession bean: īŽ Retains conversational state (data) on behalf of an individual client īŽ If state changed during this invocation, the same state will be available upon the following invocation īŽ Example: shopping cart  Stateless session bean: īŽ Contains no user-specific data īŽ Business process that provides a generic service īŽ Container can pool stateless beans īŽ Example: shopping catalog
  • 26.
    ENTITY BEAN  Representsbusiness data stored in a database  persistent object  Underlying data is normally one row of a table  A primary key uniquely identifies each bean instance  Allows shared access from multiple clients  Can live past the duration of client’s session  Example: shopping order  Bean-managed persistence (BMP): bean developer writes JDBC code to access the database; allows better control for the developer  Container-managed persistence (CMP): container generates all JDBC code to access the database; developer has less code to write, but also less control
  • 27.
    MESSAGE-DRIVEN BEAN  Messageconsumer for a JMS queue or topic  Benefits from EJB container services that are not available to standard JMS consumers  Has no home or remote interface  Example: order processing – stock info
  • 28.
    SOURCES & RESOURCES The J2EE Tutorial. Sun Microsystems  www.java.sun.com/j2ee  www.theserverside.com  www.Wikipedia.com/j2ee  www.javatpoint.com
  • 29.