public interface ORBInitializerOperations
拦截的目的是通过ORB服务获得球的处理,有效地成为ORB的一部分。由于拦截导弹的球体的一部分,当ORB.init
返回一个天体,拦截器应已注册。拦截不能注册在球后已返回被调用的ORB.init
。
拦截是通过注册相关ORBInitializer
对象实现了ORBInitializer
接口注册。当一个ORB初始化,它要给每一个注册ORBInitializer
,它传递一个用来登记拦截ORBInitInfo
对象。
在java注册ORB初始化
orbinitializers注册通过java球性能。
属性名称是窗体的:
org.omg.PortableInterceptor.ORBInitializerClass.<Service>
哪里
<Service>
是类的实现
org.omg.PortableInterceptor.ORBInitializer
为了避免名字冲突的字符串名称,反向DNS名称公约应使用。例如,如果X公司三的初始化,它可以定义以下属性:
org.omg.PortableInterceptor.ORBInitializerClass.com.x.Init1
org.omg.PortableInterceptor.ORBInitializerClass.com.x.Init2
org.omg.PortableInterceptor.ORBInitializerClass.com.x.Init3
org.omg.PortableInterceptor.ORBInitializerClass
应收集,每个属性的
<Service>
部分应提取对象的实例化,应与
<Service>
字符串作为它的类的名字,和
pre_init
和
post_init
方法应被称为该对象。如果有任何异常,ORB将忽略它们并继续。
例子
一个客户端登录服务的公司,写的例子,可能有以下orbinitializer实施:
package com.x.logging;
import org.omg.PortableInterceptor.Interceptor;
import org.omg.PortableInterceptor.ORBInitializer;
import org.omg.PortableInterceptor.ORBInitInfo;
public class LoggingService implements ORBInitializer {
void pre_init( ORBInitInfo info ) {
// Instantiate the Logging Service s Interceptor.
Interceptor interceptor = new LoggingInterceptor();
// Register the Logging Service s Interceptor.
info.add_client_request_interceptor( interceptor );
}
void post_init( ORBInitInfo info ) {
// This service does not need two init points.
}
}
运行一个程序称为
MyApp
使用日志服务、用户类型:
java -Dorg.omg.PortableInterceptor.ORBInitializerClass.com.x.Logging.LoggingService MyApp
有关注册拦截器的笔记
要求每一个球拦截导弹基础上注册。
实现虚拟的每个对象的拦截器,查询的政策目标在拦截点,确定他们是否应该做什么工作。
实现虚拟每POA拦截器,实例化每个POA与不同的球。而拦截器可以有序管理,没有秩序观相对于拦截登记。请求拦截器所关心的服务环境。服务上下文没有秩序,所以没有目的请求拦截器有订单。IOR拦截器有关标记组件。标记的组件也没有秩序,所以没有目的的IOR拦截器有订单。
注册码应该避免使用ORB(即与所提供的orb_id
)称ORB.init
。因为在ORB初始化时调用注册,结果这球而正是在这样的状态是不确定的。
ORBInitInfo
Modifier and Type | Method and Description |
---|---|
void |
post_init(ORBInitInfo info)
在ORB初始化为。
|
void |
pre_init(ORBInitInfo info)
在ORB初始化为。
|
void pre_init(ORBInitInfo info)
ORBInitInfo.register_initial_reference
。
info
提供初始化的属性和操作,拦截器可以注册。
void post_init(ORBInitInfo info)
调用post_init
操作不是ORB初始化的最后任务。最后一项任务,在post_init
电话,附注册拦截列表球体。因此,宝珠不包含在电话中post_init
拦截。如果一个球体是由内post_init
介导的电话,没有请求拦截器将在调用调用。同样,如果一个操作执行的原因而被创造,没有IOR拦截器将被调用。
info
提供初始化的属性和操作,拦截器可以注册。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.