Upload
hoangcong
View
225
Download
0
Embed Size (px)
Citation preview
Copyright by BrainStream Co., Ltd
Introduction to Java 2 Enterprise EditionIntroduction to Java 2 Enterprise Edition
Adhiwat [email protected]
– Sun Certified Java Programmer
– IBM Certify Enterprise Connectivity with J2EE
– IBM Certify Enterprise Application Development with IBM WebSphere Studio, V5.0
Copyright by BrainStream Co., Ltd /Page2
AgendaAgenda
Enterprise Java Course.
Server-Side Component Architecture.
J2EE Services.
Copyright by BrainStream Co., Ltd /Page3
Enterprise Java CourseEnterprise Java Course
Pichaya Juangpanich (Note)•Session Bean•Messaging
Instructor:Adhitwat Kosakarika(Win)•Entity Bean•Transaction Service
Copyright by BrainStream Co., Ltd /Page4
Enterprise Java CourseEnterprise Java Course
Schedule Week1:
20/10/2004 Win 3 Introduction to J2EE.
Java Distributed Objects.
22/10/2004 Win 3 Introduction to EJB.
Tool Development.
Copyright by BrainStream Co., Ltd /Page5
Enterprise Java CourseEnterprise Java Course
Schedule Week2:
1/11/2004 Win 3 EJB Architecture Concepts.
2/11/2004 Note 3 Session Bean
3/11/2004 Win 3 Entity Beans
Develop CMP
5/11/2004 Win 3 12 Step to Makes CMP
6/11/2004 Note 6 Session Bean Workshop
Copyright by BrainStream Co., Ltd /Page6
Enterprise Java CourseEnterprise Java Course
Schedule Week3:
8/11/2004 Win 3 12 Step to Makes BMP
9/11/2004 Note
10/11/2004 Win 3 Reference to EJB
CMR
12/11/2004 Win 3 EJB QL
Entity Conclusion
Note
3 EJB Client
13/11/2004 6 JMS
Copyright by BrainStream Co., Ltd /Page7
Enterprise Java CourseEnterprise Java CourseSchedule Week4:
15/11/2004 Win 3 Transaction
Exception
16/11/2004 Note
17/11/2004 Win 3 Security
Deployment
19/11/2004 Win 3 Workshop
Conclusions
20/11/2004 Note 6 MDB Workshop
3 Message Driven Bean
Copyright by BrainStream Co., Ltd /Page8
Enterprise Java CourseEnterprise Java Course
Outline:
BP4WS&EAI
Web Services
Enterprise Java Beans(SCEA)
CORBA&RMI Messaging&JNDI Middleware Concept
Design Consideration
Copyright by BrainStream Co., Ltd /Page9
ToolsTools
WebSphere Studio 5.– Editor.
– Test Environment.
WebSphere Server Advance Edition.
Oracle or DB2UDB.
SwiftMQ or MQSeries.
Copyright by BrainStream Co., Ltd /Page10
BackgroundBackground
One-tier, mainframe-type systems.
Two-tiers client/server based systems, separate application tier from resource tier.
Flexible Three-tiers and Multi-tiersapplication models.
Copyright by BrainStream Co., Ltd /Page11
BackgroundBackground
Flat Client vs. Thin Client.
Copyright by BrainStream Co., Ltd /Page12
Multi TiersMulti Tiers
Separated Business Logic from system services and User Interface.
Place Business logic in a Middle Tier.
Copyright by BrainStream Co., Ltd /Page13
Multi TiersMulti Tiers
Various Solutions to implement Multi Tiers.
Copyright by BrainStream Co., Ltd /Page14
Middleware ServicesMiddleware ServicesTransaction Monitors.
Message-Oriented Middleware.
Object Request Brokers.
Web Application Servers.
Copyright by BrainStream Co., Ltd /Page15
Java 2 Platform, Enterprise EditionJava 2 Platform, Enterprise Edition
Java 2 Platform, Enterprise Edition (J2EE) is a robust suite of middleware application services for server-side application development.
Copyright by BrainStream Co., Ltd /Page16
Java 2 Platform, Enterprise EditionJava 2 Platform, Enterprise Edition
J2EE is an extension of Java 2 Platform, Standard Edition (J2SE).
Copyright by BrainStream Co., Ltd /Page17
J2EE ServicesJ2EE Services
Summary:
Copyright by BrainStream Co., Ltd /Page18
ServletsServlets and and JavaServerJavaServer Pages (JSP)Pages (JSP)
Separating data elements (Model: EJB) from data presentation (View: JSP) and from manipulation of data into presentation (Controller: Servlet).
Copyright by BrainStream Co., Ltd /Page19
ServletsServlets and and JavaServerJavaServer Pages (JSP)Pages (JSP)
MVC Application.
Copyright by BrainStream Co., Ltd /Page20
Java Database Connectivity (JDBC)Java Database Connectivity (JDBC)
JDBC 2.0 has built-in support for database connection pooling.
Copyright by BrainStream Co., Ltd /Page21
Java Database Connectivity (JDBC)Java Database Connectivity (JDBC)
Type1: JDBC-ODBC
Type2: Native Client
Type3: Network Protocol
Type4: Native Protocol
Copyright by BrainStream Co., Ltd /Page22
Transaction Services (JTA/JTS) Transaction Services (JTA/JTS)
Java Transaction API (JTA)
Java Transaction Service (JTS)
Copyright by BrainStream Co., Ltd /Page23
J2EE Connector Architecture (JCA)J2EE Connector Architecture (JCA)
Providing a standard Resource Adapter to plug into Application Server.
Copyright by BrainStream Co., Ltd /Page24
J2EE Connector Architecture (JCA)J2EE Connector Architecture (JCA)Application Server provides:– Connection Management.
– Transaction Management.
– Security Management.
Copyright by BrainStream Co., Ltd /Page25
JDBC & JCAJDBC & JCA
JDBC base on JCA.
Copyright by BrainStream Co., Ltd /Page26
Java Naming and Directory InterfaceJava Naming and Directory Interface
Java Naming and Directory Interface (JNDI) is a standard for naming and directory services.
•Object CosNaming
•File System
•LDAP
•Novell File System
Copyright by BrainStream Co., Ltd /Page27
Java Messaging Service Java Messaging Service
Java Messaging Service (JMS) supported Messaging Systems, included Point to Point/Publish Subscribe.
Copyright by BrainStream Co., Ltd /Page28
Java Messaging ServiceJava Messaging Service
Messaging Application:
Copyright by BrainStream Co., Ltd /Page29
Java MailJava Mail
Java Mail API provides a platform-and protocol-independent framework to build Java-based mail and messaging applications.
Defined Mail Session in Middleware.
Copyright by BrainStream Co., Ltd /Page30
Distributed ObjectsDistributed Objects
Objects could be used across networks.
Copyright by BrainStream Co., Ltd /Page31
Distributed ObjectsDistributed Objects
Well-known Technology are:– Object Management Group (OMG) Component
Object Request Broker Architecture (CORBA) – Sun Java Remote Method Invocation (RMI)
Protocol– Microsoft Distributed Component Object Model
(DCOM).
In Java world, only CORBA and RMI they relate EJB.
Copyright by BrainStream Co., Ltd /Page32
CORBA OverviewCORBA Overview
Developed by a consortium of companies, Object Management Group.Provide a common, language- and vendor-neutral standard for Object DistributionStandard Interface enables interoperability between different vendors.Built around a special layer, Object Request Broker (ORB), that communication between clients and objects.
Copyright by BrainStream Co., Ltd /Page33
CORBA OverviewCORBA OverviewCommunicated between ORB by Internet-Inter ORB Protocol (IIOP).
Stub: marshalling of parameters of remote object.
Skeleton: unmarshalling of parameters of remote object.
Copyright by BrainStream Co., Ltd /Page34
CORBA OverviewCORBA Overview
CORBA clients/servers can base on variouslanguages(Java, C++, C, Smalltalk and Ada), Operating System, Networks.Two key building blocks in CORBA model:Interface Definition Language (IDL)– Normalizes differences caused by language or
operating system dependencies.
CORBA services– Provide standard to interact, such as naming
and transaction.
Copyright by BrainStream Co., Ltd /Page35
VisiBrokerVisiBroker JAVA CORBA DevelopmentJAVA CORBA Development
Create IDL.
Idl2java.
Create Client.
Create Object.
Compile.
Start Server.
Run Client.
Copyright by BrainStream Co., Ltd /Page36
VisiBrokerVisiBroker JAVA/C++ CORBAJAVA/C++ CORBA
Copyright by BrainStream Co., Ltd /Page37
Java Interface Definition LanguageJava Interface Definition Language
Is an implementation of CORBA specification.
Enables interoperability and connectivity with heterogeneous objects.
ORB provided with JDK 1.2.
Invoke remote network services using industry standards IDL and IIOP from OMG.
Copyright by BrainStream Co., Ltd /Page38
Remote Method InvocationRemote Method Invocation
Remote Method Invocation (RMI) enables to create Java distributed Application, simpler CORBA solution.
Located Remote Object by using Registry.
Copyright by BrainStream Co., Ltd /Page39
Remote Method InvocationRemote Method Invocation
RMI uses object serialization to marshal and demarshal parameters
Allows RMI programs to pass by value objectsthat server can operate on a local copy.
Another advanced feature of RMI is distributed garbage collection, a feature that is not available in CORBA today.
Copyright by BrainStream Co., Ltd /Page40
Remote Method InvocationRemote Method Invocation
RMI Protocol called JRMP.
Work with only Java Language.
Lack of multiple-language support.
Lack of CORBA services such as naming service, transaction, persistence service and security.
Copyright by BrainStream Co., Ltd /Page41
RMI over IIOPRMI over IIOP
Neither CORBA nor Java RMI were sufficient enough to building enterprise applications.
RMI over IIOP (RMI-IIOP) combines the best features of RMI with those of CORBA.
Synthesis of RMI-IIOP results in a unique combination of power and ease of use, the Enterprise JavaBeans.
Copyright by BrainStream Co., Ltd /Page42
From CORBA to EJBFrom CORBA to EJBCORBA has some drawbacks:– CORBA has a steep learning curve. Many cases
low-level APIs are too complex.– Different CORBA infrastructures were less
portable. – CORBA had no complete server-side component
model and distributed object framework. – CORBA vendors (or developers) had to integrate
CORBA services with a own, non-standard application layer.
Copyright by BrainStream Co., Ltd /Page43
From CORBA to EJBFrom CORBA to EJB
In 1998, SUN Micro system introduction EJB.
In 1999, OMG group has published CORBA Component Model (CCM).
The Most Application server market focus on EJB component solutions.
EJB was designed to be 100% CORBA-compliant.
Copyright by BrainStream Co., Ltd /Page44
From CORBA to EJBFrom CORBA to EJBEJB technology easier to build applications on top of a CORBA infrastructure.
With EJB,low-level APIs has been shifted from the application developer to the application server infrastructure (EJB container).
Business LogicApplication Server
Copyright by BrainStream Co., Ltd /Page45
Enterprise JavaBeansEnterprise JavaBeans
Enterprise JavaBeans (EJB) is an architecture for server-side component based distributed applications written in Java.
Provides separation of business logic with persistency, transactions, and other services
Copyright by BrainStream Co., Ltd /Page46
EJB specificationEJB specification
“The EJB architecture is a component architecture for development and deployment of component-based distributedbusiness applications”– Defines how server-side components are
written.
– Provides a standard architectural contract between components and container/servers.
– Interoperability EJB servers or CORBA.
Copyright by BrainStream Co., Ltd /Page47
Enterprise JavaBeansEnterprise JavaBeans
EJB container is where EJB reside and make EJB available to client.
EJB are deployed into EJB containers and run on Server that provides services.
Copyright by BrainStream Co., Ltd /Page48
Enterprise JavaBeansEnterprise JavaBeans
Located EJB through JNDI.EJB can accessible methods of remote object by RMI. EJB use RMI-IIOP, standard mapping of EJB interfaces to CORBA IDL. EJB offered through JTA/JTS for Distributed Transaction. EJB provide Messaging with JMS.
Copyright by BrainStream Co., Ltd /Page49
J2EE ContainerJ2EE Container
Copyright by BrainStream Co., Ltd /Page50
ConclusionsConclusions
Server-Side Component Architecture.
J2EE Services.
What’s EJB?