张民 (muslov) 清华大学计算机系知识工程组 硕士 清华大学 sun 授权 java...

Click here to load reader

Upload: tyrone

Post on 16-Mar-2016

161 views

Category:

Documents


0 download

DESCRIPTION

J2EE 平台与 EJB 技术. 张民 (muslov) 清华大学计算机系知识工程组 硕士 清华大学 SUN 授权 Java 培训中心 讲师 [email protected]. 内容. 为什么引入 J2EE ? 什么是 J2EE ? J2EE 的组成 EJB—J2EE 的基石 EJB 的容器和服务器 EJB 的分类 会话 bean 实体 bean EJB 的三个关键构件 EJB 的实现与部署 回顾. 主机系统或单层结构. 数据访问、表示和业务逻辑在一个应用中 功能紧紧耦合在一起 - PowerPoint PPT Presentation

TRANSCRIPT

PowerPoint
RMI (Remote Method Invocation)
oy Java!
oy Java!
J
J2EE
Open and standard based platform for developing, deploying and managing n-tier, Web-enabled, server-centric enterprise applications
NWeb
oy Java!
RMI/ IIOP 1.0
EJB™ Server:
•Provides a Container Runtime Environment.
Containers:
provides the environment in which the beans run (Actually combination of classes/interfaces).
•transparently provides services by intercepting all method calls to the EJB™ component.
•provides management and control services:
•Naming services: JNDI ™registration of EJB™ when loaded
•Lifecycle, state mgmt: creates and removes bean instances, Instance pooling, activation and
passivation
•serializing method calls
•bean runtime context information (meta data)
The container simplifies nontrivial aspects of a distributed application such as security, transaction
coordination, and data persistence. The container and service providers implement the EJB™ infrastructure. This
infrastructure deals with distribution aspects, transaction management, and security aspects of an application. The
EJB™ specification defines the Java APIs for the infrastructure.
Developers focus on their area of expertise: the business logic and leave the infrastructure to the platform specialists.
oy Java!
EJBObjectjavax.ejb.EJBObjectproxybean
//return the account information corresponding to this account.
public AccountModel getDetails() throws RemoteException;
// updates the contact information for the specified account
public void changeContactInformation(ContactInformation info)
public Account create(String userId,
String status, ContactInformation info)
throws RemoteException, FinderException;
// entity state
public void changeContactInformation(ContactInformation info) {
throws DuplicateKeyException,CreateException {
try{
}catch (java.sql.SQLException se) {
}
}
bean
APIJTA
3. ——trade-off
oy Java!
Designing Enterprise Applications with the Java 2 Platform, Enterprise EditionNicholas Kassem and the Enterprise Teamjbp-1_0_1b-doc.pdf)
http:// java. sun. com/ j2ee
http:// java. sun. com/ products/ ejb
http:// java. sun. com/ products/ jsp
http:// java. sun. com/ products/ servlet
http:// java. sun. com/ products/ jndi
Server-Side Components –A Pattern Language, Markus Völter, MATHEMA AG, Germany
oy Java!