To instantiate a home interface, use a SessionManager::Manager instance to create a SessionManager::Session instance, then call the SessionManager::Session::lookup method, passing the EJB component’s home interface name. Narrow the returned object to the C++ class for the EJB component’s home interface.
In this example, the IDL home interface is bookStore::custMaintenanceHome and the EJB component’s home interface name is bookStore/custMaintenance:
// Initialize the ORB CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, 0); // Obtain a SessionManager::Manager instance using the URL: CORBA::Object_var obj = orb->string_to_object(url); SessionManager::Manager_var manager = SessionManager::Manager::_narrow(obj); // Create an authenticated session for user Guest // using password GuestPassword SessionManager::Session_var session = manager->createSession("Guest", "GuestPassword"); // Look up the EJB component's home interface obj = session->lookup(component_name); bookStore::custMaintenanceHome_var home = bookStore::custMaintenanceHome::_narrow(obj);