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.

接 收 器 实 例实 例 代 码在 “ 代 码 列 表 ” 中 , 每 种 接 收 器 API 方 法 的 实 现 只 是 将 信 息 性 信 息 打 印 到 标 准 输出 设 备 。<strong>VisiBroker</strong> <strong>Edition</strong> 的 examples/interceptors 目 录 下 有 四 个 应 用 程 序 实 例 :● active_object_lifecycle● client_server● ior_creationJava:● 加 密客 户 端 服 务 器 接 收 器 实 例要 运 行 实 例 , 请 按 正 常 程 序 编 译 该 文 件 。 然 后 按 如 下 所 示 启 动 服 务 器 和 客 户 端 :Java:prompt>vbj -Dvbroker.orb.dynamicLibs=SampleServerLoader Serverprompt>vbj -Dvbroker.orb.dynamicLibs=SampleClientLoader Client KateJava: 将 实 现 ServiceLoader 接 口 的 两 个 类 指 定 为 <strong>VisiBroker</strong> <strong>Edition</strong> ORB 服 务 。注 : <strong>VisiBroker</strong> <strong>Edition</strong> 3.x 中 使 用 的 ServiceInit 类 变 为 实 现 两 个 接 口 :ServiceLoader 和 ServiceResolverInterceptor。 有 关 具 体 作 法 的 实 例 , 请 参 阅 第21-4 页 "ServerRequestInterceptor" 的 实 例 。接 收 器 实 例 执 行 结 果 如 下 表 所 示 。 客 户 端 和 服 务 器 执 行 结 果 依 次 列 出 。表 21.2接 收 器 实 例 执 行 结 果客 户 端Bind Interceptors loaded============>SampleBindInterceptor bind============>SampleBindInterceptor bind_succeeded============>SampleClientInterceptor id MyClientInterceptorpreinvoke_premarshal=> open============>SampleClientInterceptor id MyClientInterceptorpreinvoke_postmarshal服 务 器============>SampleServerLoader:Interceptorsloaded============>In POA /.Nothing todo.============>In POA bank_agent_poa, 1 ServerRequestinterceptor installedStub[repository_id=IDL:Bank/AccountManager:1.0,key=ServiceId[service=/bank_agent_poa,id={11bytes:[B][a][n][k][M][a][n][a][g][e][r]}]] is ready.============> SampleServerInterceptor idMyServerInterceptor preinvoke => openCreated john'saccount:Stub[repository_id=IDL:Bank/Account:1.0,key=TransientId[poaName=/,id={4bytes:(0)(0)(0)(0)},sec=0,usec=0]]使 用 4.x 接 收 器 21-7

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

Saved successfully!

Ooh no, something went wrong!