diff options
Diffstat (limited to 'TAO/CIAO/ciao/Servant_Impl_Base.cpp')
-rw-r--r-- | TAO/CIAO/ciao/Servant_Impl_Base.cpp | 217 |
1 files changed, 92 insertions, 125 deletions
diff --git a/TAO/CIAO/ciao/Servant_Impl_Base.cpp b/TAO/CIAO/ciao/Servant_Impl_Base.cpp index 4dff1298c16..4918c0cda49 100644 --- a/TAO/CIAO/ciao/Servant_Impl_Base.cpp +++ b/TAO/CIAO/ciao/Servant_Impl_Base.cpp @@ -6,6 +6,11 @@ namespace CIAO { + Servant_Impl_Base::Servant_Impl_Base (void) + { + ACE_ASSERT (0); + } + Servant_Impl_Base::Servant_Impl_Base (Components::CCMHome_ptr home, Home_Servant_Impl_Base *home_servant, Session_Container * c) @@ -79,7 +84,7 @@ namespace CIAO CIAO::Servant_Activator *sa = this->container_->ports_servant_activator (); - sa->update_port_activator (facet_id.in () ACE_ENV_ARG_PARAMETER); + sa->update_port_activator (facet_id ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; this->container_->the_facet_cons_POA ()->deactivate_object @@ -105,7 +110,7 @@ namespace CIAO CIAO::Servant_Activator *sa = this->container_->ports_servant_activator (); - sa->update_port_activator (cons_id.in () ACE_ENV_ARG_PARAMETER); + sa->update_port_activator (cons_id ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; this->container_->the_facet_cons_POA ()->deactivate_object @@ -127,11 +132,11 @@ namespace CIAO PortableServer::ObjectId_var oid; - this->container_->uninstall_component (ccmobjref.in (), - oid.out () - ACE_ENV_ARG_PARAMETER); + this->container_->uninstall_component ( ccmobjref.in (), + oid.out () + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - + this->home_servant_->update_component_map (oid); } ACE_CATCHANY @@ -173,9 +178,11 @@ namespace CIAO this->get_all_receptacles (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK_RETURN (0); + /* ::Components::ConsumerDescriptions_var consumer_desc = this->get_all_consumers (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK_RETURN (0); + */ ::Components::EmitterDescriptions_var emitter_desc = this->get_all_emitters (ACE_ENV_SINGLE_ARG_PARAMETER); @@ -187,7 +194,7 @@ namespace CIAO retv->facets (facets_desc.in ()); retv->receptacles (receptacle_desc.in ()); - retv->consumers (consumer_desc.in ()); + // retv->consumers (consumer_desc.in ()); retv->emitters (emitter_desc.in ()); retv->publishers (publisher_desc.in ()); @@ -202,7 +209,7 @@ namespace CIAO ACE_THROW_SPEC ((CORBA::SystemException, Components::InvalidName)) { - if (0 == name) + if (name == 0) { ACE_THROW_RETURN (Components::InvalidName (), CORBA::Object::_nil ()); @@ -240,7 +247,7 @@ namespace CIAO { tmp = this->lookup_facet_description (names[i].in ()); - if (0 == tmp) + if (tmp == 0) { ACE_THROW_RETURN (Components::InvalidName (), 0); @@ -265,15 +272,15 @@ namespace CIAO ::Components::FacetDescriptions_var retval = tmp; - retval->length (this->facet_table_.size ()); + retval->length (this->facet_table_.current_size ()); CORBA::ULong i = 0; - for (FacetTable::const_iterator iter = this->facet_table_.begin (); + for (FacetTable::iterator iter = this->facet_table_.begin (); iter != this->facet_table_.end (); ++iter, ++i) { - FacetTable::const_reference entry = *iter; - retval[i] = entry.second; + FacetTable::ENTRY & entry = *iter; + retval[i] = entry.int_id_; } return retval._retn (); @@ -286,25 +293,25 @@ namespace CIAO ) ACE_THROW_SPEC ((CORBA::SystemException)) { + ::Components::ConsumerDescriptions *tmp = 0; ACE_NEW_THROW_EX (tmp, ::Components::ConsumerDescriptions ( - this->consumer_table_.size ()), + this->consumer_table_.current_size ()), CORBA::NO_MEMORY ()); - ACE_CHECK_RETURN (0); ::Components::ConsumerDescriptions_var retval = tmp; - retval->length (this->consumer_table_.size ()); + retval->length (this->consumer_table_.current_size ()); CORBA::ULong i = 0; - for (ConsumerTable::const_iterator iter = this->consumer_table_.begin (); + for (ConsumerTable::iterator iter = this->consumer_table_.begin (); iter != this->consumer_table_.end (); ++iter, ++i) { // ACE_DEBUG ((LM_DEBUG, "EXECUTING \n")); - ConsumerTable::const_reference entry = *iter; - retval[i] = entry.second; + ConsumerTable::ENTRY & entry = *iter; + retval[i] = entry.int_id_; } return retval._retn (); @@ -319,7 +326,7 @@ namespace CIAO ACE_THROW_SPEC ((CORBA::SystemException, Components::InvalidName)) { - if (0 == sink_name) + if (sink_name == 0) { ACE_THROW_RETURN (Components::InvalidName (), Components::EventConsumerBase::_nil ()); @@ -337,6 +344,18 @@ namespace CIAO return retval; } + ::Components::EventConsumerBase_ptr + Servant_Impl_Base::disconnect_consumer ( + const char * /* source_name */ + ACE_ENV_ARG_DECL + ) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::InvalidName, + Components::NoConnection)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + ::Components::ConsumerDescriptions * Servant_Impl_Base::get_named_consumers ( const ::Components::NameList & names @@ -358,7 +377,7 @@ namespace CIAO { tmp = this->lookup_consumer_description (names[i].in ()); - if (0 == tmp) + if (tmp == 0) { ACE_THROW_RETURN (Components::InvalidName (), 0); @@ -371,6 +390,15 @@ namespace CIAO } ::Components::EmitterDescriptions * + Servant_Impl_Base::get_all_emitters ( + ACE_ENV_SINGLE_ARG_DECL + ) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::EmitterDescriptions * Servant_Impl_Base::get_named_emitters ( const ::Components::NameList & /* names */ ACE_ENV_ARG_DECL @@ -382,6 +410,15 @@ namespace CIAO } ::Components::ReceptacleDescriptions * + Servant_Impl_Base::get_all_receptacles ( + ACE_ENV_SINGLE_ARG_DECL + ) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::ReceptacleDescriptions * Servant_Impl_Base::get_named_receptacles ( const ::Components::NameList & /* names */ ACE_ENV_ARG_DECL @@ -393,6 +430,15 @@ namespace CIAO } ::Components::PublisherDescriptions * + Servant_Impl_Base::get_all_publishers ( + ACE_ENV_SINGLE_ARG_DECL + ) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::PublisherDescriptions * Servant_Impl_Base::get_named_publishers ( const ::Components::NameList & /* names */ ACE_ENV_ARG_DECL @@ -407,84 +453,46 @@ namespace CIAO void Servant_Impl_Base::add_facet (const char *port_name, - ::CORBA::Object_ptr port_ref - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( ::CORBA::SystemException)) + CORBA::Object_ptr port_ref) { - if (0 == port_name || ::CORBA::is_nil (port_ref)) - { - ACE_THROW ( ::CORBA::BAD_PARAM ()); - return; - } - ::Components::FacetDescription *fd = 0; ACE_NEW (fd, - ::OBV_Components::FacetDescription); + OBV_Components::FacetDescription); ::Components::FacetDescription_var safe = fd; fd->name (port_name); fd->type_id (port_ref->_interface_repository_id ()); fd->facet_ref (port_ref); - FacetTable::value_type entry; - entry.first = port_name; - entry.second = safe._retn (); - - ACE_WRITE_GUARD (TAO_SYNCH_MUTEX, mon, this->lock_); - - (void) this->facet_table_.insert (entry); + if (this->facet_table_.bind (port_name, fd) == 0) + { + safe._retn (); + } } CORBA::Object_ptr Servant_Impl_Base::lookup_facet (const char *port_name) { - if (0 == port_name) - { - return CORBA::Object::_nil (); - } - - ACE_READ_GUARD_RETURN (TAO_SYNCH_MUTEX, - mon, - this->lock_, - CORBA::Object::_nil ()); - - FacetTable::const_iterator iter = - this->facet_table_.find (port_name); + ::Components::FacetDescription_var fd; - if (iter == this->facet_table_.end ()) + if (this->facet_table_.find (port_name, fd) != 0) { return CORBA::Object::_nil (); } - return CORBA::Object::_duplicate (iter->second->facet_ref ()); + return CORBA::Object::_duplicate (fd.in ()->facet_ref ()); } ::Components::FacetDescription * Servant_Impl_Base::lookup_facet_description (const char *port_name) { - if (0 == port_name) + ::Components::FacetDescription_var fd; + + if (this->facet_table_.find (port_name, fd) != 0) { - /// Calling function will throw InvalidName after getting this. return 0; } - ::Components::FacetDescription_var fd; - FacetTable::const_iterator iter; - - { - ACE_READ_GUARD_RETURN (TAO_SYNCH_MUTEX, - mon, - this->lock_, - 0); - - iter = this->facet_table_.find (port_name); - - if (iter != this->facet_table_.end ()) - { - fd = iter->second; - } - } - return fd._retn (); } @@ -492,59 +500,35 @@ namespace CIAO Servant_Impl_Base::add_consumer ( const char *port_name, ::Components::EventConsumerBase_ptr port_ref - ACE_ENV_ARG_DECL ) - ACE_THROW_SPEC (( ::CORBA::SystemException)) { - if (0 == port_name || ::CORBA::is_nil (port_ref)) - { - ACE_THROW ( ::CORBA::BAD_PARAM ()); - return; - } - ::Components::ConsumerDescription *cd = 0; ACE_NEW (cd, - ::OBV_Components::ConsumerDescription); + OBV_Components::ConsumerDescription); ::Components::ConsumerDescription_var safe = cd; cd->name (port_name); cd->type_id (port_ref->_interface_repository_id ()); cd->consumer (port_ref); - ConsumerTable::value_type entry; - entry.first = port_name; - entry.second = safe._retn (); - - ACE_WRITE_GUARD (TAO_SYNCH_MUTEX, mon, this->lock_); - - (void) this->consumer_table_.insert (entry); + if (this->consumer_table_.bind (port_name, cd) == 0) + { + safe._retn (); + } } ::Components::EventConsumerBase_ptr Servant_Impl_Base::lookup_consumer (const char *port_name) { - if (0 == port_name) - { - return ::Components::EventConsumerBase::_nil (); - } - - ACE_READ_GUARD_RETURN (TAO_SYNCH_MUTEX, - mon, - this->lock_, - ::Components::EventConsumerBase::_nil ()); - - ConsumerTable::const_iterator iter = - this->consumer_table_.find (port_name); + ::Components::ConsumerDescription_var cd; - if (iter == this->consumer_table_.end ()) + if (this->consumer_table_.find (port_name, cd) != 0) { return ::Components::EventConsumerBase::_nil (); } return - ::Components::EventConsumerBase::_duplicate ( - iter->second->consumer () - ); + ::Components::EventConsumerBase::_duplicate (cd.in ()->consumer ()); } ::Components::ConsumerDescription * @@ -552,33 +536,17 @@ namespace CIAO const char *port_name ) { - if (0 == port_name) + ::Components::ConsumerDescription_var cd; + + if (this->consumer_table_.find (port_name, cd) != 0) { - /// Calling function will throw InvalidName after getting this. return 0; } - ::Components::ConsumerDescription_var cd; - ConsumerTable::const_iterator iter; - - { - ACE_READ_GUARD_RETURN (TAO_SYNCH_MUTEX, - mon, - this->lock_, - 0); - - iter = this->consumer_table_.find (port_name); - - if (iter != this->consumer_table_.end ()) - { - cd = iter->second; - } - } - return cd._retn (); } - - ::Components::StandardConfigurator_ptr + + ::Components::StandardConfigurator_ptr Servant_Impl_Base::get_standard_configurator (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { @@ -605,4 +573,3 @@ namespace CIAO PortableServer::POA::_duplicate (container_->the_POA ()); } } - |