Download ORBACUS, this manual
Transcript
Initial Services
{
void register_initial_reference(in ObjectId id, in Object obj)
raises(InvalidName);
};
};
For example, in C++:
1 // C++
2 CORBA::Object_var obj = ... // Get a name service reference somehow
3 orb -> register_initial_reference("NameService", obj);
2
Get a reference to the naming service, for example by reading a stringified object reference and converting it with string_to_object, or by any other means.
3
Add the reference to the ORB’s list of initial references.
Or in Java:
1 // Java
2 org.omg.CORBA.Object obj = ...// Get a name service reference somehow
3 orb.register_initial_reference("NameService", obj);
1-3
6.5.3
This is the same as the C++ version above.
The Initial Service Locator
In addition to providing the ORBACUS Implementation Repository, the imr server (see
Chapter 7) acts as an initial service locator. That is, assuming that the imr server is properly configured, the name of the host running the imr server is the only information needed
to find a particular initial service.
To locate an initial service with name foo, the imr server must first be configured with the
initial reference of this service. This may be done with the -ORBInitRef command-line
option or the ooc.orb.service configuration property (see Chapter 4 for details). Next,
the client that wishes to connect to foo must be configured with the default initial reference specifying the host running the imr server. The -ORBDefaultInitRef commandline option or the ooc.orb.default_init_ref configuration property may be used to
configure the default initial reference. For example, given that the imr server is running on
imr-host, then the client can be started with the option:
-ORBDefaultInitRef=corbaloc::imr-host
When the client is configured with this default initial reference it may invoke
resolve_initial_references("foo") on the ORB to obtain a reference to foo.
ORBacus
111