Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / examples / CSD_Strategy / ThreadPool5 / FooServantList.h
blob4a06102f735c9bedb4b77f463ffe280c5a778b25
1 #ifndef FOOSERVANTLIST_H
2 #define FOOSERVANTLIST_H
4 #include "tao/PortableServer/PortableServer.h"
5 #include "tao/PortableServer/Servant_Base.h"
6 #include "ace/SString.h"
9 class ClientTask;
10 class Foo_i;
12 class FooServantList
14 public:
16 FooServantList(const ACE_TCHAR* prefix,
17 unsigned num_servants,
18 unsigned num_clients,
19 int collocated_test,
20 int servant_to_deactivate,
21 CORBA::ORB_ptr orb);
22 ~FooServantList();
24 void create_and_activate(CORBA::ORB_ptr orb,
25 PortableServer::POA_ptr poa);
27 void client_done(void);
29 ClientTask* collocated_client () const;
31 void deactivate_servant (void);
33 private:
34 Foo_i** servants_;
35 PortableServer::ServantBase_var* safe_servants_;
36 ACE_TString prefix_;
37 unsigned num_servants_;
39 TAO_SYNCH_MUTEX num_clients_lock_;
40 unsigned num_clients_;
41 unsigned init_num_clients_;
42 int collocated_test_;
43 // The servant_to_be_deactivate_ should be an integer greater than -2.
44 // -1 => defatult value, DONT deactivate servant.
45 // 0 => deactivate all servants.
46 // > 0 => the index of the servant to be deactivated.
47 int servant_to_deactivate_;
49 ClientTask* collocated_client_;
51 /// The poa to activate and deactivate servant.
52 PortableServer::POA_var poa_;
54 CORBA::ORB_var orb_;
57 #endif