In order for a server to make use of the Implementation Repository, it must communicate with the IR to keep it up to date on such things as the server's running status. These actions are currently encapsulated in the IR_Helper class that is located in the orbsvcs library.
The main steps for the lifetime of a server that uses the IR are generally the following:
tao_ir -ORBImplRepoServiceIOR file://implrepo.ior add plane -c
"airplane_server -i -ORBImplRepoServiceIOR file://implrepo.ior" tao_ir -ORBImplRepoServiceIOR file://implrepo.ior shutdown plane
tao_ir -ORBImplRepoServiceIOR file://implrepo.ior remove planeThe server will need to do the following things in order to work correctly with the IR.
The details of how to do this can be found in the IR_Helper class, which has methods to perform these actions.
The IR_Helper class is a class intended for use by the server to communicate with the IR. It does some of the work by keeping a reference to the IR and a ServerObject and hiding much of the work of registration in methods.
Following is the public interface for IR_Helper
IR_Helper (const char *server_name, PortableServer::POA_ptr poa, CORBA::ORB_ptr
orb, int debug = 0);
To contruct, you must pass in a server_name (which must be the same as the name of
the POA where the objects reside) and pointers to the ORB and POA. The debug flag,
if set to a value higher than zero, will cause the class to output messages using
ACE_DEBUG.
void notify_startup ();
void notify_shutdown ();
int register_server (const char *comm_line, const char *environment =
"", const char *working_dir = "");
void change_object (CORBA::Object_ptr obj);
If you look at the two tests, they use -i flags to determine how to use the IR. The -i flag turns on the use of the Implementation Repository. This allows the server to be tested without the IR, to help track down problems..
What does the future hold for the IR? In addition to supporting the "not fully supported yet" items listed above, the functionality of IR_Helper will be moved into TAO's POA and ORB. This will help make the use of the IR in a server easier, since less changes will have to be made to the server code itself.
Last update to this document: $Date$
Back to Implementation Repository