中间件复习笔记_第1页
中间件复习笔记_第2页
中间件复习笔记_第3页
中间件复习笔记_第4页
中间件复习笔记_第5页
已阅读5页,还剩10页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、2015年-11月-13日第一章 INTRO1. 概念ii. 一类独立的系统软件和服务程序iii. A class of standalone system-level software and services proceduresiv. 在操作系统的顶部v. Working on the top of OSvi. 管理计算机资源和网络vii. Managing computational resources and network communicationsviii. 支持分布式通信ix. Supporting distributed appsb) 功能i. 在异构的网络环境中,涉及到跨

2、连通性和可操作问题中ii. 提供统一的协议和接口iii. Providing standardized interfaces and protocolsiv. 隐藏实现细节v. Hiding implementation detailsvi. 提高程序的可移植性vii. Increasing the portability of appsviii. 放置于操作系统和数据库管理系统的顶部ix. 为高级应用的开发和执行提供环境x. Providing environments for the execution and development of higher-level appsxi. 协助软

3、件工程师灵活高效地开发和集成复杂的分布式软件xii. Assisting software engineers in flexibly and efficiently developing and integrating complex distributed softwarec) 中间件发展的主要因素i. 隐藏异构型Hiding heterogeneity1. 硬件异构hardware heterogeneity2. 操作系统异构 OS heterogeneity3. 数据库异构 database heterogeneityii. 支持可操作性supporting inter-operabi

4、lity1. 不同的平台 different platforms2. 不同的网络协议 different network protocols3. 不同的通信机制 different communication mechanismsiii. 提高软件的复用率 improving efficiency and quality of software developmentd) 主要类别i. 远程过程调用中间件RPC remote procedure call middlewareii. 对象请求代理中间件ORB object request brokers middlewareiii. 面向信息中

5、间件 MOM message-oriented middlewareiv. 数据库访问中间件 DAM database access middlewarev. 事务处理中间件TPM transaction processing middleware第二章 RMIa) 对象请求代理ORBi. 提供一个框架,使得远程对象可以在网络中以同样的方式使用在网络中的本地对象ii. Providing a framework where remote object can use local objects in the same way over the networkiii. 当对象在客户端和服务器之间

6、传递时,提供功能的编组和解组的功能iv. Providing functionalities for marshalling and unmarshaling when objects are transmitted between clients and servers.v. 客户端和服务器之间的传输隐藏实现的细节,这使得开发人员能够有效地实现分布式应用程序,而无需面对复杂的底层操作系统和网络通信vi. Hiding the implementation details, which enable developers to implement distributed apps effici

7、ently without facing the complex underlying operating systems and network communicationsb) JAVA RMI 的概述i. 用java编写分布式对象ii. Writing distributed objects using javaiii. 直接用java对象来为分布式计算机建模iv. Simple and direct model for distributed computation with java objectsv. 以java为中心,由此带来了安全性和分布式计算的可移植性vi. Centered

8、 around java, thus bringing the power of Java Safety and portability to distributed computingvii. 行为可以被转移动viii. Behavior can be removedix. 通过JNI可以链接到现有的遗留系统x. Connected existed legacy system by JNIxi. 通过JDBC可以链接到关系数据库xii. Connected relational database by JDBCc) 优点i. 面向对象OO1. 全部的对象可以作为参数和返回值2. All ob

9、jects can be arguments and return valuesii. 可移动性行为mobile behavior1. 类的实现可以被移植2. The implementations of class can be movediii. 设计模式design patterns1. 传递性对象确保了面向对象技术的全功率2. Passing objects ensure the full power of OO techsiv. 安全Secure1. 基于JAVA的安全机制:安全经理2. Based on JAVA security mechanisms security manag

10、erd) 次优点i. 十分容易开发,使用,维护ii. Easy to write, use and maintainiii. 可以与现存的遗留系统链接can connect with existed legacy system1. RMI/JNI, RMI/JDBCiv. 开发一次,可以在任何地方运行 write once, can be use anywhere1. 100%移植到任何JVM 100%portable to any JVMv. 分布式垃圾收集 distributed garbage collectionvi. 并行计算parallel computing1. 多线程,并行处理

11、 MUTI-thread ,concurrent processinge) 架构architecturei. 存根stub1. 编组参数,发送调用2. Marshaling arguments, sending invocationii. 骨骼skeleton1. 解封参数,调用服务器来实现2. Unmarshaling arguments, invoking servers implementationf) RMI的分布式应用i. 定位远程对象locate remote objectsii. 与远程对象通信 communicate with remote objectsiii. 为被传递的对

12、象加载类定义 load definition of classes that are passed aroundg) 远程接口,对象和方法 remote interface, objects and methods i. 通过实现一个具有以下特点的远程接口来实现对象远程化An objects becomes remote by implementing a remote interface with following characteristics1. 一个远程接口扩展了接口one remote interface extends an interfacea) Java.rmi.remote

13、2. 接口的每一个方法都有事先声明 every methods of the interface has been declareda) Java.rmi.RemoteException in its throws clauseh) 主要步骤main stepsi. 定义远程接口define the remote interface1. 指明可以远程调用的方法 specifying the methods that can be invoked remotely ii. 实施远程对象implementing the remote objects1. 可能包括本地接口/方法的实现 may inc

14、lude the implementation of local interface/methodiii. 客户实现 implementing the client1. 在远程接口定义后的任何时间都可以被实现can be implemented anytime when the remote interface has been defined第三章 JMSa) 面向消息中间件MOMi. 在异构平台上发送/接收分布式应用软件/组件之间的消息ii. Sending/receiving messages between distributed apps/components over the he

15、terogeneous platforms1. 支持异步调用2. Supporting asynchronous callsiii. 创建一个分布式通信层iv. Create a distribute communication layer1. 避免应用开发者接触来自不同系统和网络接口的细节2. Insulating app developers from the details about different OS and network interfacesv. 在不同平台和网络上的API通常是MOM提供的vi. The APIS from different platforms and

16、network are provided by MOMb) 比较i. MOM1. 异步通信2. Asynchronous communication3. 组件松散耦合4. Loosely-coupled componentsii. RPC/ORB1. 同步通信2. Synchronous communication3. 组件紧密耦合4. Tightly-coupled componentsc) MOM 标准i. 历史上,缺乏MOM的准确标准ii. There was a lack of standards in the history.iii. 高级消息队列协议AMQPiv. Advanced

17、 Message Queuing Protocolv. 数据分发服务DDSvi. Data Distribution Servicevii. 可扩展消息和存在协议XXMPviii. extensible Messaging and Presence Protocolix. Java消息服务的JAVA EEx. Java Message Service by JAVAEE1. 由大多数MOM供应商实施,旨在隐藏特定的MOM API实现方法2. Implemented by most MOM vendors and aims to hide the particular MOM API imple

18、mentationsd) Java Message Servicei. 一种JAVA API接口,允许应用程序创建发送接收读取消息ii. A java API that allows apps to create, send, receive and read messagesiii. 定义一组通用接口和关联用语iv. Defines a set of common interface and associated semanticsv. 通过JMS的提供者,力争最大力度的提高JMS应用程序的可移植性vi. Try the best to improve the portability of

19、JMS apps across JMS providers vii. 使得通信变得松散耦合的,异步的,可靠的viii. Enabling communication that is loosely coupled, asynchronous, and reliablee) 当用JMS的时候i. 提供者希望该组件不依赖与其他组件的接口信息,因此组件可以很容易地被替换ii. Providers hope the components dont rely on other components message, so components can be easily replacediii. 提供者

20、希望该应用程序运行时其他组件也同时运行iv. Providers wants the apps to run whether or not all components are up and running simultaneouslyv. 应用业务模式允许组件将信息发送到另一个组件,并继续操作而不用即时响应vi. Application business model allows components send message to another components and to continue to operate without receiving an immediate res

21、ponsef) 信息传递方式i. 点对点传送消息方式Point to point messaging style1. 每个消息都是针对特定队列的2. Each message is addressed to a specific queue3. 队列将保留所有发送的消息,直到他们被消耗或者过期4. The queue will retain all the messages that have been sent until they are consumed or expire.5. 每一条消息都只有一个消费者6. Every message has one consumerii. 发布/订

22、阅消息方式Publish/subscribe messaging style1. 客户端可以将信息发到一个主题里2. The client can send a message to a topic3. 出版社和订阅者可以动态的发布或者订阅主题4. Publisher and subscriber can dynamically publish or subscribe to the topic.5. 当且仅当消息被发送给订阅服务器后,主题才会保留信息6. Topic will retain the messages only when messages have been sent to t

23、he subscribers7. 每一条信息都可以有多个消费者8. Each message has multiple consumers9. 当一个客户端创建了一个主题后,另一个订阅了相应主题的客户端才可以消费已发送的信息,并且消费者必须要保持活跃来消费信息10. After a client create a topic, another client which has subscribed the topic can consume messages that have been sent, and the consumer must continue to be active in

24、order for it to consume messages. g) 消息消费i. 同步Synchronously1. 消费者通过调用消息接收方法来获取消息的目的地2. Consumer fetches the message from the destination by calling the receive method3. 如果消息没有在指定时间内到达,该接收方法会阻止消息进入4. The receive method can block until a message arrives or can time out if a message dose not arrive wit

25、hin a specified time limitii. 异步Asynchronously1. 客户端可以注册一个消息监听器2. The client can register a message listener with a consumer3. 当消息到达目的地时,JMS的提供者通过调用监听器的onMessage方法来提供信息4. When message arrives to the destination, the provider of JMS deliver the message by calling the listeners onMessage methodh) JMS元

26、素i. JMS提供者:一个JMS接口的实现ii. JMS provider: an implementation of the JMS interfaceiii. JMS客户端:一个应用或者过程,可以生产/接收消息iv. JMS client: an application or process that can produce/receive messagesv. JMS提供者/出版者:创建/发送消息的客户端vi. JMS provider/publisher: a client that can create/send messages vii. JMS消费者:接收消息的客户端viii.

27、JMS consumer : a client that can receive messagesix. JMS消息:包含数据的对象,在客户端之间转移x. JMS message : an object including data and transferred between JMS clientsxi. JMS队列:一个包含着已经被发送出去并且等待被接收的信息(只有一个消费者)中转区xii. JMS queue: a queue that include messages which have been sent and waiting to be readxiii. JMS主题:一个发

28、送信息给多个订阅服务器的初版发行机构xiv. JMS Topic: a distribution mechanism for publishing messages that are delivered to multiple subscribersi) JMS应用程序的基本构造块JMS applications basic building blocksi. 管理对象:连接工厂和目的地ii. Administered objects: connection factories and destinationsiii. 链接iv. Connectionsv. 会议vi. Sessionsvii

29、. 消息生产者viii. Message providerix. 消息消费者x. Message consumerxi. 消息xii. Messagej) JMS信息类型第四章 JDBCa) Introi. 一套为了建立JAVA编程语言和更大范围数据库之间独立性数据库连接的标准JAVA API 接口b) 框架c) 组件i. DriverManagerii. Driveriii. Connectioniv. Statementv. ResultSetvi. SQLexceptiond) JDBC功能i. 创造一个数据库连接ii. 产生SQL声明iii. 在数据库中执行SQL语句iv. 查看修改产

30、生的记录e) 生成一个简单的JDBC应用i. 导入包1. 导入数据库连接编程需要的JDBC类的包2. Import java. Sql .*;ii. 注册JDBC driver1. 初始化一个driver,来建立一个与数据库联系的通信通道2. Class.forName(“com.mysql,jdbc,driver”);iii. 打开链接1. 创造一个链接对象,代表着与数据库的物理连接2. Static final string user = ”username”;3. Static final string pass = ”password”;4. Conn=DriverManager.ge

31、tConnection(DB_URL.user,pass);iv. 执行语句1. 为了建造并提交SQL说明给数据库,使用声明或者准备声明2. Stmt =conn.createStatement();3. String sql;4. Sql = “SELECT id, name, hometown FROM t_student”;5. ResultsSet rs = stmt.executeQuery(sql);6. 对更新,插入,删除进行声明7. Stmt = conn.createStatement();8. String sql;9. Sql = “DELETE FROM t_stude

32、nt where id=1”;10. Int num = stmt.executeUpdate(sql);v. 从结果中提取数据1. 用resultSet.getXXX() 从结果中提取数据vi. 清空环境f) 数据类型g) 执行SQL语句i. 发送查询语句给数据库ii. 发送更新语句给数据库第五章 JTAa) 数据库事务i. 原子性1. 每一笔交易都是全部或者无ii. 一致性1. 使得数据库从一个状态到另一个状态iii. 隔离性iv. 耐久性1. 一旦交易已经被提交了,那么它将继续保持状态,即时断电,系统崩溃或者发生错误b) 2PC两段提交协议i. 一种分布式算法,该算法能协调所有参与分布式原子事务的过程,如是否提交/终止/滚回事务操

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论