3 //=============================================================================
5 * @file Identity_Client.h
7 * Code for Identity_Client, which is used in conjunction with
8 * Identity_Server to test/demonstrate the functionality of the
9 * Load Balancing service.
11 * @author Marina Spivak <marina@cs.wustl.edu>
13 //=============================================================================
16 #ifndef IDENTITY_CLIENT_H_
17 #define IDENTITY_CLIENT_H_
19 #include "tao/Utils/ORB_Manager.h"
21 #if !defined (ACE_LACKS_PRAGMA_ONCE)
23 #endif /* ACE_LACKS_PRAGMA_ONCE */
26 * @class Identity_Client
28 * Contacts the <Object_Group_Factory> in th Load Balancing Server
29 * to obtain a reference to the type of the <Object_Group>
30 * specified on the command line. Then, queries the
31 * <Object_Group> for its id and members, and prints that
32 * information. Finally, performs <number_of_invocations_>
33 * <Identity::get_name> calls, performing <Object_Group::resolve>
34 * before each <get_name> call in order to get the <Identity>
35 * reference to use for the call. (This provides an example of
36 * fine-grained, i.e., per call, Load Balancing among all the
37 * <Identity> objects registered with the <Object_Group> for the
38 * client's <get_name> calls.
43 /// Default constructor.
49 /// Initializes <orb_manager_>, and parses commandline arguments.
50 int init (int argc
, ACE_TCHAR
*argv
[]);
56 /// Parses the commandline arguments.
57 int parse_args (int argc
, ACE_TCHAR
*argv
[]);
60 TAO_ORB_Manager orb_manager_
;
62 /// The ior of the <Object_Group_Factory> object we shall use to
63 /// to obtain an <Object_Group> object.
64 const ACE_TCHAR
*group_factory_ior_
;
66 /// Number of times to invoke <get_name> method on <Identity>
67 /// objects. The default value is 5.
68 size_t number_of_invocations_
;
71 * Flag indicating which <Object_Group> to use to obtain references
72 * to <Identity> objects. Random group should be used if the flag
73 * is set to 1, and round robin group otherwise. Round robin is the
79 #endif /* IDENTITY_CLIENT_H_ */