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++: void send_reply(PortableInterceptor::ServerRequestInfo_ptr ri) {...● send_exception: 提 供 接 收 器 点 , 它 允 许 接 收 器 在 违 例 被 提 交 给 客 户 之 前 , 查 询违 例 信 息 。Java: public void send_exception(ServerRequestInfo ri) throws ForwardRequest {...C++: void send_exception(PortableInterceptor::ServerRequestInfo_ptr ri) {...● send_other: 提 供 一 个 拦 截 点 , 它 允 许 接 收 器 在 请 求 引 发 非 常 规 回 答 或 违 例 时 ,查 询 可 用 的 信 息 。 例 如 , 一 个 请 求 可 能 会 引 发 了 一 个 重 试 ( 例 如 , 收 到 一 个 具有 LOCATION_FORWARD 状 态 的 GIOP 回 答 ); 或 者 在 异 步 调 用 中 , 回 答 没 有 立 即跟 随 请 求 , 但 是 控 制 返 回 给 客 户 , 一 个 终 止 接 收 器 点 将 要 被 调 用 。Java: public void send_other(ServerRequestInfo ri) throws ForwardRequest {...C++: void send_other(PortableInterceptor::ServerRequestInfo_ptr ri) {...Java:所 有 拦 截 点 都 允 许 客 户 和 服 务 器 在 调 用 的 不 同 点 上 取 得 不 同 种 类 的 信 息 。 在 本 实 例中 , 这 些 信 息 被 显 示 在 屏 幕 上 , 作 为 一 种 调 试 方 式 。服 务 器 端 请 求 接 收 器 的 完 整 实 现 如 下 。// SampleServerInterceptor.javaimport org.omg.PortableInterceptor.*;import org.omg.Dynamic.*;import java.io.PrintStream;public class SampleServerInterceptor extends org.omg.CORBA.LocalObjectimplements ServerRequestInterceptor {private String _name = null;public SampleServerInterceptor() {this("SampleServerInterceptor");}public SampleServerInterceptor(String name) {_name = name;}/*** InterceptorOperations 实 现*/public String name() {return _name;}public void destroy() {System.out.println("=====>SampleServerLoader: Interceptors unloaded");20-28 <strong>VisiBroker</strong> 开 发 者 指 南

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

Saved successfully!

Ooh no, something went wrong!