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"
16 FooServantList(const ACE_TCHAR
* prefix
,
17 unsigned num_servants
,
20 int servant_to_deactivate
,
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);
35 PortableServer::ServantBase_var
* safe_servants_
;
37 unsigned num_servants_
;
39 TAO_SYNCH_MUTEX num_clients_lock_
;
40 unsigned num_clients_
;
41 unsigned init_num_clients_
;
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_
;