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"
15 FooServantList(const ACE_TCHAR
* prefix
,
16 unsigned num_servants
,
19 int servant_to_deactivate
,
23 void create_and_activate(CORBA::ORB_ptr orb
,
24 PortableServer::POA_ptr poa
);
28 ClientTask
* collocated_client () const;
30 void deactivate_servant ();
34 PortableServer::ServantBase_var
* safe_servants_
;
36 unsigned num_servants_
;
38 TAO_SYNCH_MUTEX num_clients_lock_
;
39 unsigned num_clients_
;
40 unsigned init_num_clients_
;
42 // The servant_to_be_deactivate_ should be an integer greater than -2.
43 // -1 => defatult value, DONT deactivate servant.
44 // 0 => deactivate all servants.
45 // > 0 => the index of the servant to be deactivated.
46 int servant_to_deactivate_
;
48 ClientTask
* collocated_client_
;
50 /// The poa to activate and deactivate servant.
51 PortableServer::POA_var poa_
;