Merge pull request #2303 from jwillemsen/jwi-803
[ACE_TAO.git] / TAO / tests / CSD_Strategy_Tests / TP_Test_2 / ServerApp.h
blob0f791dc29fa8067d5263b0a3290d905791447853
1 #ifndef SERVERAPP_H
2 #define SERVERAPP_H
4 #include "TestAppBase.h"
5 #include "Foo_A_i.h"
6 #include "ServantList_T.h"
7 #include "ClientTask.h"
8 #include "tao/CSD_ThreadPool/CSD_TP_Strategy.h"
9 #include "ace/SString.h"
12 class ServerApp : public TestAppBase
14 public:
15 ServerApp();
16 virtual ~ServerApp() = default;
18 protected:
19 virtual int run_i(int argc, ACE_TCHAR* argv[]);
21 private:
22 // These are all called, in order, by the run_i() method.
23 int init(int argc, ACE_TCHAR* argv[]);
24 void poa_setup();
25 void csd_setup();
26 void servant_setup();
27 void collocated_setup();
28 void poa_activate();
29 void run_collocated_clients();
30 void run_orb_event_loop();
31 bool check_validity ();
32 void cleanup();
35 // Helper methods used by the methods above.
36 int parse_args(int argc, ACE_TCHAR* argv[]);
38 int set_arg(unsigned& value,
39 const ACE_TCHAR* arg,
40 char opt,
41 const char* name,
42 int min = 0);
44 void usage_statement();
45 int arg_dependency_checks();
48 PortableServer::POA_ptr create_poa(CORBA::ORB_ptr orb,
49 const char* poa_name);
51 typedef ServantList<Foo_A_i> ServantListType;
53 CORBA::ORB_var orb_;
54 PortableServer::POA_var poa_;
55 TAO::CSD::TP_Strategy_Handle tp_strategy_;
57 ServantListType servants_;
59 ClientTask collocated_client_task_;
61 ACE_TString exe_name_;
63 ACE_TString ior_filename_prefix_;
64 unsigned num_servants_;
65 unsigned num_csd_threads_;
66 unsigned num_orb_threads_;
67 unsigned num_remote_clients_;
68 unsigned num_collocated_clients_;
69 unsigned collocated_client_kind_;
72 #endif