简体   繁体   中英

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? Is is it the hostname and address of the receiving endpoint of CORBA commands (the location of the implemented objects)? Or is it the hostname and port of the local CORBA ORB that is transmitting CORBA messages to the receiver? Or is it something else entirely?

Regarding the Java SE documentation (new link inserted)

org.omg.CORBA.ORBInitialHost is

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. For applets it is the applet host, equivalent to getCodeBase().getHost().

org.omg.CORBA.ORBInitialPort is

The port the initial naming service listens to. The default value is 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). 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 ). If you're really interested in reading old CORBA history, this OMG issue discusses them a little bit.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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