简体   繁体   English

当您使用Java初始化CORBA ORB时,ORBInitialHost和ORBInitialPort属性代表什么?

[英]When you initialize a CORBA ORB in Java, what do the ORBInitialHost and ORBInitialPort properties represent?

Properties aProperties = new Properties();
aProperties.put("org.omg.CORBA.ORBInitialHost", "localhost");
aProperties.put("org.omg.CORBA.ORBInitialPort", "2930");
ORB orb = ORB.init((String[]) null, aProperties);
//Get the stringified reference over TCP (String ior)
org.omg.CORBA.Object cmdObject = orb.string_to_object(ior);
this.corba = OGE_CMDHelper.narrow(cmdObject);

What exactly do org.omg.CORBA.ORBInitialHost and org.omg.CORBA.ORBInitialPort represent? org.omg.CORBA.ORBInitialHostorg.omg.CORBA.ORBInitialPort代表什么? Is is it the hostname and address of the receiving endpoint of CORBA commands (the location of the implemented objects)? 是CORBA命令的接收端点的主机名和地址(实现的对象的位置)吗? Or is it the hostname and port of the local CORBA ORB that is transmitting CORBA messages to the receiver? 还是将CORBA消息传输到接收方的本地CORBA ORB的主机名和端口? Or is it something else entirely? 还是完全其他?

Regarding the Java SE documentation (new link inserted) 关于Java SE文档 (已插入新链接)

org.omg.CORBA.ORBInitialHost is org.omg.CORBA.ORBInitialHost

The host name of a machine running a server or daemon that provides initial bootstrap services, such as a name service. 运行提供初始引导服务(例如名称服务)的服务器或守护程序的计算机的主机名。 The default value for this property is localhost for applications. 对于应用程序,此属性的默认值为localhost。 For applets it is the applet host, equivalent to getCodeBase().getHost(). 对于applet,它是applet主机,等效于getCodeBase()。getHost()。

org.omg.CORBA.ORBInitialPort is org.omg.CORBA.ORBInitialPort

The port the initial naming service listens to. 初始命名服务侦听的端口。 The default value is 900. 默认值为900。

Believe it or not, they represent the host/port pair for the Naming Service that your client ORB will try to contact (the Naming Service is basically a telephone book for CORBA object references). 信不信由你,它们代表了您的客户ORB尝试联系的命名服务的主机/端口对(命名服务基本上是用于CORBA对象引用的电话簿)。 You can see them in action with it in this diagram . 您可以在此图中看到它们的运行情况。

Oddly enough, these properties were never standardized by the OMG, but for some reason the Sun ORB packaged them within org.omg.CORBA and made it look like they were standardized (see the little tidbit at the bottom of this IBM page ). 奇怪的是,OMG从未对这些属性进行标准化,但是出于某种原因,Sun ORB将它们打包在org.omg.CORBA ,使其看起来像是标准化的(请参阅此IBM页面底部的小窍门)。 If you're really interested in reading old CORBA history, this OMG issue discusses them a little bit. 如果您真的有兴趣阅读旧的CORBA历史记录,本OMG问题将对它们进行一些讨论。

The standardized approach to the problem of bootstrapping your client to find the Naming Service was defined in the CORBA Interoperable Naming Service (INS) spec, and it's what you should use here if you can. 引导客户找到命名服务的标准方法是在CORBA 互操作命名服务(INS)规范中定义的,如果可以的话,应在此处使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM