Creating a Manager instance

The SessionManager::Manager interface is used for client authentication for EAServer connections. To create a Manager instance, you must identify the server by using:

The IOR string encodes the server’s host address and the port at which the server accepts IIOP requests. Each time EAServer is started, for each listener the server prints a hex-encoded IOR string with standard encoding to the following files in the EAServer html subdirectory:

<listener> is the name of the listener.

<iiop-version> is the version of IIOP and can be either 10, which represents IIOP version 1.0, or 11, which represents IIOP version 1.1.

For example, a server will generate the following files for a listener, iiops2:

You can code your C++ client to retrieve the IOR string from one of the <listener><iiop-version>.ior files.

The server’s IIOP port is configured in EAServer Manager using listeners. In the default configuration, the IIOP port number is 9000.

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:9000");
  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 to the URL, iiop://jagpc3:9000, 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.