1
// EventChannelFactory.cpp,v 1.8 2003/07/06 21:41:58 pradeep Exp
3
#include "EventChannelFactory.h"
5
#if ! defined (__ACE_INLINE__)
6
#include "EventChannelFactory.inl"
7
#endif /* __ACE_INLINE__ */
9
ACE_RCSID(Notify, TAO_Notify_EventChannelFactory, "EventChannelFactory.cpp,v 1.8 2003/07/06 21:41:58 pradeep Exp")
11
#include "ace/Dynamic_Service.h"
12
#include "Properties.h"
15
#include "EventChannel.h"
16
#include "Container_T.h"
17
#include "Find_Worker_T.h"
18
#include "Seq_Worker_T.h"
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;
26
typedef TAO_Notify_Seq_Worker_T<TAO_Notify_EventChannel> TAO_Notify_EventChannel_Seq_Worker;
28
TAO_Notify_EventChannelFactory::TAO_Notify_EventChannelFactory (void)
33
TAO_Notify_EventChannelFactory::~TAO_Notify_EventChannelFactory ()
38
TAO_Notify_EventChannelFactory::destroy (ACE_ENV_SINGLE_ARG_DECL)
40
CORBA::SystemException
43
if (this->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER) == 1)
46
TAO_Notify_Properties* properties = TAO_Notify_PROPERTIES::instance();
48
delete this->ec_container_;
51
CORBA::ORB_var orb = properties->orb ();
54
// Reset references to CORBA objects.
55
properties->orb (CORBA::ORB::_nil ());
56
properties->default_poa (PortableServer::POA::_nil ());
60
TAO_Notify_EventChannelFactory::init (PortableServer::POA_ptr poa ACE_ENV_ARG_DECL)
62
this->default_filter_factory_ =
63
TAO_Notify_PROPERTIES::instance()->builder()->build_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
67
ACE_NEW_THROW_EX (this->ec_container_,
68
TAO_Notify_EventChannel_Container (),
72
this->ec_container_->init (ACE_ENV_SINGLE_ARG_PARAMETER);
75
TAO_Notify_POA_Helper* object_poa = 0;
77
// Bootstrap initial Object POA
78
ACE_NEW_THROW_EX (object_poa,
79
TAO_Notify_POA_Helper (),
83
auto_ptr<TAO_Notify_POA_Helper> auto_object_poa (object_poa);
85
object_poa->init (poa ACE_ENV_ARG_PARAMETER);
89
auto_object_poa.release ();
91
this->object_poa_own (object_poa);
93
// We are also activated in the same Object POA.
94
this->poa_ = this->object_poa_;
96
// Make the Proxys acivate in this same POA.
97
this->proxy_poa_ = this->object_poa_;
101
TAO_Notify_EventChannelFactory::_add_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
103
this->_incr_refcnt ();
107
TAO_Notify_EventChannelFactory::_remove_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
109
this->_decr_refcnt ();
113
TAO_Notify_EventChannelFactory::release (void)
120
TAO_Notify_EventChannelFactory::remove (TAO_Notify_EventChannel* event_channel ACE_ENV_ARG_DECL)
122
this->ec_container_->remove (event_channel ACE_ENV_ARG_PARAMETER);
127
TAO_Notify_EventChannelFactory::shutdown (ACE_ENV_SINGLE_ARG_DECL)
129
if (TAO_Notify_Object::shutdown (ACE_ENV_SINGLE_ARG_PARAMETER) == 1)
132
this->ec_container_->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
133
ACE_CHECK_RETURN (1);
138
CosNotifyFilter::FilterFactory_ptr
139
TAO_Notify_EventChannelFactory::get_default_filter_factory (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
141
return CosNotifyFilter::FilterFactory::_duplicate (this->default_filter_factory_.in ());
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
150
CORBA::SystemException
151
, CosNotification::UnsupportedQoS
152
, CosNotification::UnsupportedAdmin
155
return TAO_Notify_PROPERTIES::instance()->builder()->build_event_channel (this
159
ACE_ENV_ARG_PARAMETER);
162
CosNotifyChannelAdmin::ChannelIDSeq*
163
TAO_Notify_EventChannelFactory::get_all_channels (ACE_ENV_SINGLE_ARG_DECL)
165
CORBA::SystemException
168
TAO_Notify_EventChannel_Seq_Worker seq_worker;
170
return seq_worker.create (*this->ec_container_ ACE_ENV_ARG_PARAMETER);
173
CosNotifyChannelAdmin::EventChannel_ptr
174
TAO_Notify_EventChannelFactory::get_event_channel (CosNotifyChannelAdmin::ChannelID id ACE_ENV_ARG_DECL)
176
CORBA::SystemException
177
, CosNotifyChannelAdmin::ChannelNotFound
180
TAO_Notify_EventChannel_Find_Worker find_worker;
182
return find_worker.resolve (id, *this->ec_container_ ACE_ENV_ARG_PARAMETER);
185
#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
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>;
193
template class TAO_Notify_Container_T <TAO_Notify_EventChannel>;
195
template class TAO_ESF_Shutdown_Proxy<TAO_Notify_EventChannel>;
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>
205
#pragma instantiate TAO_Notify_Container_T <TAO_Notify_EventChannel>
207
#pragma instantiate TAO_ESF_Shutdown_Proxy<TAO_Notify_EventChannel>;
209
#endif /*ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */