Posted by: smallonely | December 2, 2003

[CORBA] POA 介面 – (1) introduction

POA (Portable Object Adapter:可移植物件適配器)是只對伺服器物件可見的物件。
用戶端持有物件引用並用它來調用方法,伺服器物件自身(這個物件有效的實現了感興
趣的方法)只同 POA 對話。ORB、POA 和伺服器 skeleton 協同決定客戶的請求被傳遞
到的函數/代碼。

The POA (Portable Object Adapter) is an object which is visible from
the server object only. While clients hold object references on which
they invoke methods, the server object itself -the object which effectively
implements the interesting methods- talks only to the POA. The ORB, the POA
and the server skeleton all cooperate to decide to which function/code the
client requests must be passed to.

當伺服器被啟動,它首先建立一個 POA,接著它向 POA 告之它的servant(步驟 1)
(servant是我們編寫的 IDL 定義的實現代碼。事實上的介面實現)。接著它向 POA
要求一個物件引用(步驟 2),這個物件引用接著要求用 IOR 字串向外界廣而告之
(步驟 3),要嘛把這個物件引用綁定到命名服務中的一個名字上。

(1) servant to POA
(2) POA to servlent
(3) servant to IOR string / Naming Service

當客戶被啟動,它首先用 CosNaming::NamingContext::Resolve 方法向命名服務詢問
物件引用(步驟 1)。接著它就可以通過物件引用調用這個遠距離物件的方法。有這種可
能的原因是物件引用是持有定位伺服器的足夠的資訊的一個不透明的結構。客戶通過
stub 向 ORB 傳遞這個調用(步驟 2)。一旦 ORB 找到了正確的伺服器(有賴於物件引用),它就把請求發
送給伺服器。

(1) client to Naming Service
(2) client stub to ORB

When the client is launched, it will first ask the Name Service about
some object reference by using the CosNaming::NamingContext::Resolve
method (step 1). Then, it will be able to invoke some distant object&#039s
method through the object reference. This is possible because the object
reference is an opaque structure which holds enough information to locate
the server. This invocation is passed to the ORB by the client
through the stub (step 2). Once the ORB has found the correct server
(thanks to the object reference), it hands the request to the server.

伺服器接著定位生成這個物件引用的 POA (再次依靠物件引用包含的資訊)並把請求傳遞
給 POA(步驟 2)。 接著 POA 把請求最終傳遞給正確的servant(步驟 3)。

(1) ORB to Server
(2) server to POA
(3) POA to servant

客戶不是真的關心由 ORB 關照的這些材料。客戶見到的只是一個物件引用。伺服
器見到的只是 POA:他們都不關心對方。我們已經看到了客戶如何處理物件引用。現
在該是著手伺服器的材料的時候了。


翻遍日記將千言萬語 找一個字代替

夫兵者不祥之器物或惡之故有道者不處君子居則貴左用兵則貴右兵者不祥之器非君子
之器不得已相簿 http://wretch.twbbs.org/album 速度超快 50MB 網路相簿於天下
矣吉事尚左凶事尚右偏將軍居左上將軍居右言以喪禮處之殺人之眾以哀悲泣之戰勝以
喪禮處之道常無名樸雖小天下莫能臣侯王若能守之萬物將自賓天地相合以降甘露民莫
之令而自均始制有名名亦既有夫亦將知止知止可以不殆譬道pcs.csie.nctu.edu.tw海






—–


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: