summaryrefslogtreecommitdiff
path: root/TAO/examples/CSD_Strategy/ThreadPool5/FooServantList.h
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/examples/CSD_Strategy/ThreadPool5/FooServantList.h')
-rw-r--r--TAO/examples/CSD_Strategy/ThreadPool5/FooServantList.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/TAO/examples/CSD_Strategy/ThreadPool5/FooServantList.h b/TAO/examples/CSD_Strategy/ThreadPool5/FooServantList.h
new file mode 100644
index 00000000000..8a3f6dd3c3f
--- /dev/null
+++ b/TAO/examples/CSD_Strategy/ThreadPool5/FooServantList.h
@@ -0,0 +1,62 @@
+// $Id$
+#ifndef FOOSERVANTLIST_H
+#define FOOSERVANTLIST_H
+
+#include "tao/PortableServer/PortableServer.h"
+#include "tao/PortableServer/Servant_Base.h"
+#include "ace/SString.h"
+
+
+class ClientTask;
+class Foo_i;
+
+class FooServantList
+{
+ public:
+
+ FooServantList(const char* prefix,
+ unsigned num_servants,
+ unsigned num_clients,
+ int collocated_test,
+ int servant_to_deactivate,
+ CORBA::ORB_ptr orb);
+ ~FooServantList();
+
+ void create_and_activate(CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa);
+
+ void client_done(void);
+
+ ClientTask* collocated_client () const;
+
+ void deactivate_servant (void);
+
+ private:
+
+ typedef ACE_SYNCH_MUTEX LockType;
+ typedef ACE_Guard<LockType> GuardType;
+
+ Foo_i** servants_;
+ PortableServer::ServantBase_var* safe_servants_;
+ ACE_CString prefix_;
+ unsigned num_servants_;
+
+ LockType num_clients_lock_;
+ unsigned num_clients_;
+ unsigned init_num_clients_;
+ int collocated_test_;
+ // The servant_to_be_deactivate_ should be an integer greater than -2.
+ // -1 => defatult value, DONT deactivate servant.
+ // 0 => deactivate all servants.
+ // > 0 => the index of the servant to be deactivated.
+ int servant_to_deactivate_;
+
+ ClientTask* collocated_client_;
+
+ /// The poa to activate and deactivate servant.
+ PortableServer::POA_var poa_;
+
+ CORBA::ORB_var orb_;
+};
+
+#endif