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

« back to all changes in this revision

Viewing changes to TAO/orbsvcs/orbsvcs/Notify/EventChannelFactory.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
 
// EventChannelFactory.cpp,v 1.8 2003/07/06 21:41:58 pradeep Exp
2
 
 
3
 
#include "EventChannelFactory.h"
4
 
 
5
 
#if ! defined (__ACE_INLINE__)
6
 
#include "EventChannelFactory.inl"
7
 
#endif /* __ACE_INLINE__ */
8
 
 
9
 
ACE_RCSID(Notify, TAO_Notify_EventChannelFactory, "EventChannelFactory.cpp,v 1.8 2003/07/06 21:41:58 pradeep Exp")
10
 
 
11
 
#include "ace/Dynamic_Service.h"
12
 
#include "Properties.h"
13
 
#include "Factory.h"
14
 
#include "Builder.h"
15
 
#include "EventChannel.h"
16
 
#include "Container_T.h"
17
 
#include "Find_Worker_T.h"
18
 
#include "Seq_Worker_T.h"
19
 
 
20
 
typedef TAO_Notify_Find_Worker_T<TAO_Notify_EventChannel
21
 
                             , CosNotifyChannelAdmin::EventChannel
22
 
                             , CosNotifyChannelAdmin::EventChannel_ptr
23
 
                             , CosNotifyChannelAdmin::ChannelNotFound>
24
 
TAO_Notify_EventChannel_Find_Worker;
25
 
 
26
 
typedef TAO_Notify_Seq_Worker_T<TAO_Notify_EventChannel> TAO_Notify_EventChannel_Seq_Worker;
27
 
 
28
 
TAO_Notify_EventChannelFactory::TAO_Notify_EventChannelFactory (void)
29
 
  :ec_container_ (0)
30
 
{
31
 
}
32
 
 
33
 
TAO_Notify_EventChannelFactory::~TAO_Notify_EventChannelFactory ()
34
 
{
35
 
}
36
 
 
37
 
void
38
 
TAO_Notify_EventChannelFactory::destroy (ACE_ENV_SINGLE_ARG_DECL)
39
 
  ACE_THROW_SPEC ((
40
 
                   CORBA::SystemException
41
 
                   ))
42
 
{
43
 
  if (this->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER) == 1)
44
 
    return;
45
 
 
46
 
  TAO_Notify_Properties* properties = TAO_Notify_PROPERTIES::instance();
47
 
 
48
 
  delete this->ec_container_;
49
 
 
50
 
  // Shutdown the ORB.
51
 
  CORBA::ORB_var orb = properties->orb ();
52
 
  orb->shutdown ();
53
 
 
54
 
  // Reset references to CORBA objects.
55
 
  properties->orb (CORBA::ORB::_nil ());
56
 
  properties->default_poa (PortableServer::POA::_nil ());
57
 
}
58
 
 
59
 
void
60
 
TAO_Notify_EventChannelFactory::init (PortableServer::POA_ptr poa ACE_ENV_ARG_DECL)
61
 
{
62
 
  this->default_filter_factory_ =
63
 
    TAO_Notify_PROPERTIES::instance()->builder()->build_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
64
 
  ACE_CHECK;
65
 
 
66
 
  // Init ec_container_
67
 
  ACE_NEW_THROW_EX (this->ec_container_,
68
 
                    TAO_Notify_EventChannel_Container (),
69
 
                    CORBA::INTERNAL ());
70
 
  ACE_CHECK;
71
 
 
72
 
  this->ec_container_->init (ACE_ENV_SINGLE_ARG_PARAMETER);
73
 
  ACE_CHECK;
74
 
 
75
 
  TAO_Notify_POA_Helper* object_poa = 0;
76
 
 
77
 
  // Bootstrap initial Object POA
78
 
  ACE_NEW_THROW_EX (object_poa,
79
 
                    TAO_Notify_POA_Helper (),
80
 
                    CORBA::NO_MEMORY ());
81
 
  ACE_CHECK;
82
 
 
83
 
  auto_ptr<TAO_Notify_POA_Helper> auto_object_poa (object_poa);
84
 
 
85
 
  object_poa->init (poa ACE_ENV_ARG_PARAMETER);
86
 
  ACE_CHECK;
87
 
 
88
 
  // release auto_ref.
89
 
  auto_object_poa.release ();
90
 
 
91
 
  this->object_poa_own (object_poa);
92
 
 
93
 
  // We are also activated in the same Object POA.
94
 
  this->poa_ = this->object_poa_;
95
 
 
96
 
  // Make the Proxys acivate in this same POA.
97
 
  this->proxy_poa_ = this->object_poa_;
98
 
}
99
 
 
100
 
void
101
 
TAO_Notify_EventChannelFactory::_add_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
102
 
{
103
 
  this->_incr_refcnt ();
104
 
}
105
 
 
106
 
void
107
 
TAO_Notify_EventChannelFactory::_remove_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
108
 
{
109
 
  this->_decr_refcnt ();
110
 
}
111
 
 
112
 
void
113
 
TAO_Notify_EventChannelFactory::release (void)
114
 
{
115
 
  delete this;
116
 
  //@@ inform factory
117
 
}
118
 
 
119
 
void
120
 
TAO_Notify_EventChannelFactory::remove (TAO_Notify_EventChannel* event_channel ACE_ENV_ARG_DECL)
121
 
{
122
 
  this->ec_container_->remove (event_channel ACE_ENV_ARG_PARAMETER);
123
 
  ACE_CHECK;
124
 
}
125
 
 
126
 
int
127
 
TAO_Notify_EventChannelFactory::shutdown (ACE_ENV_SINGLE_ARG_DECL)
128
 
{
129
 
  if (TAO_Notify_Object::shutdown (ACE_ENV_SINGLE_ARG_PARAMETER) == 1)
130
 
    return 1;
131
 
 
132
 
  this->ec_container_->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
133
 
  ACE_CHECK_RETURN (1);
134
 
 
135
 
  return 0;
136
 
}
137
 
 
138
 
CosNotifyFilter::FilterFactory_ptr
139
 
TAO_Notify_EventChannelFactory::get_default_filter_factory (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
140
 
{
141
 
  return CosNotifyFilter::FilterFactory::_duplicate (this->default_filter_factory_.in ());
142
 
}
143
 
 
144
 
::CosNotifyChannelAdmin::EventChannel_ptr TAO_Notify_EventChannelFactory::create_channel (
145
 
    const CosNotification::QoSProperties & initial_qos,
146
 
    const CosNotification::AdminProperties & initial_admin,
147
 
    CosNotifyChannelAdmin::ChannelID_out id ACE_ENV_ARG_DECL
148
 
  )
149
 
  ACE_THROW_SPEC ((
150
 
                   CORBA::SystemException
151
 
                   , CosNotification::UnsupportedQoS
152
 
                   , CosNotification::UnsupportedAdmin
153
 
                   ))
154
 
{
155
 
  return TAO_Notify_PROPERTIES::instance()->builder()->build_event_channel (this
156
 
                                                                        , initial_qos
157
 
                                                                        , initial_admin
158
 
                                                                        , id
159
 
                                                                        ACE_ENV_ARG_PARAMETER);
160
 
}
161
 
 
162
 
CosNotifyChannelAdmin::ChannelIDSeq*
163
 
TAO_Notify_EventChannelFactory::get_all_channels (ACE_ENV_SINGLE_ARG_DECL)
164
 
  ACE_THROW_SPEC ((
165
 
    CORBA::SystemException
166
 
  ))
167
 
{
168
 
  TAO_Notify_EventChannel_Seq_Worker seq_worker;
169
 
 
170
 
  return seq_worker.create (*this->ec_container_ ACE_ENV_ARG_PARAMETER);
171
 
}
172
 
 
173
 
CosNotifyChannelAdmin::EventChannel_ptr
174
 
TAO_Notify_EventChannelFactory::get_event_channel (CosNotifyChannelAdmin::ChannelID id ACE_ENV_ARG_DECL)
175
 
  ACE_THROW_SPEC ((
176
 
                   CORBA::SystemException
177
 
                   , CosNotifyChannelAdmin::ChannelNotFound
178
 
                   ))
179
 
{
180
 
  TAO_Notify_EventChannel_Find_Worker find_worker;
181
 
 
182
 
  return find_worker.resolve (id, *this->ec_container_ ACE_ENV_ARG_PARAMETER);
183
 
}
184
 
 
185
 
#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
186
 
 
187
 
template class TAO_Notify_Find_Worker_T<TAO_Notify_EventChannel
188
 
                              , CosNotifyChannelAdmin::EventChannel
189
 
                              , CosNotifyChannelAdmin::EventChannel_ptr
190
 
                              , CosNotifyChannelAdmin::ChannelNotFound>;
191
 
template class TAO_Notify_Seq_Worker_T<TAO_Notify_EventChannel>;
192
 
 
193
 
template class TAO_Notify_Container_T <TAO_Notify_EventChannel>;
194
 
 
195
 
template class TAO_ESF_Shutdown_Proxy<TAO_Notify_EventChannel>;
196
 
 
197
 
#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
198
 
#pragma instantiate TAO_Notify_Find_Worker_T<TAO_Notify_EventChannel
199
 
                              , CosNotifyChannelAdmin::EventChannel
200
 
                              , CosNotifyChannelAdmin::EventChannel_ptr
201
 
                              , CosNotifyChannelAdmin::ChannelNotFound>
202
 
#pragma instantiate TAO_Notify_Seq_Worker_T<TAO_Notify_EventChannel>
203
 
 
204
 
 
205
 
#pragma instantiate TAO_Notify_Container_T <TAO_Notify_EventChannel>
206
 
 
207
 
#pragma instantiate TAO_ESF_Shutdown_Proxy<TAO_Notify_EventChannel>;
208
 
 
209
 
#endif /*ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */