3 //=============================================================================
5 * @file Identity_Server.h
7 * Driver for identity server, which is used to test/demonstrate
8 * the functionality of the Load Balancing service.
10 * @author Marina Spivak <marina@cs.wustl.edu> with modifications by Bala Natarajan <bala@cs.wustl.edu>
12 //=============================================================================
15 #ifndef IDENTITY_SERVER_H_
16 #define IDENTITY_SERVER_H_
18 #include "tao/Utils/ORB_Manager.h"
19 #include "Load_BalancerC.h"
21 #if !defined (ACE_LACKS_PRAGMA_ONCE)
23 #endif /* ACE_LACKS_PRAGMA_ONCE */
26 * @class Identity_Server
28 * Contacts the <Object_Group_Factory> in the Load Balancing Server
29 * to create two <Object_Group>s, one round robin and one random.
30 * Then, creates a number of <Identity> objects and registers them with
31 * the created <Object_Group>s in a manner specified by the
32 * commandline arguments.
37 /// Default constructor.
43 /// Parses the commandline arguments.
44 int parse_args (int argc
, ACE_TCHAR
*argv
[]);
46 /// Performs all the initializations necessary before going into the
48 int init (int argc
, ACE_TCHAR
*argv
[]);
50 int register_groups ();
58 * Creates the specified number of identity objects, and registers
59 * each one with the provided <Object_Group>. Identity servants are
61 *"Identity object 1" .... "Identity object <number_of_objects>".
63 void create_objects (size_t number_of_objects
,
64 Load_Balancer::Object_Group_ptr group
);
68 TAO_ORB_Manager orb_manager_
;
70 /// The ior of the <Object_Group_Factory> object we shall use to
71 /// create <Object_Group>s to load balance our <Identity> objects.
72 const ACE_TCHAR
*group_factory_ior_
;
74 /// Number of <Identity> objects to create for registering with
75 /// the random <Object_Group>. The default value is 5.
76 size_t random_objects_
;
78 /// Number of <Identity> objects to create for registering with the
79 /// round robin <Object_Group>. The default value is 5.
82 PortableServer::POA_var persistent_POA_
;
85 #endif /* IDENTITY_SERVER_H_ */