~ubuntu-branches/ubuntu/breezy/ace/breezy

« back to all changes in this revision

Viewing changes to TAO/orbsvcs/tests/Notify/Basic/AdminProperties.h

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad, Benjamin Montgomery, Adam Conrad
  • Date: 2005-09-18 22:51:38 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 sarge) (0.1.2 woody)
  • Revision ID: james.westby@ubuntu.com-20050918225138-seav22q6fyylb536
Tags: 5.4.7-3ubuntu1
[ Benjamin Montgomery ]
* Added a patch for amd64 and powerpc that disables the compiler
  option -fvisibility-inlines-hidden

[ Adam Conrad ]
* Added DPATCH_OPTION_CPP=1 to debian/patches/00options to make
  Benjamin's above changes work correctly with dpatch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- C++ -*- */
2
 
// AdminProperties.h,v 1.5 2003/07/06 21:41:57 pradeep Exp
3
 
// ==========================================================================
4
 
//
5
 
// = FILENAME
6
 
//   AdminProperties.h
7
 
//
8
 
// = DESCRIPTION
9
 
//   Test for EC Admin QoS properties.
10
 
//
11
 
// = AUTHOR
12
 
//   Pradeep Gore <pradeep@cs.wustl.edu>
13
 
//
14
 
// ==========================================================================
15
 
 
16
 
#ifndef ADMINPROPERTIES
17
 
#define ADMINPROPERTIES
18
 
 
19
 
#include "ace/Task.h"
20
 
#include "Notify_Test_Client.h"
21
 
#include "Notify_StructuredPushConsumer.h"
22
 
#include "Notify_StructuredPushSupplier.h"
23
 
 
24
 
class AdminProperties;
25
 
/***************************************************************************/
26
 
 
27
 
class AdminProperties_StructuredPushConsumer : public TAO_Notify_Tests_StructuredPushConsumer
28
 
{
29
 
  friend class AdminProperties;
30
 
public:
31
 
  AdminProperties_StructuredPushConsumer (AdminProperties* client);
32
 
 
33
 
  // = StructuredPushSupplier methods
34
 
  virtual void push_structured_event (const CosNotification::StructuredEvent & notification
35
 
                                      ACE_ENV_ARG_DECL
36
 
                                      )
37
 
    ACE_THROW_SPEC ((
38
 
                     CORBA::SystemException,
39
 
                     CosEventComm::Disconnected
40
 
                     ));
41
 
 
42
 
protected:
43
 
  AdminProperties* client_;
44
 
 
45
 
  ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::Long> events_received_;
46
 
};
47
 
 
48
 
 
49
 
class AdminProperties_Task : public ACE_Task_Base
50
 
{
51
 
  // = TITLE
52
 
  //   Run a thread to dispatch events.
53
 
  //
54
 
  // = DESCRIPTION
55
 
  //   Use the ACE_Task_Base class.
56
 
  //
57
 
 
58
 
public:
59
 
  AdminProperties_Task (void);
60
 
  // Constructor.
61
 
 
62
 
  /// Init this object.
63
 
  void init (TAO_Notify_Tests_StructuredPushSupplier *supplier, AdminProperties* client);
64
 
 
65
 
  virtual int init (int argc, ACE_TCHAR *argv []);
66
 
 
67
 
  virtual int svc (void);
68
 
  // The thread entry point.
69
 
 
70
 
private:
71
 
  /// Supplier
72
 
  TAO_Notify_Tests_StructuredPushSupplier *supplier_;
73
 
 
74
 
  /// Client Object.
75
 
  AdminProperties* client_;
76
 
};
77
 
 
78
 
/***************************************************************************/
79
 
 
80
 
class AdminProperties : public Notify_Test_Client
81
 
{
82
 
  // = TITLE
83
 
  //   AdminProperties
84
 
  //
85
 
  // = DESCRIPTION
86
 
  //   Test for Notify EC properties -
87
 
  //   max_queue_length
88
 
  //   max_consumers
89
 
  //   max_suppliers
90
 
  //   reject_new_events
91
 
  //
92
 
 
93
 
  friend class AdminProperties_StructuredPushConsumer;
94
 
  friend class AdminProperties_Task;
95
 
 
96
 
public:
97
 
  AdminProperties (void);
98
 
  ~AdminProperties (void);
99
 
 
100
 
  int parse_args (int argc,
101
 
                  char *argv[]) ;
102
 
 
103
 
  int init (int argc,
104
 
            char *argv []
105
 
            ACE_ENV_ARG_DECL);
106
 
  // Initialization.
107
 
 
108
 
  void run_test (ACE_ENV_SINGLE_ARG_DECL);
109
 
  // Run the test.
110
 
 
111
 
protected:
112
 
  void create_suppliers (ACE_ENV_SINGLE_ARG_DECL);
113
 
  void create_consumers (ACE_ENV_SINGLE_ARG_DECL);
114
 
 
115
 
  /// Test MaxSuppliers and MaxConsumers
116
 
  void test_max_clients (ACE_ENV_SINGLE_ARG_DECL);
117
 
 
118
 
  /// Test MaxQueueLength properties
119
 
  void test_max_queue_length (ACE_ENV_SINGLE_ARG_DECL);
120
 
 
121
 
  // Data Members
122
 
  CosNotifyChannelAdmin::EventChannel_var ec_;
123
 
  // The one channel that we create using the factory.
124
 
 
125
 
  CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin_;
126
 
  // The consumer admin used by consumers.
127
 
 
128
 
  CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin_;
129
 
  // The supplier admin used by suppliers.
130
 
 
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.
136
 
 
137
 
  /// Consumer Delay.
138
 
  ACE_Time_Value consumer_delay_;
139
 
 
140
 
  /// Inital delay.
141
 
  ACE_Time_Value initial_delay_;
142
 
 
143
 
  /// Number of consumers to connect to check MaxConsumers property.
144
 
  CORBA::Long consumers_;
145
 
 
146
 
  /// Number of suppliers to connect to check MaxSuppliers property.
147
 
  CORBA::Long suppliers_;
148
 
 
149
 
  CORBA::Long event_count_;
150
 
  // Number of events to send to the channel.
151
 
 
152
 
  /// Count of consumers successfully connect to the EC.
153
 
  int suppliers_connected_count_;
154
 
 
155
 
  /// Count of consumers successfully connect to the EC.
156
 
  int consumers_connected_count_;
157
 
 
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_;
161
 
};
162
 
 
163
 
#endif /* ADMINPROPERTIES */