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

« back to all changes in this revision

Viewing changes to TAO/orbsvcs/orbsvcs/CosEvent/CEC_EventChannel.cpp

  • 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
 
// CEC_EventChannel.cpp,v 1.6 2003/06/26 17:34:25 jwillemsen Exp
2
 
 
3
 
#include "CEC_EventChannel.h"
4
 
#include "CEC_Dispatching.h"
5
 
#include "CEC_Pulling_Strategy.h"
6
 
#include "CEC_ConsumerAdmin.h"
7
 
#include "CEC_SupplierAdmin.h"
8
 
#include "CEC_ConsumerControl.h"
9
 
#include "CEC_SupplierControl.h"
10
 
#include "ace/Dynamic_Service.h"
11
 
 
12
 
#if ! defined (__ACE_INLINE__)
13
 
#include "CEC_EventChannel.i"
14
 
#endif /* __ACE_INLINE__ */
15
 
 
16
 
ACE_RCSID(CosEvent, CEC_EventChannel, "CEC_EventChannel.cpp,v 1.6 2003/06/26 17:34:25 jwillemsen Exp")
17
 
 
18
 
TAO_CEC_EventChannel::
19
 
TAO_CEC_EventChannel (const TAO_CEC_EventChannel_Attributes& attr,
20
 
                      TAO_CEC_Factory* factory,
21
 
                      int own_factory)
22
 
  : supplier_poa_ (PortableServer::POA::_duplicate (attr.supplier_poa)),
23
 
    consumer_poa_ (PortableServer::POA::_duplicate (attr.consumer_poa)),
24
 
    factory_ (factory),
25
 
    own_factory_ (own_factory),
26
 
    consumer_reconnect_ (attr.consumer_reconnect),
27
 
    supplier_reconnect_ (attr.supplier_reconnect),
28
 
    disconnect_callbacks_ (attr.disconnect_callbacks)
29
 
{
30
 
  if (this->factory_ == 0)
31
 
    {
32
 
      this->factory_ =
33
 
        ACE_Dynamic_Service<TAO_CEC_Factory>::instance ("CEC_Factory");
34
 
      this->own_factory_ = 0;
35
 
      ACE_ASSERT (this->factory_ != 0);
36
 
    }
37
 
 
38
 
  this->dispatching_ =
39
 
    this->factory_->create_dispatching (this);
40
 
  this->pulling_strategy_ =
41
 
    this->factory_->create_pulling_strategy (this);
42
 
  this->consumer_admin_ =
43
 
    this->factory_->create_consumer_admin (this);
44
 
  this->supplier_admin_ =
45
 
    this->factory_->create_supplier_admin (this);
46
 
  this->consumer_control_ =
47
 
    this->factory_->create_consumer_control (this);
48
 
  this->supplier_control_ =
49
 
    this->factory_->create_supplier_control (this);
50
 
}
51
 
 
52
 
TAO_CEC_EventChannel::~TAO_CEC_EventChannel (void)
53
 
{
54
 
  this->factory_->destroy_dispatching (this->dispatching_);
55
 
  this->dispatching_ = 0;
56
 
 
57
 
  this->factory_->destroy_pulling_strategy (this->pulling_strategy_);
58
 
  this->pulling_strategy_ = 0;
59
 
 
60
 
  this->factory_->destroy_consumer_admin (this->consumer_admin_);
61
 
  this->consumer_admin_ = 0;
62
 
  this->factory_->destroy_supplier_admin (this->supplier_admin_);
63
 
  this->supplier_admin_ = 0;
64
 
 
65
 
  this->factory_->destroy_consumer_control (this->consumer_control_);
66
 
  this->consumer_control_ = 0;
67
 
  this->factory_->destroy_supplier_control (this->supplier_control_);
68
 
  this->supplier_control_ = 0;
69
 
 
70
 
  if (this->own_factory_)
71
 
    delete this->factory_;
72
 
}
73
 
 
74
 
void
75
 
TAO_CEC_EventChannel::activate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
76
 
{
77
 
  this->dispatching_->activate ();
78
 
  this->pulling_strategy_->activate ();
79
 
  this->consumer_control_->activate ();
80
 
  this->supplier_control_->activate ();
81
 
}
82
 
 
83
 
void
84
 
TAO_CEC_EventChannel::shutdown (ACE_ENV_SINGLE_ARG_DECL)
85
 
{
86
 
  this->dispatching_->shutdown ();
87
 
  this->pulling_strategy_->shutdown ();
88
 
  this->supplier_control_->shutdown ();
89
 
  this->consumer_control_->shutdown ();
90
 
 
91
 
  PortableServer::POA_var consumer_poa =
92
 
    this->consumer_admin_->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
93
 
  ACE_CHECK;
94
 
  PortableServer::ObjectId_var consumer_id =
95
 
    consumer_poa->servant_to_id (this->consumer_admin_ ACE_ENV_ARG_PARAMETER);
96
 
  ACE_CHECK;
97
 
  consumer_poa->deactivate_object (consumer_id.in () ACE_ENV_ARG_PARAMETER);
98
 
  ACE_CHECK;
99
 
 
100
 
  PortableServer::POA_var supplier_poa =
101
 
    this->supplier_admin_->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
102
 
  ACE_CHECK;
103
 
  PortableServer::ObjectId_var supplier_id =
104
 
    supplier_poa->servant_to_id (this->supplier_admin_ ACE_ENV_ARG_PARAMETER);
105
 
  ACE_CHECK;
106
 
  supplier_poa->deactivate_object (supplier_id.in () ACE_ENV_ARG_PARAMETER);
107
 
  ACE_CHECK;
108
 
 
109
 
  this->supplier_admin_->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
110
 
 
111
 
  this->consumer_admin_->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
112
 
}
113
 
 
114
 
void
115
 
TAO_CEC_EventChannel::connected (TAO_CEC_ProxyPushConsumer* consumer
116
 
                                 ACE_ENV_ARG_DECL)
117
 
{
118
 
  this->supplier_admin_->connected (consumer ACE_ENV_ARG_PARAMETER);
119
 
  ACE_CHECK;
120
 
}
121
 
 
122
 
void
123
 
TAO_CEC_EventChannel::reconnected (TAO_CEC_ProxyPushConsumer* consumer
124
 
                                   ACE_ENV_ARG_DECL)
125
 
{
126
 
  this->supplier_admin_->reconnected (consumer ACE_ENV_ARG_PARAMETER);
127
 
  ACE_CHECK;
128
 
}
129
 
 
130
 
void
131
 
TAO_CEC_EventChannel::disconnected (TAO_CEC_ProxyPushConsumer* consumer
132
 
                                    ACE_ENV_ARG_DECL)
133
 
{
134
 
  this->supplier_admin_->disconnected (consumer ACE_ENV_ARG_PARAMETER);
135
 
  ACE_CHECK;
136
 
}
137
 
 
138
 
void
139
 
TAO_CEC_EventChannel::connected (TAO_CEC_ProxyPullConsumer* consumer
140
 
                                 ACE_ENV_ARG_DECL)
141
 
{
142
 
  this->supplier_admin_->connected (consumer ACE_ENV_ARG_PARAMETER);
143
 
  ACE_CHECK;
144
 
}
145
 
 
146
 
void
147
 
TAO_CEC_EventChannel::reconnected (TAO_CEC_ProxyPullConsumer* consumer
148
 
                                   ACE_ENV_ARG_DECL)
149
 
{
150
 
  this->supplier_admin_->reconnected (consumer ACE_ENV_ARG_PARAMETER);
151
 
  ACE_CHECK;
152
 
}
153
 
 
154
 
void
155
 
TAO_CEC_EventChannel::disconnected (TAO_CEC_ProxyPullConsumer* consumer
156
 
                                    ACE_ENV_ARG_DECL)
157
 
{
158
 
  this->supplier_admin_->disconnected (consumer ACE_ENV_ARG_PARAMETER);
159
 
  ACE_CHECK;
160
 
}
161
 
 
162
 
void
163
 
TAO_CEC_EventChannel::connected (TAO_CEC_ProxyPushSupplier* supplier
164
 
                                 ACE_ENV_ARG_DECL)
165
 
{
166
 
  this->consumer_admin_->connected (supplier ACE_ENV_ARG_PARAMETER);
167
 
  ACE_CHECK;
168
 
}
169
 
 
170
 
void
171
 
TAO_CEC_EventChannel::reconnected (TAO_CEC_ProxyPushSupplier* supplier
172
 
                                   ACE_ENV_ARG_DECL)
173
 
{
174
 
  this->consumer_admin_->reconnected (supplier ACE_ENV_ARG_PARAMETER);
175
 
  ACE_CHECK;
176
 
}
177
 
 
178
 
void
179
 
TAO_CEC_EventChannel::disconnected (TAO_CEC_ProxyPushSupplier* supplier
180
 
                                    ACE_ENV_ARG_DECL)
181
 
{
182
 
  this->consumer_admin_->disconnected (supplier ACE_ENV_ARG_PARAMETER);
183
 
  ACE_CHECK;
184
 
}
185
 
 
186
 
void
187
 
TAO_CEC_EventChannel::connected (TAO_CEC_ProxyPullSupplier* supplier
188
 
                                 ACE_ENV_ARG_DECL)
189
 
{
190
 
  this->consumer_admin_->connected (supplier ACE_ENV_ARG_PARAMETER);
191
 
  ACE_CHECK;
192
 
}
193
 
 
194
 
void
195
 
TAO_CEC_EventChannel::reconnected (TAO_CEC_ProxyPullSupplier* supplier
196
 
                                   ACE_ENV_ARG_DECL)
197
 
{
198
 
  this->consumer_admin_->reconnected (supplier ACE_ENV_ARG_PARAMETER);
199
 
  ACE_CHECK;
200
 
}
201
 
 
202
 
void
203
 
TAO_CEC_EventChannel::disconnected (TAO_CEC_ProxyPullSupplier* supplier
204
 
                                    ACE_ENV_ARG_DECL)
205
 
{
206
 
  this->consumer_admin_->disconnected (supplier ACE_ENV_ARG_PARAMETER);
207
 
  ACE_CHECK;
208
 
}
209
 
 
210
 
CosEventChannelAdmin::ConsumerAdmin_ptr
211
 
TAO_CEC_EventChannel::for_consumers (ACE_ENV_SINGLE_ARG_DECL)
212
 
  ACE_THROW_SPEC ((CORBA::SystemException))
213
 
{
214
 
  return this->consumer_admin_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
215
 
}
216
 
 
217
 
CosEventChannelAdmin::SupplierAdmin_ptr
218
 
TAO_CEC_EventChannel::for_suppliers (ACE_ENV_SINGLE_ARG_DECL)
219
 
  ACE_THROW_SPEC ((CORBA::SystemException))
220
 
{
221
 
  return this->supplier_admin_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
222
 
}
223
 
 
224
 
void
225
 
TAO_CEC_EventChannel::destroy (ACE_ENV_SINGLE_ARG_DECL)
226
 
  ACE_THROW_SPEC ((CORBA::SystemException))
227
 
{
228
 
  this->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
229
 
}