| 
JavaTM 2 Platform Standard Ed. 5.0  | 
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
public interface ServerRequestInfoOperations
服务器端请求 interceptor 可访问的请求信息。
某些 ServerRequestInfo 上的属性和操作并不是对所有的截取点都有效。下表展示了每个属性或操作的有效性。如果无效,则试图访问它将导致抛出 BAD_INV_ORDER,并带有标准次要代码 14。
 
| receive_request_ service_contexts  | 
       receive_request | send_reply | send_exception | send_other | |
|---|---|---|---|---|---|
| 继承自 RequestInfo: | |||||
request_id  | 
是 | 是 | 是 | 是 | 是 | 
operation  | 
是 | 是 | 是 | 是 | 是 | 
arguments  | 
否 | 是1 | 是 | 否2 | 否2 | 
exceptions  | 
否 | 是 | 是 | 是 | 是 | 
contexts  | 
否 | 是 | 是 | 是 | 是 | 
operation_context  | 
否 | 是 | 是 | 否 | 否 | 
result  | 
否 | 否 | 是 | 否 | 否 | 
response_expected  | 
是 | 是 | 是 | 是 | 是 | 
sync_scope  | 
是 | 是 | 是 | 是 | 是 | 
| request_id | 是 | 是 | 是 | 是 | 是 | 
| operation | 是 | 是 | 是 | 是 | 是 | 
| arguments | 否 | 是1 | 是 | 否2 | 否2 | 
| exceptions | 否 | 是 | 是 | 是 | 是 | 
| contexts | 否 | 是 | 是 | 是 | 是 | 
| operation_context | 否 | 是 | 是 | 否 | 否 | 
| result | 否 | 否 | 是 | 否 | 否 | 
| response_expected | 是 | 是 | 是 | 是 | 是 | 
| sync_scope | 是 | 是 | 是 | 是 | 是 | 
| reply_status | 否 | 否 | 是 | 是 | 是 | 
| forward_reference | 否 | 否 | 否 | 否 | 是2 | 
| get_slot | 是 | 是 | 是 | 是 | 是 | 
| get_request_service_context | 是 | 否 | 是 | 是 | 是 | 
| get_reply_service_context | 否 | 否 | 是 | 是 | 是 | 
| 特定于 ServerRequestInfo: | |||||
| sending_exception | 否 | 否 | 否 | 是 | 否 | 
| object_id | 否 | 是 | 是 | 是3 | 是3 | 
| adapter_id | 否 | 是 | 是 | 是3 | 是3 | 
| server_id | 否 | 是 | 是 | 是 | 是 | 
| orb_id | 否 | 是 | 是 | 是 | 是 | 
| adapter_name | 否 | 是 | 是 | 是 | 是 | 
| target_most_derived_interface | 否 | 是 | 否4 | 否4 | 否4 | 
| get_server_policy | 是 | 是 | 是 | 是 | 是 | 
| set_slot | 是 | 是 | 是 | 是 | 是 | 
| target_is_a | 否 | 是 | 否4 | 否4 | 否4 | 
| add_reply_service_context | 是 | 是 | 是 | 是 | 是 | 
ServerRequestInfo 传递给 receive_request 时,对于每个参数(无论它是 in、inout 还是 out),列表中都有一个对应的条目。但只有 in 和 inout 参数可用。reply_status 属性不是 LOCATION_FORWARD,则访问此属性将抛出 BAD_INV_ORDER,并带有标准次要代码 14。NO_RESOURCES,并带有标准次要代码 1。ServantLocator 的 POA,则 ORB 将在调用 ServantLocator.postinvoke() 后调用该截取点。
ServerRequestInterceptor| 方法摘要 | |
|---|---|
 byte[] | 
adapter_id()
返回对象适配器的不透明标识符。  | 
 String[] | 
adapter_name()
返回字符串序列,这些字符串标识正处理此请求的对象适配器实例。  | 
 void | 
add_reply_service_context(ServiceContext service_context,
                          boolean replace)
允许 Interceptor 将服务上下文添加到请求。  | 
 Policy | 
get_server_policy(int type)
返回此操作实行的具有给定策略类型的策略。  | 
 byte[] | 
object_id()
返回描述该操作调用目标的不透明 object_id。 | 
 String | 
orb_id()
返回用于创建 ORB 的 ID。  | 
 Any | 
sending_exception()
返回一个 any,它包含将向客户端返回的异常。  | 
 String | 
server_id()
返回使用 -ORBServerId 参数的 ORB::init 上指定的服务器 ID。  | 
 void | 
set_slot(int id,
         Any data)
允许 Interceptor 在请求域中的 PortableInterceptor.Current 内设置槽 (slot)。 | 
 boolean | 
target_is_a(String id)
如果 servant 是给定的存储库 id,则返回 true;若不是则返回 false。  | 
 String | 
target_most_derived_interface()
返回 servant 最终派生接口的存储库 id。  | 
| 从接口 org.omg.PortableInterceptor.RequestInfoOperations 继承的方法 | 
|---|
arguments, contexts, exceptions, forward_reference, get_reply_service_context, get_request_service_context, get_slot, operation_context, operation, reply_status, request_id, response_expected, result, sync_scope | 
| 方法详细信息 | 
|---|
Any sending_exception()
如果异常是不能插入 any 的用户异常(例如,该异常是未知的或绑定不提供 TypeCode),则此属性将是一个包含系统异常 UNKNOWN 并带有标准次要代码 1 的 any。
PortableInterceptor 包中关于限制/未实现特性的注释byte[] object_id()
object_id。
byte[] adapter_id()
String server_id()
String orb_id()
String[] adapter_name()
String target_most_derived_interface()
Policy get_server_policy(int type)
CORBA.Policy 对象只应该是通过 register_policy_factory 注册了其类型的策略。
type - 指定将返回的策略的 CORBA.PolicyType。
CORBA.Policy。
INV_POLICY - 如果没有通过 register_policy_factory 注册给定类型的策略,则抛出此异常,并带有标准次要代码 2。ORBInitInfoOperations.register_policy_factory(int, org.omg.PortableInterceptor.PolicyFactory)
void set_slot(int id,
              Any data)
              throws InvalidSlot
PortableInterceptor.Current 内设置槽 (slot)。如果该槽中已存在数据,则将其重写。
id - 槽的 id。data - 存储在槽中的数据,以 any 的形式存在。
InvalidSlot - 如果 ID 定义的不是已分配的槽,则抛出此异常。Currentboolean target_is_a(String id)
id - 调用方将检验 servant 是否是此存储库 id。
void add_reply_service_context(ServiceContext service_context,
                               boolean replace)
没有对服务上下文的顺序做出任何声明。它们可能按添加的顺序出现,也可能不是如此。
service_context - 将添加到应答的 IOP.ServiceContext。replace - 在已经存在具有给定 ID 的服务上下文时指示此操作的行为。如果为 false,则抛出 BAD_INV_ORDER,并带有标准次要代码 15。如果为 true,则用新服务上下文取代现有的服务上下文。
BAD_INV_ORDER - 如果 replace 为 false 且已经存在具有给定 ID 的服务上下文,则抛出此异常,并带有标准次代码 15。
  | 
JavaTM 2 Platform Standard Ed. 5.0  | 
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2004 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。