1
// Identity_Server.h,v 1.4 2002/01/29 20:20:40 okellogg Exp
4
// ============================================================================
7
// TAO/examples/Load_Balancing
13
// Driver for identity server, which is used to test/demonstrate
14
// the functionality of the Load Balancing service.
17
// Marina Spivak <marina@cs.wustl.edu>
18
// with modifications by Bala Natarajan <bala@cs.wustl.edu>
19
// ============================================================================
21
#ifndef IDENTITY_SERVER_H_
22
#define IDENTITY_SERVER_H_
24
#include "tao/PortableServer/ORB_Manager.h"
25
#include "Load_BalancerC.h"
27
#if !defined (ACE_LACKS_PRAGMA_ONCE)
29
#endif /* ACE_LACKS_PRAGMA_ONCE */
34
// Contacts the <Object_Group_Factory> in the Load Balancing Server
35
// to create two <Object_Group>s, one round robin and one random.
36
// Then, creates a number of <Identity> objects and registers them with
37
// the created <Object_Group>s in a manner specified by the
38
// commandline arguments.
42
Identity_Server (void);
43
// Default constructor.
45
~Identity_Server (void);
48
int parse_args (int argc, char *argv[]);
49
// Parses the commandline arguments.
51
int init (int argc, char *argv[]);
52
// Performs all the initializations necessary before going into the
55
int register_groups (ACE_ENV_SINGLE_ARG_DECL);
58
int run (ACE_ENV_SINGLE_ARG_DECL);
64
void create_objects (size_t number_of_objects,
65
Load_Balancer::Object_Group_ptr group
67
// Creates the specified number of identity objects, and registers
68
// each one with the provided <Object_Group>. Identity servants are
70
//"Identity object 1" .... "Identity object <number_of_objects>".
73
TAO_ORB_Manager orb_manager_;
76
const char *group_factory_ior_;
77
// The ior of the <Object_Group_Factory> object we shall use to
78
// create <Object_Group>s to load balance our <Identity> objects.
80
size_t random_objects_;
81
// Number of <Identity> objects to create for registering with
82
// the random <Object_Group>. The default value is 5.
85
// Number of <Identity> objects to create for registering with the
86
// round robin <Object_Group>. The default value is 5.
88
PortableServer::POA_var persistent_POA_;
91
#endif /* IDENTITY_SERVER_H_ */