ORB::register_initial_reference

Overview Registers an initial reference with the ORB. Subsequent calls to CORBA::ORB::resolve_initial_references() will return the registered object.
Original class CORBA::ORB
Exceptions If the object identifier is invalid or an object with that identifier is already registered with the ORB, then the CORBA::InvalidName exception is thrown.
If another error occurs, a CORBA::SystemException is thrown.


Intended Usage

There are a certain number of predefined objects that a call to CORBA::ORB::resolve_initial_references() will return. However, applications may wish to add additional initial references. The CORBA::ORB::register_initial_reference() method can be used by client and server applications to register additional initial references with the ORB.

The lifecycle of these initial references coincides with the lifecycle of the ORB. After an initial reference has been registered with the ORB, then a call to CORBA::ORB::resolve_initial_references() can be used to obtain the initial reference. In fact, the ORB will also respond to "locate" requests received from other CORBA-based programs. So, if a server application registers an initial reference, then a client application could obtain a reference to that initial reference by calling the CORBA::ORB::string_to_object() method with an appropriate Object URL string.

The caller specifies the initial reference (which must be an IDL-defined interface) along with an object identifier. The object identifier must be unique (i.e. it must not conflict with a predefined initial reference identifier or an identifier of an initial reference that has already been registered with the ORB).

Syntax

void register_initial_reference ( 
	const char *identifier, 
	const CORBA::Object_ptr obj
	);

Input parameters

identifier
the object identifier associated with the initial reference. The caller retains ownership of this string.
obj
the object that serves as the initial reference. The caller retains ownership of this object and should subsequently release it by calling the CORBA::release() method.

Example

#include <corba.h>
#include <myservice.ih>

// Assume "op" is a pointer to the ORB object.
.
.
.
MyService_Impl *myService = new MyService_Impl;
op->register_initial_reference ( "MyService", myService );

Related reference
CORBA module



Searchable topic ID:   rcor_modo28a
Last updated: Jun 21, 2007 8:07:48 PM CDT    WebSphere Business Integration Server Foundation, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.wasee.doc/info/ee/corba/ref/rcor_modo28a.html

Library | Support | Terms of Use | Feedback