2
// AdminProperties.h,v 1.5 2003/07/06 21:41:57 pradeep Exp
3
// ==========================================================================
9
// Test for EC Admin QoS properties.
12
// Pradeep Gore <pradeep@cs.wustl.edu>
14
// ==========================================================================
16
#ifndef ADMINPROPERTIES
17
#define ADMINPROPERTIES
20
#include "Notify_Test_Client.h"
21
#include "Notify_StructuredPushConsumer.h"
22
#include "Notify_StructuredPushSupplier.h"
24
class AdminProperties;
25
/***************************************************************************/
27
class AdminProperties_StructuredPushConsumer : public TAO_Notify_Tests_StructuredPushConsumer
29
friend class AdminProperties;
31
AdminProperties_StructuredPushConsumer (AdminProperties* client);
33
// = StructuredPushSupplier methods
34
virtual void push_structured_event (const CosNotification::StructuredEvent & notification
38
CORBA::SystemException,
39
CosEventComm::Disconnected
43
AdminProperties* client_;
45
ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::Long> events_received_;
49
class AdminProperties_Task : public ACE_Task_Base
52
// Run a thread to dispatch events.
55
// Use the ACE_Task_Base class.
59
AdminProperties_Task (void);
63
void init (TAO_Notify_Tests_StructuredPushSupplier *supplier, AdminProperties* client);
65
virtual int init (int argc, ACE_TCHAR *argv []);
67
virtual int svc (void);
68
// The thread entry point.
72
TAO_Notify_Tests_StructuredPushSupplier *supplier_;
75
AdminProperties* client_;
78
/***************************************************************************/
80
class AdminProperties : public Notify_Test_Client
86
// Test for Notify EC properties -
93
friend class AdminProperties_StructuredPushConsumer;
94
friend class AdminProperties_Task;
97
AdminProperties (void);
98
~AdminProperties (void);
100
int parse_args (int argc,
108
void run_test (ACE_ENV_SINGLE_ARG_DECL);
112
void create_suppliers (ACE_ENV_SINGLE_ARG_DECL);
113
void create_consumers (ACE_ENV_SINGLE_ARG_DECL);
115
/// Test MaxSuppliers and MaxConsumers
116
void test_max_clients (ACE_ENV_SINGLE_ARG_DECL);
118
/// Test MaxQueueLength properties
119
void test_max_queue_length (ACE_ENV_SINGLE_ARG_DECL);
122
CosNotifyChannelAdmin::EventChannel_var ec_;
123
// The one channel that we create using the factory.
125
CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin_;
126
// The consumer admin used by consumers.
128
CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin_;
129
// The supplier admin used by suppliers.
131
CORBA::Long max_queue_length_;
132
CORBA::Long max_consumers_;
133
CORBA::Long max_suppliers_;
134
CORBA::Boolean reject_new_events_;
135
// Values for Admin Properties supplied by user.
138
ACE_Time_Value consumer_delay_;
141
ACE_Time_Value initial_delay_;
143
/// Number of consumers to connect to check MaxConsumers property.
144
CORBA::Long consumers_;
146
/// Number of suppliers to connect to check MaxSuppliers property.
147
CORBA::Long suppliers_;
149
CORBA::Long event_count_;
150
// Number of events to send to the channel.
152
/// Count of consumers successfully connect to the EC.
153
int suppliers_connected_count_;
155
/// Count of consumers successfully connect to the EC.
156
int consumers_connected_count_;
158
/// Boolean flag that is set if the IMPL_LIMIT exception is thrown when trying to
159
/// exceed the Max_Queue_Length
160
CORBA::Boolean was_rejected_;
163
#endif /* ADMINPROPERTIES */