// $Id$ // -*- C++ -*- // ============================================================================ // // = LIBRARY // TAO/examples/Load_Balancing // // = FILENAME // Identity_Server.h // // = DESCRIPTION // Driver for identity server, which is used to test/demonstrate // the functionality of the Load Balancing service. // // = AUTHORS // Marina Spivak // with modifications by Bala Natarajan // ============================================================================ #ifndef IDENTITY_SERVER_H_ #define IDENTITY_SERVER_H_ #include "tao/TAO.h" #include "Load_BalancerC.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ class Identity_Server { // =TITLE // Contacts the in the Load Balancing Server // to create two s, one round robin and one random. // Then, creates a number of objects and registers them with // the created s in a manner specified by the // commandline arguments. // public: Identity_Server (void); // Default constructor. ~Identity_Server (void); // Destructor. int parse_args (int argc, char *argv[]); // Parses the commandline arguments. int init (int argc, char *argv[]); // Performs all the initializations necessary before going into the // ORB event loop. int register_groups (CORBA::Environment &ACE_TRY_ENV); int run (CORBA::Environment &ACE_TRY_ENV); // Run the server. private: void create_objects (size_t number_of_objects, Load_Balancer::Object_Group_ptr group, CORBA::Environment &ACE_TRY_ENV); // Creates the specified number of identity objects, and registers // each one with the provided . Identity servants are // given names //"Identity object 1" .... "Identity object ". TAO_ORB_Manager orb_manager_; // The ORB manager. const char *group_factory_ior_; // The ior of the object we shall use to // create s to load balance our objects. size_t random_objects_; // Number of objects to create for registering with // the random . The default value is 5. size_t rr_objects_; // Number of objects to create for registering with the // round robin . The default value is 5. PortableServer::POA_var persistent_POA_; }; #endif /* IDENTITY_SERVER_H_ */