12.07.2015 Views

VisiBroker Edition

VisiBroker Edition

VisiBroker Edition

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

创 建 与 初 始 化 请 求} catch(const CORBA::Exception& excep) {System.err.println ("Error binding to account" );excep.printStackTrace();}System.out.println ("Bound to account object");. . .创 建 与 初 始 化 请 求注 :当 您 的 客 户 程 序 调 用 一 个 对 象 上 的 方 法 时 , 会 创 建 一 个 Request 对 象 以 表 示 方 法 调用 。 Request 对 象 被 编 写 或 汇 集 入 一 个 缓 冲 器 , 然 后 送 到 对 象 实 现 。 当 您 的 客 户 程序 使 用 客 户 存 根 时 , 这 一 处 理 会 透 明 地 出 现 。 要 使 用 DII 的 客 户 程 序 必 须 自 己 创 建并 发 送 Request 对 象 。没 有 该 类 的 构 建 器 。 Object 的 _request 方 法 或 Object 的 _create_request 方 法 用以 创 建 Request 对 象 。Request 类C++: 以 下 的 代 码 示 例 说 明 Request 类 。 Request 的 target 是 从 用 于 创 建 Request 的 对象 引 用 上 隐 式 设 定 的 。 当 创 建 Request 时 , 必 须 指 定 operation 的 名 称 。C++: class Request {public:CORBA::Object_ptr target() const;const char* operation() const;CORBA::NVList_ptr arguments();CORBA::NamedValue_ptr result();CORBA::Environment_ptr env();void ctx(CORBA::Context_ptr ctx);CORBA::Context_ptr ctx() const;CORBA::Status invoke();CORBA::Status send_oneway();CORBA::Status send_deferred();CORBA::Status get_response();CORBA::Status poll_response();. . .};};Request 接 口Java:以 下 的 代 码 示 例 说 明 Request 接 口 。 Request 的 目 标 是 从 用 于 创 建 Request 的 对 象 引用 上 隐 式 设 定 的 。 当 创 建 Request 时 , 必 须 指 定 操 作 的 名 称 。package org.omg.CORBA;public abstract class Request {public abstract org.omg.CORBA.Object target();public abstract java.lang.String operation();public abstract org.omg.CORBA.NVList arguments();18-6 <strong>VisiBroker</strong> 开 发 者 指 南

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!