The SessionManager::Manager interface is used for client authentication for EAServer connections. To create a Manager instance, you must identify the server by using an IIOP or IIOPS URL to connect to the server.
The server’s IIOP port is configured using listeners. In the default configuration, the IIOP port number is 2000. For more information, see Chapter 3, “Creating and Configuring Servers,” in the System Administration Guide.
Once the client has obtained the server’s IOR or URL string, it calls the ORB::string_to_object method to convert the IOR or URL string into a Manager instance, as shown in the following example. You use the Manager::_narrow method to return a new object reference for the existing object, which is the IOR object.
... Object_var object = orb->string_to_object ("iiop://myhost:2000"); Manager_var manager = Manager::_narrow (object); if (is_nil(manager)) { cout << "Error: Null SessionManager::Manager instance. Exiting."; return -1; }...
string_to_object returns an object reference as object. For each reference, the _var form is used because the object will be automatically released when it is deallocated or assigned a new object reference. _narrow converts object into object reference for Manager.
_narrow returns a nil object reference if the component does not implement the interface. is_nil(manager) verifies that the SessionManager::Manager interface is implemented and returns an error if the interface is not implemented.