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.

实 例● receive_reply : 提 供 一 个 拦 截 点 , 它 允 许 接 收 器 在 回 答 从 服 务 器 返 回 之 后 而 在控 制 被 返 回 客 户 之 前 , 查 询 关 于 回 答 的 信 息 。Java: public void receive_reply(ClientRequestInfo ri) {...C++: void receive_reply(PortableInterceptor::ClientRequestInfo_ptr ri) {...接 口 void receive_exception(ClientRequestInfo ri) 的 实 现 :● receive_exception : 提 供 一 个 拦 截 点 , 它 允 许 接 收 器 在 违 例 被 提 交 给 客 户 之前 , 查 询 违 例 的 信 息 。Java: public void receive_exception(ClientRequestInfo ri) throws ForwardRequest {...C++: void receive_exception(PortableInterceptor::ClientRequestInfo_ptr ri) {...● receive_other: 提 供 一 个 拦 截 点 , 它 允 许 接 收 器 在 请 求 引 发 非 正 常 回 答 或 违 例时 , 查 询 可 用 的 信 息 。 例 如 , 一 个 请 求 可 能 会 引 发 一 个 重 试 ( 例 如 , 收 到 一 个具 有 LOCATION_FORWARD 状 态 的 GIOP 回 答 ); 或 者 在 异 步 调 用 中 , 回 答 没 有 立即 跟 随 请 求 , 但 是 控 制 返 回 给 了 客 户 , 一 个 终 止 接 收 器 点 将 被 调 用 。Java: public void receive_other(ClientRequestInfo ri) throws ForwardRequest {...C++: void receive_other(PortableInterceptor::ClientRequestInfo_ptr ri) {...Java:客 户 端 请 求 接 收 器 装 载 器 的 完 整 实 现 如 下 :// SampleClientInterceptor.javaimport org.omg.PortableInterceptor.*;import org.omg.Dynamic.*;public class SampleClientInterceptor extends org.omg.CORBA.LocalObjectimplements ClientRequestInterceptor {public SampleClientInterceptor() {this("SampleClientInterceptor");}public SampleClientInterceptor(String name) {_name = name;}private String _name = null;/*** InterceptorOperations 实 现*/public String name() {return _name;20-22 <strong>VisiBroker</strong> 开 发 者 指 南

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

Saved successfully!

Ooh no, something went wrong!