J2EE modules
Download
Report
Transcript J2EE modules
J2EE Blueprint
Chapter One :Introduction
Chin-Yi Tsai
Outline
Introduction
Web Services
Challenges of Web Services Development
• Security, Reliability, Availability, Scalability
Typical Web Services Scenarios
J2EE:The Platform for Web Services
2
Introduction
J2EE platform has become an integrated standard for
implementing and deploying portable and distributed
enterprise application.
J2EE platform has added support for web servicespecific components and technologies.
• Web service: interoperability
• Add portability to web services
J2EE 1.4 platform is the platform of choice for
developing and deploying portable and interoperable
Web Services (new) and enterprise applications (old).
3
This Book …
About developing robust, effective Web services on
the Java 2 platform, Enterprise Edition (J2EE).
Describe the technologies used for Web Service.
Guidelines for using these technologies to design and
develop web services.
4
Web Service Definition
W3C: A Web service is a software system identified by a URI
whose public interfaces and bindings are defined and described
using XML. Its definition can be discovered by other software
systems. These systems may then interact with the Web service
in a manner prescribed by its definition, using XML-based
messages conveyed by Internet protocols.
A Web service is a software application/component, accessible
on the Web through an URL, that is accessed by clients using
XML-based protocols, such as Simple Object Access Protocol
(SOAP) sent over accepted Internet protocols, such as HTTP.
Clients access a Web service application through its interfaces
and bindings, which are defined using XML artifacts, such as a
Web Service Definition Language (WSDL) file.
5
Web Service
Enable application-to-application communication and
interoperability.
These reusable, self-contained application provide a
standardized way for applications to expose their
functionality over the Web or communicate with
other applications over a network, regardless of the
application’s implementation, programming language,
or computer platform.
Web services promote interoperability across
different platforms, systems, and language.
6
Web Service
A web service is a service-oriented architecture,
which is simply a collection of services that
communicate with each other through well-defined
and well-known interface.
7
Service-Oriented Architecture
UDDi
XML
UDDI
WSDL
SOAP
Service
provider
Service
requestor
Well-defined interface
Registry
Query
Access the service directly
8
Web Service Related Standard
UDDI
• 服務註冊
• 服務查詢
WSDL
• 服務描述
• 介面
SOAP
•如何包裝 & 傳送
XML
9
Benefits of Web Services
Interoperability in heterogeneous environment
• Key benefit
Business services through the web
Integration with existing systems
•
•
•
•
已有大量的資料存在舊有的EIS
replace or …
Standard way to access middle-tier and back-end services
Database management system and transaction monitors
Freedom of choice
• Tools, products, and technologies
Support more client types
Programming productivity
• common programming standard
10
Challenges of Web Service Development
Evolving technologies and products
• Standard and specification
• Interoperability
• Coordination
workflow
Security
• Authentication
• Authorization
• Security at the transport and message level
11
Challenges of Web Service Development
Reliability, availability, and scalability
• Large-scale distributed applications
dose a client have to wait for the web service?
the number of failures that occur in a given time
period
Handler multiple client interactions (increasing)
Efficiently manage system resources and services
Automatic load balancing and failover
12
Typical Web Service Scenarios
Interaction between business partners, supply chain
management, inventory management, and even
simple services.
Issues
• Interoperability requirement
• Integration requirement (EIS)
• Types of client
13
Adventure Builder enterprise –existing enterprise
Web service to integrate with its numerous partners
14
Integrating with business partners
Integrating with existing enterprise information
system
Reaching diverse clients
Aggregation of partner data
15
Demo
http://140.134.26.27:8080
http://140.134.26.27:4848
• Application Server Admin Console
http://140.134.26.27:8080/ab/main.screen
• JAVA ADVENTURE BUILDER DEMO
16
Types of J2EE JAR Files
Web Application Archive (WAR)
EJB JAR
J2EE Application Client JAR
Resource Adapter Archive (RAR)
Enterprise Application Archive (EAR)
17
J2EE application modules components
J2EE application consists of one or more J2EE modules and
one J2EE deployment descriptor, packaged in an Enterprise
Archive (EAR) file, which is a JAR file with the .EAR
extension.
J2EE modules : J2EE modules consist of one or more J2EE
components of the same type and one component deployment
descriptor.
• Web module
• EJB module
• Application client module
18
J2EE 1.4:The Platform for Web Services
The J2EE platform is designed to provide server-side
and client-side for developing Web Services and
distributed, multi-tier enterprise application.
Multi-tier model
Component-based development
• reusability
Container-based component management
19
Portability
Define a set of related specification
•
•
•
•
The Enterprise JavaBean
The Java Servlet spec
JSP spec
Java API for XML-based RPC spec
J2EE Compatibility Test Suite
J2EE reference implementation
J2EE SDK
20
Support for the WS-I standard for interoperability
The J2EE 1.4 platform includes spec and tech that
support SOAP, WSDL, UDDI, and ebXML.
• Simple Object Access Protocol
• Web Service Description Language
• Electronic Business using eXtensible Markup Language
Java API for XML-based RPC (JAX-RPC)
Java API for XML Messaging (JAXM)
SOAP with Attachments API for Java (SAAJ)
Java API for XML Registries (JAXR)
Java API for XML Processing (JAXP)
Java API for XML Binding (JAXB)
21
J2EE Platform Benefits
Simplifies architecture and development
Ensures support for emerging Web service standard
Ensure the development of portable and interoperable services
Allow for integration with existing information system
•
•
•
•
Industry-standard API
J2EE Connector architecture
JDBC
JMS
Is scalable to meet demand variations
• J2EE containers provide transaction support, database connections, life cycle
management, and other services that are both scalable and require no code from
application developers
Provides a flexible security model
• EJB, Servlet API
• Specified at deployment time
22
J2EE Platform
Java Mail API
Java Message Service
Java Naming and Directory Interface (JNDI) API
Java Transaction API
JDBC API
EJB
RMI-IIOP
JSP
Servlet
23
24
J2EE Technologies
Components
Services
Communications
25
Three Kinds of Components
Client component
• Applets
• Standalone java application client
Web component
• Servlet
• JSP
Enterprise JavaBeans是一種以分散式運算為基礎的元
件架構
•部署時做最佳化
•允許被部署在相容的 J2EE 伺服器上
26
Session Beans 主要處理企業邏輯
• 通常面對的是 Client (EJB Client)
• 分為兩大類
Stateful Session Bean
Stateless Session Bean
Entity Beans 主要負責處理資料庫處理
• 通常 Entity Bean 代表資料庫的表格
• 分為兩大類
Bean Managed Persistence
Container Managed Persistence
Message Driven Beans 主要負責處理 MQ Server 所收到的
訊息
• 通常 Message Driven Beans 不會主動被觸發
• 可以處理兩大種類的訊息
Topic
Queue
27
Services
Container
• Application client container
• Web container
• EJB container
Container services
•
•
•
•
Naming service
Deployment service
Transaction service
Security service
28
Communication
These communication tech bring the platform’s component
and services together, making the J2EE platform an integrated,
standard platform for developing portable, interoperable
enterprise application and web service.
Internet protocol
• HTTP, TCP/IP, SSL
Remote Method Invocation protocol
• JRMP
Messaging technologies
• JMS and JavaMail API
Web Service technologies
• SOAP: Java API for XML-based RPC
• UDDI: Java API for XML Registries
29
Book Organization
Chapter 2
• Standard and technologies
Chapter 3
• Service endpoint design
Chapter 4
• Client design
Chapter 5
• XML processing
Chapter 6
• Application and data integration
Chapter 7
• Security
Chapter 8
• Application architecture
30