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.
44 /// Default constructor.
45 Identity_Client (void);
48 ~Identity_Client (void);
50 /// Initializes <orb_manager_>, and parses commandline arguments.
51 int init (int argc
, ACE_TCHAR
*argv
[]);
57 /// Parses the commandline arguments.
58 int parse_args (int argc
, ACE_TCHAR
*argv
[]);
61 TAO_ORB_Manager orb_manager_
;
63 /// The ior of the <Object_Group_Factory> object we shall use to
64 /// to obtain an <Object_Group> object.
65 const ACE_TCHAR
*group_factory_ior_
;
67 /// Number of times to invoke <get_name> method on <Identity>
68 /// objects. The default value is 5.
69 size_t number_of_invocations_
;
72 * Flag indicating which <Object_Group> to use to obtain references
73 * to <Identity> objects. Random group should be used if the flag
74 * is set to 1, and round robin group otherwise. Round robin is the
80 #endif /* IDENTITY_CLIENT_H_ */