12.07.2015 Views

VisiBroker Edition

VisiBroker Edition

VisiBroker Edition

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

可 移 植 接 收 器 和 信 息 接 口};CORBA::Short _state) = 0;可 移 植 接 收 器 CurrentPortableInterceptor::Current 对 象 ( 以 下 简 称 PICurrent) 是 一 个 存 储 槽 表 , 可移 植 接 收 器 可 以 用 于 将 线 程 上 下 文 信 息 传 递 给 请 求 上 下 文 。 对 PICurrent 的 使 用 不是 必 需 的 。 但 是 , 如 果 拦 截 点 上 需 要 客 户 的 线 程 上 下 文 信 息 , 则 可 以 用 PICurrent来 传 递 该 信 息 。PICurrent 是 通 过 调 用 以 下 方 法 取 得 的 :ORB.resolve_initial_references("PICurrent");ORB->resolve_initial_references("PICurrent");Java:C++:package org.omg.PortableInterceptor;public interface Currentextends org.omg.CORBA.CurrentOperations, org.omg.CORBA.portable.IDLEntity{public org.omg.CORBA.Any get_slot(int id) throws InvalidSlot;}public void set_slot(int id, org.omg.CORBA.Any data) throws InvalidSlot;PortableInterceptor::Current 类class _VISEXPORT Current: public virtual CORBA::Current, public virtualCORBA_Object{};public:virtual CORBA::Any* get_slot(CORBA::ULong _id);virtual void set_slot(CORBA::ULong _id, const CORBA::Any& _data);CodecJAVA:Codec 提 供 了 一 个 让 接 收 器 可 以 将 组 件 在 其 IDL 数 据 类 型 和 其 CDR 封 装 表 示 之 间转 换 的 机 制 。Codec 是 从 CodecFactory 取 得 的 ( 参 阅 第 20-8 页"CodecFactory")。package org.omg.IOP;public interface Codecextends org.omg.CORBA.portable.IDLEntity, org.omg.CORBA.LocalInterface{public byte[] encode(org.omg.CORBA.Any data) throws InvalidTypeForEncoding;public org.omg.CORBA.Any decode(byte[] data) throws FormatMismatch;public byte[] encode_value(org.omg.CORBA.Any data) throwsInvalidTypeForEncoding;public org.omg.CORBA.Any decode_value(byte[] data, org.omg.CORBA.TypeCodetc)使 用 可 移 植 接 收 器 20-7

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

Saved successfully!

Ooh no, something went wrong!