




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
2022年-n月-13日
第一章INTRO
1.概念
ii.一類獨(dú)立的系統(tǒng)軟件和服務(wù)程序
iii.Aclassofstandalonesystem-levelsoftwareandservicesprocedures
iv.在操作系統(tǒng)的頂部
v.WorkingonthetopofOS
vi管理計(jì)算機(jī)資源和網(wǎng)絡(luò)
vii.Managingcomputationalresourcesandnetworkcommunications
viii.支持分布式通信
ix.Supportingdistributedapps
Application
Middleware
OperatingIOperating
SystemISystem
HARDWAREIHARDWARE
b)功能
i.在異構(gòu)的網(wǎng)絡(luò)環(huán)境中,涉及到跨連通性和可操作問題中
ii.供應(yīng)統(tǒng)一的合同和接口
iii.Providingstandardizedinterfacesandprotocols
iv.隱蔽實(shí)現(xiàn)細(xì)節(jié)
v.Hidingimplementationdetails
vi.提高程序的可移植性
vii.Increasingtheportabilityofapps
viii.放置于操作系統(tǒng)和數(shù)據(jù)庫管理系統(tǒng)的頂部
ix.為高級(jí)應(yīng)用的開發(fā)和執(zhí)行供應(yīng)環(huán)境
x.Providingenvironmentsfortheexecutionanddevelopmentofhigher-levelapps
xi.幫助軟件工程師敏捷高效地開發(fā)和集成簡單的分布式軟件
xii.Assistingsoftwareengineersinflexiblyandefficientlydevelopingandintegrating
complexdistributedsoftware
c)中間件進(jìn)展的主要因素
i.隱蔽異構(gòu)型Hidingheterogeneity
1.硬件異構(gòu)hardwareheterogeneity
2.操作系統(tǒng)異構(gòu)OSheterogeneity
3.數(shù)據(jù)庫異構(gòu)databaseheterogeneity
ii.支才寺可操彳乍'性supportinginter-operability
1.不同的平臺(tái)differentplatforms
2.不同的網(wǎng)絡(luò)合同differentnetworkprotocols
3.不同的通信機(jī)制differentcommunicationmechanisms
iiL提高軟件的復(fù)用率improvingefficiencyandqualityofsoftwaredevelopment
d)主要類別
i.遠(yuǎn)程過程調(diào)用中間件RPCremoteprocedurecallmiddleware
ii.對(duì)象懇求代理中間件ORBobjectrequestbrokersmiddleware
iii.面對(duì)信息中間件MOMmessage-orientedmiddleware
iv.數(shù)據(jù)庫訪問中間件DAMdatabaseaccessmiddleware
v.事務(wù)處理中間件TPMtransactionprocessingmiddleware
第二章RMI
a)對(duì)象懇求代理ORB
i.供應(yīng)一個(gè)框架,使得遠(yuǎn)程對(duì)象可以在網(wǎng)絡(luò)中以同樣的方式使用在網(wǎng)絡(luò)中的本地對(duì)象
ii.Providingaframeworkwhereremoteobjectcanuselocalobjectsinthe
samewayoverthenetwork
iii.當(dāng)對(duì)象在客戶端和服務(wù)器之間傳遞時(shí),供應(yīng)功能的編組和解組的功能
iv.Providingfunctionalitiesformarshallingandunmarshalingwhenobjectsare
transmittedbetweenclientsandservers.
v.客戶端和服務(wù)器之間的傳輸隱蔽實(shí)現(xiàn)的細(xì)節(jié),這使得開發(fā)人員能夠有效地實(shí)現(xiàn)分布
式應(yīng)用程序,而無需面對(duì)簡單的底層操作系統(tǒng)和網(wǎng)絡(luò)通信
vi.Hidingtheimplementationdetails,whichenabledeveloperstoimplement
distributedappsefficientlywithoutfacingthecomplexunderlyingoperating
systemsandnetworkcommunications
b)JAVARMI的概述
i.用java編寫分布式對(duì)象
ii.Writingdistributedobjectsusingjava
iii.直接用java對(duì)象來為分布式計(jì)算機(jī)建模
iv.Simpleanddirectmodelfordistributedcomputationwithjavaobjects
v.以java為中心,由此帶來了平安性和分布式計(jì)算的可移植性
vi.Centeredaroundjava,thusbringingthepowerofJavaSafetyandportability
todistributedcomputing
vii.行為可以被轉(zhuǎn)移動(dòng)
viii.Behaviorcanberemoved
ix.通過JNI可以鏈接到現(xiàn)有的遺留系統(tǒng)
x.ConnectedexistedlegacysystembyJNI
xi.通過JDBC可以鏈接到關(guān)系數(shù)據(jù)庫
xii.ConnectedrelationaldatabasebyJDBC
c)優(yōu)點(diǎn)
i.面對(duì)對(duì)象。0
1.全部的對(duì)象可以作為參數(shù)和返回值
2.Allobjectscanbeargumentsandreturnvalues
ii.可移動(dòng)性行為mobilebehavior
1.類的實(shí)現(xiàn)可以被移植
2.Theimplementationsofclasscanbemoved
iii.設(shè)計(jì)模式designpatterns
1.傳遞性對(duì)象確保了面對(duì)對(duì)象技術(shù)的全功率
2.Passingobjectsensurethefullpowerof00techs
iv.平安Secure
1.基于JAVA的平安機(jī)制:平安經(jīng)理
2.BasedonJAVAsecuritymechanismssecuritymanager
d)次優(yōu)點(diǎn)
i.非常簡潔開發(fā),使用,維護(hù)
ii.Easytowrite,useandmaintain
iii.可以與現(xiàn)存的遺留系統(tǒng)鏈接canconnectwithexistedlegacysystem
1.RMI/JNI,RMI/JDBC
iv.開發(fā)一次,可以在任何地方運(yùn)行writeonce,canbeuseanywhere
1.100%移植至IJ任何JVM100%portabletoanyJVM
v.分布式垃圾收集distributedgarbagecollection
vi.并行計(jì)算parallelcomputing
1.多線程,并行處理MUTI-threadconcurrentprocessing
e)架構(gòu)architecture
i.存根stub
1.編組參數(shù),發(fā)送調(diào)用
2.Marshalingarguments,sendinginvocation
ii.骨骼skeleton
1.解封參數(shù),調(diào)用服務(wù)器來實(shí)現(xiàn)
2.Unmarshalingarguments,invokingserver*simplementation
f)RMI的分布式應(yīng)用
i.定位遠(yuǎn)程對(duì)象locateremoteobjects
ii.與遠(yuǎn)程對(duì)象通信communicatewithremoteobjects
iii.為被傳遞的對(duì)象加載類定義loaddefinitionofclassesthatarepassedaround
g)遠(yuǎn)程接口,對(duì)象和方法remoteinterface,objectsandmethods
i.通過實(shí)現(xiàn)一個(gè)具有以下特點(diǎn)的遠(yuǎn)程接口來實(shí)現(xiàn)對(duì)象遠(yuǎn)程化Anobjectsbecomes
remotebyimplementingaremoteinterfacewithfollowingcharacteristics
1.一個(gè)遠(yuǎn)程接口擴(kuò)展了接口oneremoteinterfaceextendsaninterface
a)
2.接口的每一^?方法都有事先聲明everymethodsoftheinterfacehasbeen
declared
a)Java.rmi.RemoteExceptioninitsthrowsclause
h)主要步驟mainsteps
i.定義遠(yuǎn)程接口definetheremoteinterface
1.指明可以遠(yuǎn)程調(diào)用的方法specifyingthemethodsthatcanbeinvoked
remotely
ii.實(shí)施遠(yuǎn)程對(duì)象implementingtheremoteobjects
1.可能包括本地接口/方法的實(shí)現(xiàn)mayincludetheimplementationoflocal
interface/method
iii.客戶實(shí)現(xiàn)implementingtheclient
1.在遠(yuǎn)程接口定義后的任何時(shí)間都可以被實(shí)現(xiàn)canbeimplementedanytimewhen
theremoteinterfacehasbeendefined
第三章JMS
a)面對(duì)消息中間件MOM
i.在異構(gòu)平臺(tái)上發(fā)送/接收分布式應(yīng)用軟件/組件之間的消息
ii.Sending/receivingmessagesbetweendistributedapps/componentsover
theheterogeneousplatforms
1.支持異步調(diào)用
2.Supportingasynchronouscalls
iii.創(chuàng)建一個(gè)分布式通信層
iv.Createadistributecommunicationlayer
1.避開應(yīng)用開發(fā)者接觸來自不同系統(tǒng)和網(wǎng)絡(luò)接口的細(xì)節(jié)
2.InsulatingappdevelopersfromthedetailsaboutdifferentOSandnetwork
interfaces
v.在不同平臺(tái)和網(wǎng)絡(luò)上的API通常是MOM供應(yīng)的
vi.TheAPISfromdifferentplatformsandnetworkareprovidedbyMOM
b)比較
i.MOM
1.異步通信
2.Asynchronouscommunication
3.組件松散耦合
4.Loosely-coupledcomponents
ii.RPC/ORB
1.同步通信
2.Synchronouscommunication
3.組件緊密耦合
4.Tightly-coupledcomponents
c)MOM標(biāo)準(zhǔn)
i.歷史上,缺乏MOM的精確標(biāo)準(zhǔn)
ii.Therewasalackofstandardsinthehistory.
iii.高級(jí)消息隊(duì)列合同AMQP
iv.AdvancedMessageQueuingProtocol
v.數(shù)據(jù)分發(fā)服務(wù)DDS
vi.DataDistributionService
vii.可擴(kuò)展消息和存在合同XXMP
viii.extensibleMessagingandPresenceProtocol
ix.Java消息服務(wù)的JAVAEE
x.JavaMessageServicebyJAVAEE
1.由大多數(shù)MOM供應(yīng)商實(shí)施,旨在隱蔽特定的MOMAPI實(shí)現(xiàn)方法
2.ImplementedbymostMOMvendorsandaimstohidetheparticularMOM
APIimplementations
d)JavaMessageService
i.一種JAVAAPI接口,允許應(yīng)用程序創(chuàng)建發(fā)送接收讀取消息
ii.AjavaAPIthatallowsappstocreate,send,receiveandreadmessages
iii.定義一組通用接口和關(guān)聯(lián)用語
iv.Definesasetofcommoninterfaceandassociatedsemantics
v.通過JMS的供應(yīng)者,力爭最大力度的提高JMS應(yīng)用程序的可移植性
vi.TrythebesttoimprovetheportabilityofJMSappsacrossJMSproviders
Vii.使得通信變得松散耦合的,異步的,牢靠的
viii.Enablingcommunicationthatislooselycoupled,asynchronous,andreliable
e)當(dāng)用JMS的時(shí)候
i.供應(yīng)者盼望該組件不依靠與其他組件的接口信息,因此組件可以很簡潔地被替換
ii.Providershopethecomponentsdon'trelyonothercomponents,
message,socomponentscanbeeasilyreplaced
iii.供應(yīng)者盼望該應(yīng)用程序運(yùn)行時(shí)其他組件也同時(shí)運(yùn)行
iv.Providerswantstheappstorunwhetherornotallcomponentsareupand
runningsimultaneously
v.應(yīng)用業(yè)務(wù)模式允許組件將信息發(fā)送到另一個(gè)組件,并連續(xù)操作而不用即時(shí)響應(yīng)
vi.Applicationbusinessmodelallowscomponentssendmessagetoanother
componentsandtocontinuetooperatewithoutreceivinganimmediateresponse
f)信息傳遞方式
i.點(diǎn)對(duì)點(diǎn)傳送消息方式Pointtopointmessagingstyle
1.每個(gè)消息都是針對(duì)特定隊(duì)列的
2.Eachmessageisaddressedtoaspecificqueue
3.隊(duì)列將保留全部發(fā)送的消息,直到他們被消耗或者過期
4.Thequeuewillretainallthemessagesthathavebeensentuntiltheyare
consumedorexpire.
5.每一條消息都只有一個(gè)消費(fèi)者
6.Everymessagehasoneconsumer
ii.發(fā)布/訂閱消息方式Publish/subscribemessagingstyle
1.客戶端可以將信息發(fā)到一個(gè)主題里
2.Theclientcansendamessagetoatopic
3.出版社和訂閱者可以動(dòng)態(tài)的發(fā)布或者訂閱主題
4.Publisherandsubscribercandynamicallypublishorsubscribetothetopic.
5.當(dāng)且僅當(dāng)消息被發(fā)送給訂閱服務(wù)器后,主題才會(huì)保留信息
6.Topicwillretainthemessagesonlywhenmessageshavebeensenttothe
subscribers
7.每一條信息都可以有多個(gè)消費(fèi)者
8.Eachmessagehasmultipleconsumers
9.當(dāng)一個(gè)客戶端創(chuàng)建了一個(gè)主題后,另一個(gè)訂閱了相應(yīng)主題的客戶端才可以消費(fèi)已發(fā)
送的信息,并且消費(fèi)者必需要保持活躍來消費(fèi)信息
10.Afteraclientcreateatopic,anotherclientwhichhassubscribedthetopic
canconsumemessagesthathavebeensent,andtheconsumermustcontinueto
beactiveinorderforittoconsumemessages.
Queue
g)消息消費(fèi)
i.同步Synchronously
1.消費(fèi)者通過調(diào)用消息接收方法來獵取消息的目的地
2.Consumerfetchesthemessagefromthedestinationbycallingthereceive
method
3.假如消息沒有在指定時(shí)間內(nèi)到達(dá),該接收方法會(huì)阻擋消息進(jìn)入
4.Thereceivemethodcanblockuntilamessagearrivesorcantimeoutifa
messagedosenotarrivewithinaspecifiedtimelimit
ii.異步Asynchronously
1.客戶端可以注冊(cè)一個(gè)消息監(jiān)聽器
2.Theclientcanregisteramessagelistenerwithaconsumer
3.當(dāng)消息到達(dá)目的地時(shí),JMS的供應(yīng)者通過調(diào)用監(jiān)聽器的onMessage方法來供應(yīng)信
息
4.Whenmessagearrivestothedestination,theproviderofJMSdeliverthe
messagebycallingthelistener'sonMessagemethod
h)JMS元素
JMS供應(yīng)者:一個(gè)JMS接口的實(shí)現(xiàn)
ii.JMSprovider:animplementationoftheJMSinterface
iii.JMS客戶端:一個(gè)應(yīng)用或者過程,可以生產(chǎn)/接收消息
iv.JMSclient:anapplicationorprocessthatcanproduce/receivemessages
v.JMS供應(yīng)者/出版者:創(chuàng)建/發(fā)送消息的客戶端
vi.JMSprovider/publisher:aclientthatcancreate/sendmessages
vii.JMS消費(fèi)者:接收消息的客戶端
viii.JMSconsumer:aclientthatcanreceivemessages
ix.JMS消息:包含數(shù)據(jù)的對(duì)象,在客戶端之間轉(zhuǎn)移
x.JMSmessage:anobjectincludingdataandtransferredbetweenJMSclients
xi.JMS隊(duì)列:一個(gè)包含著已經(jīng)被發(fā)送出去并且等待被接收的信息(只有一個(gè)消費(fèi)者)中
轉(zhuǎn)區(qū)
xii.JMSqueue:aqueuethatincludemessageswhichhavebeensentand
waitingtoberead
xiii.JMS主題:一個(gè)發(fā)送信息給多個(gè)訂閱服務(wù)器的初版發(fā)行機(jī)構(gòu)
xiv.JMSTopic:adistributionmechanismforpublishingmessagesthatare
deliveredtomultiplesubscribers
i)JMS應(yīng)用程序的基本構(gòu)造塊JMSapplication,sbasicbuildingblocks
i.管理對(duì)象:連接工廠和目的地
ii.Administeredobjects:connectionfactoriesanddestinations
iii.鏈接
iv.Connections
v.會(huì)議
vi.Sessions
vii.消息生產(chǎn)者
viii.Messageprovider
ix.消息消費(fèi)者
x.Messageconsumer
Xi.消息
xii.Message
JMSAPIProgrammingModel
Creates
Message
Producer
CreatesReceives
Rom
DestinationDestination
j)JMS信息類型
JMSMessageTypes
MessageTypeBodyContents
TextMessageAjava.lang.Stringobject(fbrexample,thecontentsofanXML
file).
MapMessageAsetofname-valuepairs,withnamesasStringobjectsandvalues
asprimitivetypesintheJavaprogramminglanguage.Theentries
canbeaccessedsequentiallybyenumeratororrandomlybyname.
Theorderoftheentriesisundefined.
BytesMessageAstreamofuninterpretedbytes.Thismessagetypeisfbrliterally
encodingabodytomatchanexistingmessagefbnnat.
StreamMessageAstreamofprimitivevaluesintheJavaprogramminglanguage,
filledandreadsequentially.
ObjectMessageASerializableobjectintheJavaprogramminglanguage.
第四章JDBC
a)Intro
i.一套為了建立JAVA編程語言和更大范圍數(shù)據(jù)庫之間獨(dú)立性數(shù)據(jù)庫連接的標(biāo)準(zhǔn)JAVA
API接口
b)框架
JDBCArchitecture
?JDBCAPI&JDBCDriverAPI
C)組件
i.DriverManager
ii.Driver
iii.Connection
iv.Statement
v.ResultSet
vi.SQLexception
d)JDBC功能
i.制造一個(gè)數(shù)據(jù)庫連接
ii.產(chǎn)生SQL聲明
iii.在數(shù)據(jù)庫中執(zhí)行SQL語句
iv.查看修改產(chǎn)生的紀(jì)錄
e)生成一個(gè)簡潔的JDBC應(yīng)用
i.導(dǎo)入包
1.導(dǎo)入數(shù)據(jù)庫連接編程需要的JDBC類的包
2.Importjava.Sql
ii.注冊(cè)JDBCdriver
1.初始化一個(gè)driver,來建立一個(gè)與數(shù)據(jù)庫聯(lián)系的通信通道
2.Class.forName("com.mysqljdbc,driver");
iii.打開鏈接
1.制造一個(gè)鏈接對(duì)象,代表著與數(shù)據(jù)庫的物理連接
2.Staticfinalstringuser="username";
3.Staticfinalstringpass="password";
4.Conn=DriverManager.getConnection(DB_URL.user,pass);
iv.執(zhí)行語句
1.為了建筑并提交SQL說明給數(shù)據(jù)庫,使用聲明或者預(yù)備聲明
2.Stmt=conn.createStatement();
3.Stringsql;
4.Sql="SELECTid,name,hometownFROMt_student";
5.ResultsSetrs=stmt.executeQuery(sql);
6.對(duì)更新,插入,刪除進(jìn)行聲明
7.Stmt=conn.createStatementQ;
8.Stringsql;
9.Sql="DELETEFROMt.studentwhereid=l";
10.Intnum=stmt.executeUpdate(sql);
v.從結(jié)果中提取數(shù)據(jù)
1.用resultSet.getXXXQ從結(jié)果中提取數(shù)據(jù)
while(rs.next()){
//Retrievebycolumnname
intid=rs.getlnt("id");
Stringname=rs.getString(/znameH);
Stringhometown=rs.getString(//hometown");
<)7
vi.清空環(huán)境
rs.close();
stmt.close();
conn.close();
\__________________________________)
f)數(shù)據(jù)類型
SQLJDBC/JavasetXXXupdateXXX
VARCHARjava.Iang.StringsetStringupdateString
CHARjava.Iang.StringsetstringupdateString
NUMERICjava.math.BigDecimalsetBigDecimalupdateBigDecimal
INTEGERintsetlntupdatelnt
FLOATfloatsetFloatupdateFloat
DOUBLEdoublesetDoubleupdateDouble
DATEjava.sql.DatesetDateupdateDate
TIMEjava.sql.TimesetTimeupdateTime
TIMESTAMPjava.sql.TimestampsetTimestampupdateTimestamp
g)執(zhí)行SQL語句
i.發(fā)送查詢語句給數(shù)據(jù)庫
ii.發(fā)送更新語句給數(shù)據(jù)庫
TheCallableStatementObject
CallableStatementcstmt=null;
try(
StringSQL="{callprocedureName(?,?)}'*;
cstmt=conn.prepareCall(SQL);
}
catch(SQLExceptione){
}
finally{
TheCallableStatementObject(cont.)
ParameterDescription
AparameterwhosevalueisunknownwhentheSQLstatementiscreated.
IN
YoubindvaluestoINparameterswiththesetXXX()methods.
AparameterwhosevalueissuppliedbytheSQLstatementitreturns.You
OUT
retrievevaluesfromtheOUTparameterswiththegetXXXf)methods.
Aparameterthatprovidesbothinputandoutputvalues.Youbindvariables
INOUT
withthesetXXXf)methodsandretrievevalueswiththegetXXXf)methods.
intstudentlD=102;
stmt.setlnt(l,studentID);
stmt.registerOutParameter(2,java.sql.Types.VARCHAR);
\________________________________________)
第五
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 電工聘請(qǐng)合同范本
- 供熱ppp項(xiàng)目合同范本
- 分期出租手機(jī)合同范本
- 共享單車租賃合同范本
- 個(gè)體雇傭司機(jī)合同范本
- 公司買車抵押合同范本
- 沖壓模具采購合同范本
- 內(nèi)墻涂料維修合同范本
- 醫(yī)療材料采購合同范本
- 保險(xiǎn)服務(wù)合同范本
- 供應(yīng)鏈資源開發(fā)年終總結(jié)
- 作業(yè)區(qū)鐵路專用線工程項(xiàng)目可行性研究報(bào)告
- 金礦探礦權(quán)合作協(xié)議書范文范本
- 七年級(jí)下學(xué)期生物蘇教版電子教材
- 小學(xué)五年級(jí)美術(shù)《青花瓷》
- 藝術(shù)學(xué)概論第一章-彭吉象
- 浙江水利專業(yè)高級(jí)工程師任職資格考試題及答案
- 2024年新課標(biāo)《義務(wù)教育數(shù)學(xué)課程標(biāo)準(zhǔn)》測(cè)試題(附含答案)
- 醇基燃料突發(fā)事故應(yīng)急預(yù)案
- 肺病科中醫(yī)特色護(hù)理
- 情侶自愿轉(zhuǎn)賬贈(zèng)與協(xié)議書范本
評(píng)論
0/150
提交評(píng)論