TAO_Notify_EventChannelFactory Class Reference

Implementation of CosNotifyChannelAdmin::EventChannelFactory. More...

#include <EventChannelFactory.h>

Inheritance diagram for TAO_Notify_EventChannelFactory:

Inheritance graph
[legend]
Collaboration diagram for TAO_Notify_EventChannelFactory:

Collaboration graph
[legend]
List of all members.

Public Types

typedef TAO_Notify_Refcountable_Guard_T<
TAO_Notify_EventChannelFactory
Ptr

Public Member Functions

 TAO_Notify_EventChannelFactory (void)
 Constructor.
void init (PortableServer::POA_ptr poa)
 Init the factory.
virtual ~TAO_Notify_EventChannelFactory ()
 Destructor.
virtual void _add_ref (void)
 = ServantBase Methods
virtual void _remove_ref (void)
virtual void remove (TAO_Notify_EventChannel *channel)
 Remove channel from the <ec_container_>.
virtual CosNotifyChannelAdmin::EventChannel_ptr create_named_channel (const CosNotification::QoSProperties &initial_qos, const CosNotification::AdminProperties &initial_admin, CosNotifyChannelAdmin::ChannelID_out id, const char *name)
void load_topology (void)
void set_topology_factory (TAO_Notify::Topology_Factory *sf)
virtual bool is_persistent (void) const
 Should this object be saved?
virtual void save_persistent (TAO_Notify::Topology_Saver &saver)
virtual bool change_to_parent (void)
 Send change to parent.
virtual TAO_Notify::Topology_Objectload_child (const ACE_CString &type, CORBA::Long id, const TAO_Notify::NVPList &attrs)
 Create a child of the appropriate type and return it.
CosNotifyChannelAdmin::EventChannelFactory_ptr activate_self (void)
virtual void reconnect (void)
bool handle_change (void)
 Handle change notifications.
void load_event_persistence (void)
virtual void save_topology (void)
TAO_Notify_ProxyConsumerfind_proxy_consumer (TAO_Notify::IdVec &id_path, size_t position)
TAO_Notify_ProxySupplierfind_proxy_supplier (TAO_Notify::IdVec &id_path, size_t position)
TAO_Notify_Objectfollow_id_path (TAO_Notify::IdVec &id_path, size_t position)
virtual TAO_Notify_Object::ID get_id (void) const
 Find the id associated with topology object.

Protected Member Functions

virtual ::CosNotifyChannelAdmin::EventChannel_ptr create_channel (const CosNotification::QoSProperties &initial_qos, const CosNotification::AdminProperties &initial_admin, CosNotifyChannelAdmin::ChannelID_out id)
 = CosNotifyChannelAdmin Methods
virtual ::CosNotifyChannelAdmin::ChannelIDSeqget_all_channels (void)
virtual ::CosNotifyChannelAdmin::EventChannel_ptr get_event_channel (CosNotifyChannelAdmin::ChannelID id)

Private Types

typedef ACE_Unbounded_Set<
TAO_Notify::Routing_Slip_Ptr
Routing_Slip_Set
typedef TAO_Notify_Container_T<
TAO_Notify_EventChannel
TAO_Notify_EventChannel_Container

Private Member Functions

virtual void destroy (void)
 = NotifyExt methods
virtual int shutdown (void)
 shutdown
virtual NotifyExt::ReconnectionRegistry::ReconnectionID register_callback (NotifyExt::ReconnectionCallback_ptr reconnection)
virtual void unregister_callback (NotifyExt::ReconnectionRegistry::ReconnectionID id)
virtual CORBA::Boolean is_alive (void)
TAO_Notify_EventChannel_Containerec_container ()
virtual void release (void)
 Release this object.

Private Attributes

ACE_Auto_Ptr< TAO_Notify_EventChannel_Containerec_container_
 Container for Event Channels.
TAO_SYNCH_MUTEX topology_save_lock_
CosNotifyChannelAdmin::EventChannelFactory_var channel_factory_
short topology_save_seq_
 Change-in-progress detector to avoid duplicates.
TAO_Notify::Topology_Factorytopology_factory_
TAO_Notify::Reconnection_Registry reconnect_registry_
bool loading_topology_
Routing_Slip_Set routing_slip_restart_set_

Friends

class TAO_Notify_Builder

Detailed Description

Implementation of CosNotifyChannelAdmin::EventChannelFactory.

Definition at line 47 of file EventChannelFactory.h.


Member Typedef Documentation

typedef TAO_Notify_Refcountable_Guard_T< TAO_Notify_EventChannelFactory > TAO_Notify_EventChannelFactory::Ptr

Reimplemented from TAO_Notify_Refcountable.

Definition at line 56 of file EventChannelFactory.h.

typedef ACE_Unbounded_Set<TAO_Notify::Routing_Slip_Ptr> TAO_Notify_EventChannelFactory::Routing_Slip_Set [private]

Definition at line 53 of file EventChannelFactory.h.

typedef TAO_Notify_Container_T<TAO_Notify_EventChannel> TAO_Notify_EventChannelFactory::TAO_Notify_EventChannel_Container [private]

Definition at line 151 of file EventChannelFactory.h.


Constructor & Destructor Documentation

TAO_Notify_EventChannelFactory::TAO_Notify_EventChannelFactory ( void   ) 

Constructor.

Definition at line 52 of file EventChannelFactory.cpp.

00053   : topology_save_seq_ (0)
00054   , topology_factory_(0)
00055   , reconnect_registry_(*this)
00056   , loading_topology_ (false)
00057 {
00058 }

TAO_Notify_EventChannelFactory::~TAO_Notify_EventChannelFactory (  )  [virtual]

Destructor.

Definition at line 60 of file EventChannelFactory.cpp.

00061 {
00062 }


Member Function Documentation

void TAO_Notify_EventChannelFactory::_add_ref ( void   )  [virtual]

= ServantBase Methods

Definition at line 122 of file EventChannelFactory.cpp.

References TAO_Notify_Refcountable::_incr_refcnt().

00123 {
00124   this->_incr_refcnt ();
00125 }

void TAO_Notify_EventChannelFactory::_remove_ref ( void   )  [virtual]

Definition at line 128 of file EventChannelFactory.cpp.

References TAO_Notify_Refcountable::_decr_refcnt().

00129 {
00130   this->_decr_refcnt ();
00131 }

CosNotifyChannelAdmin::EventChannelFactory_ptr TAO_Notify_EventChannelFactory::activate_self ( void   ) 

Definition at line 470 of file EventChannelFactory.cpp.

References ACE_DEBUG, ACE_TEXT(), TAO_Notify_Object::activate(), channel_factory_, DEBUG_LEVEL, TAO_Pseudo_Var_T< T >::in(), LM_DEBUG, and reconnect().

Referenced by TAO_Notify_Builder::build_event_channel_factory().

00471 {
00472   CORBA::Object_var obj = this->activate (this);
00473   this->channel_factory_
00474     = CosNotifyChannelAdmin::EventChannelFactory::_narrow (obj.in());
00475 
00476   try
00477   {
00478     if (DEBUG_LEVEL > 9)
00479     {
00480       ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) TAO_Notify_EventChannelFactory::activate_self") ));
00481     }
00482     this->reconnect ();
00483   }
00484   catch (const CORBA::Exception&)
00485   {
00486     // ignore for now
00487   }
00488   return this->channel_factory_._retn();
00489 }

bool TAO_Notify_EventChannelFactory::change_to_parent ( void   )  [virtual]

Send change to parent.

Override this if you don't expect to have a parent (top level of tree) private virtual because this should only be called from send_change()

Returns:
false if save will never happen

Reimplemented from TAO_Notify::Topology_Object.

Definition at line 307 of file EventChannelFactory.cpp.

References ACE_GUARD_THROW_EX, TAO_SYNCH_MUTEX, and topology_save_seq_.

00308 {
00309   bool saving = false;
00310   if (! this->loading_topology_)
00311   {
00312     // A null pointer means that saving of topology is disabled.
00313     if (this->topology_factory_ != 0)
00314     {
00315       saving = true;
00316       // seq is used to check save-in-progress
00317       // if it changes while we're waiting for the lock
00318       // then our change may have already been saved, so
00319       // just return.  Caller will signal change again if necessary.
00320       short seq = this->topology_save_seq_;
00321       ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->topology_save_lock_, CORBA::INTERNAL ());
00322       if (seq == this->topology_save_seq_)
00323       {
00324         auto_ptr<TAO_Notify::Topology_Saver> saver(this->topology_factory_->create_saver());
00325         if (saver.get() != 0)
00326         {
00327           this->save_persistent(*saver);
00328           saver->close ();
00329         }
00330         this->topology_save_seq_ += 1;
00331       }
00332     }
00333   }
00334   return saving;
00335 }

CosNotifyChannelAdmin::EventChannel_ptr TAO_Notify_EventChannelFactory::create_channel ( const CosNotification::QoSProperties initial_qos,
const CosNotification::AdminProperties initial_admin,
CosNotifyChannelAdmin::ChannelID_out  id 
) [protected]

= CosNotifyChannelAdmin Methods

Definition at line 168 of file EventChannelFactory.cpp.

References TAO_Notify_Builder::build_event_channel(), TAO_Notify_Properties::builder(), TAO_Notify_Properties::instance(), and TAO_Notify::Topology_Object::self_change().

Referenced by create_named_channel().

00173 {
00174   CosNotifyChannelAdmin::EventChannel_var ec =
00175     TAO_Notify_PROPERTIES::instance()->builder()->build_event_channel (this
00176                                                                         , initial_qos
00177                                                                         , initial_admin
00178                                                                         , id);
00179   this->self_change ();
00180   return ec._retn ();
00181 }

CosNotifyChannelAdmin::EventChannel_ptr TAO_Notify_EventChannelFactory::create_named_channel ( const CosNotification::QoSProperties initial_qos,
const CosNotification::AdminProperties initial_admin,
CosNotifyChannelAdmin::ChannelID_out  id,
const char *  name 
) [virtual]

This method is called by the Notify_Service when the event channel is automatically created and bound in the name service.

Definition at line 159 of file EventChannelFactory.cpp.

References create_channel().

00164 {
00165   return this->create_channel (initial_qos, initial_admin, id);
00166 }

void TAO_Notify_EventChannelFactory::destroy ( void   )  [private, virtual]

= NotifyExt methods

Definition at line 65 of file EventChannelFactory.cpp.

References CORBA::ORB::_nil(), TAO_Notify_Properties::default_poa(), ec_container_, TAO_Notify_Properties::instance(), and TAO_Notify_Properties::orb().

00066 {
00067   if (this->shutdown () == 1)
00068     return;
00069 
00070   TAO_Notify_Properties* properties = TAO_Notify_PROPERTIES::instance();
00071 
00072   // Reset references to CORBA objects.
00073   properties->orb (CORBA::ORB::_nil ());
00074   properties->default_poa (PortableServer::POA::_nil ());
00075 
00076   ec_container_.reset( 0 );
00077 }

TAO_Notify_EventChannelFactory::TAO_Notify_EventChannel_Container & TAO_Notify_EventChannelFactory::ec_container (  )  [private]

Definition at line 499 of file EventChannelFactory.cpp.

References ACE_ASSERT, and ec_container_.

Referenced by TAO_Notify_Builder::build_event_channel(), init(), reconnect(), remove(), save_persistent(), and shutdown().

00500 {
00501   ACE_ASSERT( this->ec_container_.get() != 0 );
00502   return *ec_container_;
00503 }

TAO_Notify_ProxyConsumer * TAO_Notify_EventChannelFactory::find_proxy_consumer ( TAO_Notify::IdVec id_path,
size_t  position 
)

Definition at line 419 of file EventChannelFactory.cpp.

References TAO_Notify_Find_Worker_T< TYPE, INTERFACE, INTERFACE_PTR, EXCEPTION >::find(), TAO_Notify_EventChannel::find_proxy_consumer(), and ACE_Vector< T, DEFAULT_SIZE >::size().

Referenced by TAO_Notify_Method_Request_Lookup::unmarshal(), and TAO_Notify_Method_Request_Dispatch::unmarshal().

00420 {
00421   TAO_Notify_ProxyConsumer * result = 0;
00422   size_t path_size = id_path.size ();
00423 
00424   // EventChannelFactory only:  The first id is proably for the ECF itself
00425   // if so, silently consume it.
00426   if (position < path_size && id_path[position] == this->id())
00427   {
00428     ++position;
00429   }
00430   if (position < path_size)
00431   {
00432     TAO_Notify_EventChannel_Find_Worker find_worker;
00433 
00434     TAO_Notify_EventChannel * ec = find_worker.find (id_path[position], this->ec_container());
00435     ++position;
00436     if (ec != 0)
00437     {
00438       result = ec->find_proxy_consumer (id_path, position);
00439     }
00440   }
00441   return result;
00442 }

TAO_Notify_ProxySupplier * TAO_Notify_EventChannelFactory::find_proxy_supplier ( TAO_Notify::IdVec id_path,
size_t  position 
)

Definition at line 445 of file EventChannelFactory.cpp.

References TAO_Notify_Find_Worker_T< TYPE, INTERFACE, INTERFACE_PTR, EXCEPTION >::find(), TAO_Notify_EventChannel::find_proxy_supplier(), and ACE_Vector< T, DEFAULT_SIZE >::size().

Referenced by TAO_Notify_Method_Request_Dispatch::unmarshal().

00446 {
00447   TAO_Notify_ProxySupplier * result = 0;
00448   size_t path_size = id_path.size ();
00449 
00450   // EventChannelFactory only:  The first id is proably for the ECF itself
00451   // if so, silently consume it.
00452   if (position < path_size && id_path[position] == this->id())
00453   {
00454     ++position;
00455   }
00456   if (position < path_size)
00457   {
00458     TAO_Notify_EventChannel_Find_Worker find_worker;
00459     TAO_Notify_EventChannel * ec = find_worker.find (id_path[position], this->ec_container());
00460     ++position;
00461     if (ec != 0)
00462     {
00463       result = ec->find_proxy_supplier (id_path, position);
00464     }
00465   }
00466   return result;
00467 }

TAO_Notify_Object* TAO_Notify_EventChannelFactory::follow_id_path ( TAO_Notify::IdVec id_path,
size_t  position 
)

CosNotifyChannelAdmin::ChannelIDSeq * TAO_Notify_EventChannelFactory::get_all_channels ( void   )  [protected]

Definition at line 184 of file EventChannelFactory.cpp.

References TAO_Notify_Seq_Worker_T< TYPE >::create().

00185 {
00186   TAO_Notify_EventChannel_Seq_Worker seq_worker;
00187 
00188   return seq_worker.create (this->ec_container());
00189 }

CosNotifyChannelAdmin::EventChannel_ptr TAO_Notify_EventChannelFactory::get_event_channel ( CosNotifyChannelAdmin::ChannelID  id  )  [protected]

Definition at line 192 of file EventChannelFactory.cpp.

References TAO_Notify_Find_Worker_T< TYPE, INTERFACE, INTERFACE_PTR, EXCEPTION >::resolve().

00193 {
00194   TAO_Notify_EventChannel_Find_Worker find_worker;
00195 
00196   return find_worker.resolve (id, this->ec_container());
00197 }

TAO_Notify_Object::ID TAO_Notify_EventChannelFactory::get_id ( void   )  const [virtual]

Find the id associated with topology object.

A bit of a hack because id is unknown to Topology_Object the get_id returns the same thing as id -- we just need someone to find it for us.

Reimplemented from TAO_Notify::Topology_Object.

Definition at line 493 of file EventChannelFactory.cpp.

References TAO_Notify_Object::id().

00494 {
00495   return id();
00496 }

bool TAO_Notify_EventChannelFactory::handle_change ( void   ) 

Handle change notifications.

void TAO_Notify_EventChannelFactory::init ( PortableServer::POA_ptr  poa  ) 

Init the factory.

Definition at line 80 of file EventChannelFactory.cpp.

References ACE_ASSERT, ACE_NEW_THROW_EX, TAO_Notify_Object::adopt_poa(), ACE_String_Base< CHAR >::c_str(), ec_container(), ec_container_, TAO_Notify_POA_Helper::get_unique_id(), TAO_Notify_POA_Helper::init(), TAO_Notify_Container_T< TYPE >::init(), TAO_Notify_POA_Helper::init_persistent(), load_event_persistence(), load_topology(), TAO_Notify_Object::object_poa(), ACE_Auto_Basic_Ptr< X >::release(), and topology_factory_.

Referenced by TAO_Notify_Builder::build_event_channel_factory().

00081 {
00082   ACE_ASSERT (this->ec_container_.get() == 0);
00083 
00084   // Init ec_container_
00085   TAO_Notify_EventChannel_Container* ecc = 0;
00086   ACE_NEW_THROW_EX (ecc,
00087                     TAO_Notify_EventChannel_Container (),
00088                     CORBA::INTERNAL ());
00089   this->ec_container_.reset( ecc );
00090 
00091   this->ec_container().init ();
00092 
00093   TAO_Notify_POA_Helper* object_poa = 0;
00094 
00095   // Bootstrap initial Object POA
00096   ACE_NEW_THROW_EX (object_poa,
00097                     TAO_Notify_POA_Helper (),
00098                     CORBA::NO_MEMORY ());
00099 
00100   ACE_Auto_Ptr<TAO_Notify_POA_Helper> auto_object_poa (object_poa);
00101 
00102   ACE_CString poa_name = object_poa->get_unique_id ();
00103 #if defined (CORBA_E_MICRO)
00104   object_poa->init (poa, poa_name.c_str ());
00105 #else
00106   object_poa->init_persistent (poa, poa_name.c_str ());
00107 #endif /* CORBA_E_MICRO */
00108 
00109   this->adopt_poa (auto_object_poa.release ());
00110 
00111   // Note topology factory is configured separately from the "builder" mediated
00112   // objects since it is independant of the "style" of Notification Service.
00113   this->topology_factory_ =
00114     ACE_Dynamic_Service <TAO_Notify::Topology_Factory>::instance ("Topology_Factory");
00115 
00116   this->load_topology ();
00117 
00118   this->load_event_persistence ();
00119 }

CORBA::Boolean TAO_Notify_EventChannelFactory::is_alive ( void   )  [private, virtual]

Definition at line 407 of file EventChannelFactory.cpp.

00408 {
00409   return CORBA::Boolean (1);
00410 }

bool TAO_Notify_EventChannelFactory::is_persistent ( void   )  const [virtual]

Should this object be saved?

This is a way for send_change() and save_persistent() to find out if this object has a persistent QoS connection property.

Returns:
true (default) if object should be saved.

Reimplemented from TAO_Notify::Topology_Object.

Definition at line 232 of file EventChannelFactory.cpp.

00233 {
00234   return true;
00235 }

TAO_Notify::Topology_Object * TAO_Notify_EventChannelFactory::load_child ( const ACE_CString type,
CORBA::Long  id,
const TAO_Notify::NVPList attrs 
) [virtual]

Create a child of the appropriate type and return it.

Use "type" as passed in to determine what kind of child (supporting the Topology_Object interface) to create and return. Inform it of its new ID.

Reimplemented from TAO_Notify::Topology_Object.

Definition at line 338 of file EventChannelFactory.cpp.

References ACE_DEBUG, ACE_TEXT(), TAO_Notify_Builder::build_event_channel(), TAO_Notify_Properties::builder(), DEBUG_LEVEL, TAO_Notify_Properties::instance(), LM_DEBUG, TAO_Notify_EventChannel::load_attrs(), reconnect_registry_, and TAO_Notify::REGISTRY_TYPE.

00342 {
00343   // ignore anything but our valid children (ie channel)
00344   TAO_Notify::Topology_Object * result = this;
00345   if (type == "channel")
00346   {
00347     if (DEBUG_LEVEL) ACE_DEBUG ((LM_DEBUG,
00348       ACE_TEXT ("(%P|%t) EventChannelFactory reload channel %d\n")
00349       , static_cast<int> (id)
00350       ));
00351 
00352     TAO_Notify_Builder* bld = TAO_Notify_PROPERTIES::instance()->builder();
00353     TAO_Notify_EventChannel * ec = bld->build_event_channel(
00354         this ,
00355         id);
00356 
00357     ec->load_attrs (attrs);
00358 
00359     result = ec;
00360   }
00361   else if (type == TAO_Notify::REGISTRY_TYPE)
00362   {
00363     result = & this->reconnect_registry_;
00364   }
00365   return result;
00366 }

void TAO_Notify_EventChannelFactory::load_event_persistence ( void   ) 

Definition at line 264 of file EventChannelFactory.cpp.

References ACE_DEBUG, ACE_ERROR, ACE_TEXT(), TAO_Notify::Routing_Slip::create(), TAO_Notify::Event_Persistence_Factory::first_reload_manager(), TAO_Notify::Event_Persistence_Strategy::get_factory(), LM_DEBUG, and LM_ERROR.

Referenced by init().

00265 {
00266   TAO_Notify::Event_Persistence_Strategy * strategy =
00267     ACE_Dynamic_Service <TAO_Notify::Event_Persistence_Strategy>::instance ("Event_Persistence");
00268   if (strategy != 0)
00269   {
00270     if (this->topology_factory_ != 0)
00271     {
00272       TAO_Notify::Event_Persistence_Factory * factory = strategy->get_factory ();
00273       if (factory != 0)
00274       {
00275         for (
00276           TAO_Notify::Routing_Slip_Persistence_Manager * rspm = factory->first_reload_manager();
00277           rspm != 0;
00278           rspm = rspm->load_next ())
00279         {
00280           TAO_Notify::Routing_Slip_Ptr routing_slip = TAO_Notify::Routing_Slip::create (*this, rspm);
00281           if (!routing_slip.null ())
00282           {
00283             this->routing_slip_restart_set_.insert (routing_slip);
00284           }
00285           else
00286           {
00287             //@@todo: tell the rspm it's an orphan, but we can't during reload
00288             // we need collect these and come back later to remove them
00289             ACE_DEBUG ((LM_DEBUG,
00290               ACE_TEXT ("(%P|%t) Reload persistent event failed.\n")
00291               ));
00292           }
00293         }
00294       }
00295     }
00296     else
00297     {
00298       ACE_ERROR ((LM_ERROR,
00299         ACE_TEXT ("(%P|%t) Notify Service: Configuration error.  Event Persistence requires Topology Persistence.\n")
00300         ));
00301       throw CORBA::PERSIST_STORE();
00302     }
00303   }
00304 }

void TAO_Notify_EventChannelFactory::load_topology ( void   ) 

Use the registered Topology_Factory to create a loader, and load the topology. If no Topology_Factory is registered then nothing will be loaded.

Definition at line 212 of file EventChannelFactory.cpp.

References ACE_DEBUG, ACE_TEXT(), LM_DEBUG, loading_topology_, and TAO_debug_level.

Referenced by init().

00213 {
00214   this->loading_topology_ = true;
00215   if (this->topology_factory_ != 0)
00216   {
00217     // create_loader will open and load the persistence file for validation
00218     auto_ptr<TAO_Notify::Topology_Loader> tl(this->topology_factory_->create_loader());
00219     if (tl.get () != 0)
00220     {
00221       tl->load (this);
00222     }
00223   }
00224   else
00225   {
00226     if (TAO_debug_level > 0)
00227       ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Topology persistence disabled.\n")));
00228   }
00229   this->loading_topology_ = false;
00230 }

void TAO_Notify_EventChannelFactory::reconnect ( void   )  [virtual]

Re-establish connections that we had before a shutdown.

After a topology restore, this method is called so we can reconnect to any external objects with whom we were interacting. We should call the reconnect() method on all of our children to give them the chance to do the same.

Reimplemented from TAO_Notify::Topology_Savable.

Definition at line 369 of file EventChannelFactory.cpp.

References ACE_ASSERT, TAO_Notify_Container_T< TYPE >::collection(), ec_container(), CORBA::is_nil(), reconnect_registry_, ACE_Unbounded_Set_Ex< T, C >::reset(), routing_slip_restart_set_, and TAO_Notify::Reconnection_Registry::send_reconnect().

Referenced by activate_self().

00370 {
00371   // Reconnect all children first
00372   TAO_Notify::Reconnect_Worker<TAO_Notify_EventChannel> wrk;
00373 
00374   this->ec_container().collection()->for_each(&wrk);
00375 
00376   // Then send reconnection announcement to registered clients
00377   ACE_ASSERT (!CORBA::is_nil (this->channel_factory_.in ()));
00378   this->reconnect_registry_.send_reconnect (this->channel_factory_.in ());
00379 
00380   // reactivate events in-progress
00381   Routing_Slip_Set::CONST_ITERATOR iter (this->routing_slip_restart_set_);
00382   TAO_Notify::Routing_Slip_Ptr * routing_slip;
00383   for (iter.first(); iter.next(routing_slip); iter.advance())
00384   {
00385     (*routing_slip)->reconnect();
00386   }
00387   this->routing_slip_restart_set_.reset ();
00388 }

NotifyExt::ReconnectionRegistry::ReconnectionID TAO_Notify_EventChannelFactory::register_callback ( NotifyExt::ReconnectionCallback_ptr  reconnection  )  [private, virtual]

Definition at line 391 of file EventChannelFactory.cpp.

References reconnect_registry_, and TAO_Notify::Reconnection_Registry::register_callback().

00393 {
00394   return this->reconnect_registry_.register_callback (
00395     reconnection);
00396 }

void TAO_Notify_EventChannelFactory::release ( void   )  [private, virtual]

Release this object.

Implements TAO_Notify_Refcountable.

Definition at line 134 of file EventChannelFactory.cpp.

00135 {
00136   delete this;
00137   //@@ inform factory
00138 }

void TAO_Notify_EventChannelFactory::remove ( TAO_Notify_EventChannel channel  )  [virtual]

Remove channel from the <ec_container_>.

Definition at line 141 of file EventChannelFactory.cpp.

References ec_container(), TAO_Notify_Container_T< TYPE >::remove(), and TAO_Notify::Topology_Object::self_change().

00142 {
00143   this->ec_container().remove (event_channel);
00144   this->self_change ();
00145 }

void TAO_Notify_EventChannelFactory::save_persistent ( TAO_Notify::Topology_Saver saver  )  [virtual]

Save our state to a Topology_Saver.

Use the methods of a Topology_Saver to store all information we want persisted. This function is called by our parent, which gives us a saver to use. In turn, we must call this function on all of our children. The implementation should look like: bool change = this->self_changed_; this->self_changed_ = false; this->children_changed_ = false; if (is_persistent ()) { bool want_all_children = saver.begin_object( this->id(), type, attrs, change); for all children { if (want_all_children || child.is_changed()) { child.save_persistent(saver); } } for all deleted children { saver.delete_child(child_type, child_id); } saver.end_object(this->id(), type); )

Implements TAO_Notify::Topology_Savable.

Definition at line 238 of file EventChannelFactory.cpp.

References TAO_Notify::Topology_Saver::begin_object(), TAO_Notify::Topology_Object::children_changed_, TAO_Notify_Container_T< TYPE >::collection(), ec_container(), TAO_Notify::Topology_Saver::end_object(), and TAO_Notify::Topology_Object::self_changed_.

00239 {
00240   bool changed = this->self_changed_;
00241   this->self_changed_ = false;
00242   this->children_changed_ = false;
00243 
00244   TAO_Notify::NVPList attrs; // ECF has no attributes
00245 
00246   bool want_all_children =
00247     saver.begin_object(0, "channel_factory", attrs, changed);
00248 
00249   // for each deleted child
00250   //  delete_child  // if the child has persistence.
00251 
00252   TAO_Notify::Save_Persist_Worker<TAO_Notify_EventChannel> wrk(saver, want_all_children);
00253 
00254   this->ec_container().collection()->for_each(&wrk);
00255 
00256   if (want_all_children || this->reconnect_registry_.is_changed ())
00257   {
00258     this->reconnect_registry_.save_persistent(saver);
00259   }
00260   saver.end_object(0, "channel_factory");
00261 }

void TAO_Notify_EventChannelFactory::save_topology ( void   )  [virtual]

Definition at line 413 of file EventChannelFactory.cpp.

References TAO_Notify::Topology_Object::self_change().

00414 {
00415   this->self_change ();
00416 }

void TAO_Notify_EventChannelFactory::set_topology_factory ( TAO_Notify::Topology_Factory sf  ) 

Use the passed in saver factory to generate topology saver objects. Does not take ownership.

Definition at line 200 of file EventChannelFactory.cpp.

References ACE_DEBUG, ACE_TEXT(), LM_DEBUG, and topology_factory_.

00201 {
00202   ACE_DEBUG ((LM_DEBUG,
00203     ACE_TEXT ("(%P,%t) Debug Topology_Factory installed in EventChannelFactory.\n")
00204     ));
00205   // If the above meessage appears when you don't expect it
00206   // use svc.conf to install the topology factory rather
00207   // than calling this method.
00208   this->topology_factory_ = f;
00209 }

int TAO_Notify_EventChannelFactory::shutdown ( void   )  [private, virtual]

shutdown

Reimplemented from TAO_Notify_Object.

Definition at line 148 of file EventChannelFactory.cpp.

References ec_container(), TAO_Notify_Container_T< TYPE >::shutdown(), and TAO_Notify_Object::shutdown().

00149 {
00150   if (TAO_Notify_Object::shutdown () == 1)
00151     return 1;
00152 
00153   this->ec_container().shutdown ();
00154 
00155   return 0;
00156 }

void TAO_Notify_EventChannelFactory::unregister_callback ( NotifyExt::ReconnectionRegistry::ReconnectionID  id  )  [private, virtual]

Definition at line 399 of file EventChannelFactory.cpp.

References reconnect_registry_, and TAO_Notify::Reconnection_Registry::unregister_callback().

00401 {
00402   this->reconnect_registry_.unregister_callback (
00403     id);
00404 }


Friends And Related Function Documentation

friend class TAO_Notify_Builder [friend]

Reimplemented from TAO_Notify_Object.

Definition at line 52 of file EventChannelFactory.h.


Member Data Documentation

CosNotifyChannelAdmin::EventChannelFactory_var TAO_Notify_EventChannelFactory::channel_factory_ [private]

Definition at line 160 of file EventChannelFactory.h.

Referenced by activate_self().

ACE_Auto_Ptr< TAO_Notify_EventChannel_Container > TAO_Notify_EventChannelFactory::ec_container_ [private]

Container for Event Channels.

Definition at line 156 of file EventChannelFactory.h.

Referenced by destroy(), ec_container(), and init().

bool TAO_Notify_EventChannelFactory::loading_topology_ [private]

Definition at line 166 of file EventChannelFactory.h.

Referenced by load_topology().

TAO_Notify::Reconnection_Registry TAO_Notify_EventChannelFactory::reconnect_registry_ [private]

Definition at line 165 of file EventChannelFactory.h.

Referenced by load_child(), reconnect(), register_callback(), and unregister_callback().

Routing_Slip_Set TAO_Notify_EventChannelFactory::routing_slip_restart_set_ [private]

Definition at line 168 of file EventChannelFactory.h.

Referenced by reconnect().

TAO_Notify::Topology_Factory* TAO_Notify_EventChannelFactory::topology_factory_ [private]

Definition at line 164 of file EventChannelFactory.h.

Referenced by init(), and set_topology_factory().

TAO_SYNCH_MUTEX TAO_Notify_EventChannelFactory::topology_save_lock_ [private]

Definition at line 158 of file EventChannelFactory.h.

short TAO_Notify_EventChannelFactory::topology_save_seq_ [private]

Change-in-progress detector to avoid duplicates.

Definition at line 163 of file EventChannelFactory.h.

Referenced by change_to_parent().


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:46:19 2010 for TAO_CosNotification by  doxygen 1.4.7