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.

实 例C++:收 器 。 这 一 选 项 与 4.x 接 收 器 相 似 ; vbroker.orb.dynamicLibs= ,其 中 是 动 态 链 接 库 的 文 件 名 , 扩 展 名 为 “.SO”(UNIX) 或“.DLL”(Windows)。 要 载 入 一 个 以 上 的 DLL 文 件 时 , 用 逗 号 (",") 将 各 文件 名 分 开 , 使 如 ,vbroker.orb.dynamicLibs=a.so,b.so,c.so (UNIX) 或vbroker.orb.dynamicLibs=a.dll,b.dll,c.dll。要 动 态 地 载 入 接 收 器 , 则 需 要 使 用 VISInit。 这 与 在 4.x 接 收 器 中 所 使 用 的 相 似 。有 关 详 情 , 请 参 阅 第 21 章 " 使 用 4.x 接 收 器 "。 在 ORB_init 实 现 内 部 , 每 个 接 收器 装 载 器 的 注 册 是 相 似 的 。void ORB_init(int& argc, char* const* argv, CORBA::ORB_ptr orb){if( _bind_interceptors_installed) return;SampleClientLoader *client = new SampleClientLoader();PortableInterceptor::register_orb_initializer(client);...客 户 端 接 收 器 装 载 器 的 完 整 实 现 如 下 :// SampleClientLoader.javaimport org.omg.PortableInterceptor.*;import org.omg.PortableInterceptor.ORBInitInfoPackage.*;public class SampleClientLoader extends org.omg.CORBA.LocalObjectimplements ORBInitializer{public void pre_init(ORBInitInfo info) {try {System.out.println("=====>SampleClientLoader: Installing ...");info.add_client_request_interceptor(new SampleClientInterceptor());System.out.println("=====>SampleClientLoader: Interceptors loaded.");}catch(DuplicateName dn) {System.out.println("=====>SampleClientLoader: " + dn.name + " alreadyinstalled.");}catch(Exception e) {e.printStackTrace();throw new org.omg.CORBA.INITIALIZE(e.toString());}}public void post_init(ORBInitInfo info) {// 在 这 里 我 们 什 么 也 用 不 着 做 。}}客 户 端 接 收 器 装 载 器 在 C++ 下 的 完 整 实 现 :C++:// SampleClientLoader.C20-16 <strong>VisiBroker</strong> 开 发 者 指 南

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

Saved successfully!

Ooh no, something went wrong!