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.

定 位 服 务 组 件什 么 是 触 发 器 ?触 发 器 实 际 上 是 一 种 回 调 机 制 , 它 允 许 您 确 定 一 个 指 定 的 实 例 的 可 用 性 的 变 化 。 这是 检 测 Agent 的 异 步 替 代 方 案 。 通 常 , 在 对 一 个 对 象 的 连 接 丢 失 之 后 , 使 用 触 发 器对 其 进 行 恢 复 。 虽 然 有 多 种 方 法 可 以 进 行 查 询 , 但 触 发 器 是 专 用 的 。查 看 触 发 器 方 法下 表 描 述 的 是 Agent 类 中 的 触 发 器 方 法 :表 13.5C++ 下 的 触 发 器 方 法方 法void reg_trigger(const TriggerDesc&_desc,TriggerHandler_ptr _handler)void unreg_trigger(const TriggerDesc&_desc,TriggerHandler_ptr _handler)说 明使 用 该 方 法 注 册 一 个 触 发 器 处 理 器 。使 用 该 方 法 反 注 册 触 发 器 处 理 器 。表 13.6Java 下 的 触 发 器 方 法方 法void reg_trigger(com.inprise.vbroker.ObjLocation.TriggerDescdesc,com.inprise.vbroker.ObjLocation.TriggerHandler handler)void unreg_trigger(com.inprise.vbroker.ObjLocation.TriggerDescdesc,com.inprise.vbroker.ObjLocation.TriggerHanler handler)说 明使 用 该 方 法 注 册 触 发 器 处 理 器 。使 用 该 方 法 反 注 册 触 发 器 处 理 器 。两 种 Agent 触 发 器 方 法 都 可 能 掷 出 Fail 违 例 , 该 违 例 提 供 失 败 的 原 因 。TriggerHandler 接 口 包 含 下 表 中 所 描 述 的 方 法 :表 13.7C++ 下 的 TriggerHandler 接 口 方 法方 法void impl_is_ready(const Desc& _desc)void impl_is_down(const Desc& _desc)说 明当 一 个 与 desc 匹 配 的 实 例 变 为 可 访 问 时 , 定位 服 务 调 用 该 方 法 。当 一 个 实 例 变 为 不 可 用 时 , 定 位 服 务 调 用 该 方法 。表 13.8Java 下 的 TriggerHandler 接 口 方 法方 法voidimpl_is_ready(com.inprise.vbroker.ObjLocation.TriggerDescdesc)voidimpl_is_down(com.inprise.vbroker.ObjLocation.TriggerDescdesc)说 明当 一 个 与 desc 匹 配 的 实 例 变 为 可 访 问 时 , 定位 服 务 调 用 该 方 法 。当 一 个 实 例 变 为 不 可 用 时 , 定 位 服 务 调 用 该 方法 。使 用 定 位 服 务 13-5

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

Saved successfully!

Ooh no, something went wrong!