freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

corba程序設(shè)計(jì)指南-資料下載頁

2025-07-30 00:13本頁面
  

【正文】 pplication parameters”設(shè)置為:ORBdomain_name localhost這樣你就可以運(yùn)行g(shù)ridServer程序了。運(yùn)行g(shù)ridClient時,保證設(shè)置和上述一樣。,從彈出菜單中選擇“Run”,便可運(yùn)行。為了設(shè)置能對所有工程生效,你可以在“Project”“Default project properties…”中對VM環(huán)境進(jìn)行設(shè)置,和上面設(shè)置的一樣。3 使用ORBacus開發(fā)CORBA程序ORBacus是OOC(Object Oriented Company)公司的ORB產(chǎn)品。ORBacus小巧但功能齊全,尤其是性能很高,提供實(shí)時CORBA特性,非常適合于電信領(lǐng)域。另外,ORBacus提供源代碼,這對我們進(jìn)一步揭開CORBA ORB內(nèi)幕、提高程序性能、解決棘手問題都有好處。同時它還是免費(fèi)的,當(dāng)然商業(yè)用途例外。 安裝環(huán)境這里我們使用ORBacus 。ORBacus不需要安裝過程,只需將它拷貝到某個目錄下就行。這里假設(shè)在C:\ORBacus目錄下。ORBacus有一個bin\目錄,存放了一些可執(zhí)行文件,( ORBacus 的IDL編譯器)等。另外還有一個lib\目錄,這里存放了ORBacus的庫文件,以壓縮包的形式存在。ORBacus也不用做任何配置。但為了使用方便,我們可以做以下簡單配置:,1)為 CLASSPATH增加:C:\Orbacus\lib\。 .\。 .\classes。如果你的程序使用了其他功能,需要增加相應(yīng)的類庫。例如使用了命名服務(wù)。2) 為PATH增加:C:\Orbacus\bin實(shí)際上ORBacus\bin\。ORBacus沒有自己的javac、java程序,而是直接使用JDK的相應(yīng)程序。事實(shí)上這對我們更加方便。保證PATH變量設(shè)置了JDK路徑。如果你的ORBacus的目錄不是這樣,作相應(yīng)改變。 在ORBacus下編寫CORBA程序下面我們以O(shè)RBacus附帶的一個例子講解使用ORBacus編寫CORBA程序的過程。這個例子在src\ob\demo\hello目錄下。為了不致改變它,我們把它(連同hello目錄)拷貝到D:\mywork目錄下。我們要用到以下幾個文件:D:\mywork\hello\ idl定義文件D:\mywork\hello\ Servant實(shí)現(xiàn)D:\mywork\hello\ 客戶程序D:\mywork\hello\ 服務(wù)器程序 命令行方式我們先介紹命令行方式下的編程步驟。實(shí)際上不管使用何種ORB平臺,編程步驟都是是類似的。,這里只是簡單介紹。1)IDL 定義:interface Hello{ void say_hello()。}。它只定義了一個接口Interface Hello,并且只有一個方法 void say_hello()。2)編譯IDL為Java Stub和SkeletonORBacus的IDL Complier命令為jidl。打開DOS窗口,轉(zhuǎn)到D:\mywork\hello目錄下,鍵入:jidl package hello 其中參數(shù)—package ,實(shí)際上一般不顯式指定。,所以需要我們自己指定一個package名。編譯后生成以下幾個文件:JAVA Client Stub:D:\mywork\hello\hello\D:\mywork\hello\hello\D:\mywork\hello\hello\ D:\mywork\hello\hello\Java Server Skeleton:D:\mywork\hello\hello\D:\mywork\hello\hello\D:\mywork\hello\hello\。我們現(xiàn)在就可以編譯這些文件。轉(zhuǎn)到D:\mywork\hello目錄下,用mkdir classes建立classes子目錄,鍵入:javac –d classes hello\*.java其中 –d 。3)編寫Servant Implementation從現(xiàn)在開始,用戶才真正編寫程序代碼。和Orbix2000 一樣,它使用了POA。代碼如下:package hello。public class Hello_impl extends HelloPOA{ public void say_hello() { (Hello World!)。 }}4)編寫ServerServer用來創(chuàng)建相應(yīng)的Servant對象,準(zhǔn)備接受來自Client的請求。 代碼如下:package hello。public class Server{ static int run( orb, String[] args) throws { // //1. Resolve Root POA and Get a reference to the POA manager // // rootPOA = ( (RootPOA))。 // manager = ()。 // // 2. Create implementation object and Save reference // Hello_impl helloImpl = new Hello_impl()。 Hello hello = (orb)。 // // try { String ref = (hello)。 String refFile = 。 file = new (refFile)。 out = new (file)。 (ref)。 ()。 ()。 } catch( ex) { (: can39。t write to ` + () + 39。)。 return 1。 } // // 3. Activate POA Manager to allow new requests to arrive // ()。// 4. Give control to ORB and Run implementation ()。 return 0。 } public static void main(String args[]) { // Set properties for ORB environment props = ()。 (, )。 (, )。 int status = 0。 orb = null。 try { // Init ORB for an server application orb = (args, props)。 // Run the server application status = run(orb, args)。 } catch(Exception ex) { ()。 status = 1。 } if(orb != null) { // // Since the standard () method is not present in // JDK , we must cast to so that this // will pile with all JDK versions // try { (()orb).destroy()。 } catch(Exception ex) { ()。 status = 1。 } } (status)。 }}可以看到,和Orbix 2000一樣,在ORBacus下,一個Server程序也需要執(zhí)行以下幾個步驟:1) 初始化ORB,獲得RootPOA引用。2) 創(chuàng)建Servant對象,并保存對象引用;3) 激活POA管理器;4) 通知ORB準(zhǔn)備接受請求。所不同的是,在main()函數(shù)開頭有一段設(shè)置ORB屬性的語句。實(shí)際上Orbix 2000的it_java命令已在命令行中自動設(shè)置了這些屬性,所以不需要在程序中設(shè)定,當(dāng)然像ORBacus一樣在程序中設(shè)定也是可以的。同樣的道理,在ORBacus下。另外,ORBacus不僅能將對象引用存儲為一般的文件,還能存儲為HTML文件。這通常用在Client 是一個Java Applet的情況下。為了簡明起見,我們把這段代碼去掉了。5)編寫Client(去掉了Applet部分):package hello。import .*。import .*。public class Client { static int run( orb, String[] args) throws { // // Get hello object // obj = (relfile:/)。 if(obj == null) { (: cannot read IOR from )。 return 1。 } Hello hello = (obj)。 // // Main loop // (Enter 39。h39。 for hello or 39。x39。 for exit:)。 int c。 try { String input。 do { ( )。 dataIn = new ()。 in = new ( new (dataIn))。 input = ()。 if((h)) ()。 } while(!(x))。 } catch( ex) { (Can39。t read from ` + () + 39。)。 return 1。 } return 0。 } public static void main(String args[]) { int status = 0。 orb = null。 // Set properties for ORB props = ()。 (, )。 (, )。 try { // Init ORB for client application orb = (args, props)。 // Run the applciation status = run(orb, args)。 } catch(Exception ex) { ()。 status = 1。 } if(orb != null) { // // Since the standard () method is not present in // JDK , we must cast to so that this // will pile with all JDK versions // try { (()orb).destroy()。 } catch(Exception ex) { ()。 status = 1。 } } (status)。 }6)編譯和運(yùn)行程序現(xiàn)在可以編譯和運(yùn)行程序了。轉(zhuǎn)到D:\mywork\hello目錄下,鍵入:javac –d classes javac –d classes 編譯好后,進(jìn)入classes目錄,先運(yùn)行Server:java 重開一個DOS窗口,進(jìn)入D:\mywork\hello\classes目錄,運(yùn)行Client:java 使用集成開發(fā)環(huán)境JBuilder4 為JBuilder4配置ORBacus CORBA環(huán)境。這里進(jìn)行簡要說明。1)配置ORBacus CORBA Library需要將ORBacus 提供的CORBA類庫增加到JBuilder4環(huán)境中來。選擇“tools”“Configure Libraries”菜單,增加orbacus類庫。 配置后的orbacus library2)為project 指定缺省的CORBA環(huán)境選擇“Tools”“Enterprise setup”菜單,單擊“New”按鈕添加ORBacus環(huán)境。 配置ORBacus CORBA 環(huán)境其中“Name for this configuration”設(shè)為“ORBacus”, “Path for ORB tools”設(shè)為“C:/orbacus/bin”,“Library for projects”設(shè)為“orbacus”(選擇前面第一步中設(shè)置的orbacus Library),“IDL piler man
點(diǎn)擊復(fù)制文檔內(nèi)容
范文總結(jié)相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1