diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2010-06-18 18:25:47 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2010-06-18 18:25:47 +0000 |
commit | b27c5b2e531e87e9716bfc7f79a19a8aa0d86e09 (patch) | |
tree | c266a4648044d7355dd716f8ed512fa328d892d6 /CIAO/ciao/ComponentServer/CIAO_ComponentServer_Impl.cpp | |
parent | 58c5a75bf8e81fc7937f4b353f37e4c41d0f71c3 (diff) | |
download | ATCD-b27c5b2e531e87e9716bfc7f79a19a8aa0d86e09.tar.gz |
Fri Jun 18 18:18:54 UTC 2010 William R. Otte <wotte@dre.vanderbilt.edu>
* DAnCE/LocalityManager/Daemon/Locality_Manager.mpc:
* DAnCE/LocalityManager/Handler/LocalityHandler.mpc:
* DAnCE/LocalityManager/Scheduler/Scheduler.mpc:
* DAnCE/NodeApplication/NodeApplication_Impl.h:
* DAnCE/NodeManager/Node_Manager_Module.cpp:
* MPC/config/ciao_deployment_handlers.mpb:
* ciao/Containers/Session/Session_Container.cpp:
* ciao/Containers/Session/Session_Container.mpc:
* ciao/Deployment/Handlers/CIAO_Deployment_Handlers.mpc:
Fallout from removal of CIAO component server.
* ciao/ComponentServer/CIAO_Base.mpc:
* ciao/ComponentServer/Client_init.h:
* ciao/ComponentServer/Server_init.h:
Restructured into the CIAO_Base library. Directory will be
renamed in a future commit.
* tests/CIF/Common/CIF_Common.mpc:
* tests/CIF/Navigation/Navigation.mpc:
* tests/CIF/Receptacle/Receptacle.mpc:
Disabled until they can be re-implemented without the CIAO
compoenent server.
* MPC/config/ciao_componentserver_stub.mpb:
* MPC/config/ciao_componentserver_svnt.mpb:
* MPC/config/ciao_cs_client.mpb:
* ciao/ComponentServer/CIAO_CS_Client.idl:
* ciao/ComponentServer/CIAO_ComponentInstallation_Impl.h:
* ciao/ComponentServer/CIAO_ComponentInstallation_Impl.cpp:
* ciao/ComponentServer/CIAO_ComponentServer.cpp:
* ciao/ComponentServer/CIAO_ComponentServer.idl:
* ciao/ComponentServer/CIAO_ComponentServer.mpc:
* ciao/ComponentServer/CIAO_ComponentServer_Impl.h:
* ciao/ComponentServer/CIAO_ComponentServer_Impl.cpp:
* ciao/ComponentServer/CIAO_ComponentServer_Task.h:
* ciao/ComponentServer/CIAO_ComponentServer_Task.cpp:
* ciao/ComponentServer/CIAO_Container_Impl.h:
* ciao/ComponentServer/CIAO_Container_Impl.cpp:
* ciao/ComponentServer/CIAO_RTComponentServer.cpp:
* ciao/ComponentServer/CIAO_RTComponentServer_Task.h:
* ciao/ComponentServer/CIAO_RTComponentServer_Task.cpp:
* ciao/ComponentServer/CIAO_ServerActivator_Impl.h:
* ciao/ComponentServer/CIAO_ServerActivator_Impl.cpp:
Removed the CIAO component server.
* tests/CIAO_ComponentServer:
* tests/CIAO_ComponentServer/Activator:
* tests/CIAO_ComponentServer/Activator/Activator.mpc:
* tests/CIAO_ComponentServer/Activator/client.cpp:
* tests/CIAO_ComponentServer/Activator/run_test.pl:
* tests/CIAO_ComponentServer/Basic:
* tests/CIAO_ComponentServer/Basic/Basic.mpc:
* tests/CIAO_ComponentServer/Basic/client.cpp:
* tests/CIAO_ComponentServer/Basic/run_test.pl:
* tests/CIAO_ComponentServer/Local_Facet:
* tests/CIAO_ComponentServer/Local_Facet/Local_Facet.idl:
* tests/CIAO_ComponentServer/Local_Facet/Local_Facet.mpc:
* tests/CIAO_ComponentServer/Local_Facet/Local_Facet_exec.h:
* tests/CIAO_ComponentServer/Local_Facet/Local_Facet_exec.cpp:
* tests/CIAO_ComponentServer/Local_Facet/client.cpp:
* tests/CIAO_ComponentServer/Local_Facet/run_test.pl:
* tests/CIAO_ComponentServer/SimpleComponent:
* tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent.idl:
* tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent.mpc:
* tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_exec.h:
* tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_exec.cpp:
* tests/CIAO_ComponentServer/SimpleComponent/client.cpp:
* tests/CIAO_ComponentServer/SimpleComponent/run_test.pl:
Removed testing of CIAO component server. These features are already tested
in other places for the new infrastructure.
Diffstat (limited to 'CIAO/ciao/ComponentServer/CIAO_ComponentServer_Impl.cpp')
-rw-r--r-- | CIAO/ciao/ComponentServer/CIAO_ComponentServer_Impl.cpp | 268 |
1 files changed, 0 insertions, 268 deletions
diff --git a/CIAO/ciao/ComponentServer/CIAO_ComponentServer_Impl.cpp b/CIAO/ciao/ComponentServer/CIAO_ComponentServer_Impl.cpp deleted file mode 100644 index a2dd4343e44..00000000000 --- a/CIAO/ciao/ComponentServer/CIAO_ComponentServer_Impl.cpp +++ /dev/null @@ -1,268 +0,0 @@ -// $Id$ -#include "CIAO_ComponentServer_Impl.h" - -#include "ciao/Logger/Log_Macros.h" - -#include "CIAO_CS_ClientC.h" -#include "CIAO_Container_Impl.h" -#include "CIAO_PropertiesC.h" - -namespace CIAO -{ - namespace Deployment - { - CIAO_ComponentServer_i::CIAO_ComponentServer_i (const ACE_CString &uuid, - CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa) - : uuid_ (uuid), - orb_ (CORBA::ORB::_duplicate (orb)), - poa_ (PortableServer::POA::_duplicate (poa)), - containers_ () - { - CIAO_TRACE("CIAO_ComponentServer_i::CIAO_ComponentServer_i"); - } - - // Destructor - CIAO_ComponentServer_i::~CIAO_ComponentServer_i (void) - { - CIAO_TRACE("CIAO_ComponentServer_i::~CIAO_ComponentServer_i"); - } - - void - CIAO_ComponentServer_i::shutdown (void) - { - CIAO_TRACE("CIAO_ComponentServer_i::shutdown"); - - CIAO_DEBUG (6, (LM_DEBUG, CLINFO - "CIAO_ComponentServer_i::shutdown - ORB shutdown request " - "received at %C.\n", - this->uuid_.c_str ())); - - if (!this->containers_.is_empty ()) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO - "CIAO_ComponentServer_i::shutdown - ComponentServer %C " - "still has %u containers!\n", - this->uuid_.c_str (), - this->containers_.size ())); - } - - this->orb_->shutdown (); - } - - - ::Components::ConfigValues * - CIAO_ComponentServer_i::configuration (void) - { - CIAO_TRACE("CIAO_ComponentServer_i::configuration"); - return this->config_values_.out (); - } - - - ::Components::Deployment::ServerActivator_ptr - CIAO_ComponentServer_i::get_server_activator (void) - { - CIAO_TRACE("CIAO_ComponentServer_i::get_server_activator"); - return this->serv_act_.in (); - } - - ::Components::Deployment::Container_ptr - CIAO_ComponentServer_i::create_container ( - const ::Components::ConfigValues & config) - { - CIAO_TRACE("CIAO_ComponentServer_i::create_container"); - - try - { - CIAO_DEBUG (6, (LM_INFO, CLINFO - "CIAO_ComponentServer_i::create_container - Request " - "received with %u config values\n", - config.length ())); - - CORBA::PolicyList policies; - const char *name = 0; - CIAO_Container_i *cont = 0; - ACE_NEW_THROW_EX (cont, - CIAO_Container_i (config, 0, name, &policies, - this->ci_.in (), this->orb_.in (), - this->poa_.in ()), - CORBA::NO_MEMORY ()); - - CIAO_DEBUG (6, (LM_DEBUG, CLINFO "CIAO_ComponentServer_i::create_container - " - "Container servant successfully allocated.\n")); - - PortableServer::ServantBase_var safe_config = cont; - PortableServer::ObjectId_var id = - this->poa_->activate_object (cont); - CORBA::Object_var object = this->poa_->id_to_reference (id.in ()); - CIAO::Deployment::Container_var cont_var = - CIAO::Deployment::Container::_narrow (object.in ()); - - this->containers_.insert (CIAO::Deployment::Container::_duplicate(cont_var.in ())); - - CIAO_DEBUG (6, (LM_INFO, CLINFO - "CIAO_ComponentServer_i::create_container - Container successfully activated and stored," - " now managing %u containers\n", - this->containers_.size ())); - - return cont_var._retn (); - } - catch (const CORBA::NO_MEMORY &) - { - CIAO_ERROR (1, (LM_CRITICAL, CLINFO "CIAO_ComponentServer_Impl: Out of memory exception whilst creating container.\n")); - throw; - } - catch (...) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO "CIAO_ComponentServer_Impl: Caught unknown exception\n")); - } - - throw Components::CreateFailure (); - } - - void - CIAO_ComponentServer_i::remove_container ( - ::Components::Deployment::Container_ptr cref) - { - CIAO_TRACE("CIAO_ComponentServer_i::remove_container"); - - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "CIAO_ComponentServer_i::remove_container - Remove request received.\n")); - - if (CORBA::is_nil (cref)) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO - "CIAO_ComponentServer_i::remove_container - " - "Error: Received nil container reference\n")); - throw Components::RemoveFailure (); - } - - try - { - CONTAINERS::ITERATOR i (this->containers_.begin ()); - - // @@ TODO: artifact from when this was a sequence, should probably use .find, - // which will work properly with the new parameterized set class. - for (CONTAINERS::iterator i = this->containers_.begin (); - i.done () != 1; i.advance ()) - { - if (CORBA::is_nil (*i)) - { - ACE_ERROR ((LM_WARNING, CLINFO - "CIAO_ComponentServer_i::remove_container - " - "Managed container reference is nil, skipping.\n")); - continue; - } - - if ((*i)->_is_equivalent (cref)) - { - CIAO_DEBUG (9, (LM_TRACE, CLINFO "CIAO_ComponentServer_i::remove_container - Found container, invoking remove....\n")); - cref->remove (); - if (this->containers_.remove (*i) != 0) - CIAO_ERROR (1, (LM_ERROR, CLINFO - "CIAO_ComponentServer_i::remove_container - Unable to remove " - "container reference from internal structure....\n")); - CIAO_DEBUG (9, (LM_TRACE, CLINFO "CIAO_ComponentServer_i::remove_container - Remove completed, destroying object, " - "now manage %u containers\n", this->containers_.size ())); - return; - } - } - } - catch (const CORBA::Exception &ex) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO "CIAO_ComponentServer_i::remove_container - " - "Caught CORBA exception whilst removing container: %C\n", - ex._info ().c_str ())); - } - catch (...) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO "CIAO_ComponentServer_i::remove_container - Error: Unknown exception caught while removing a container.\n")); - } - throw Components::RemoveFailure (); - } - - - ::Components::Deployment::Containers * - CIAO_ComponentServer_i::get_containers (void) - { - CIAO_TRACE("CIAO_ComponentServer_i::get_containers"); - - ::Components::Deployment::Containers *tmp = 0; - ACE_NEW_THROW_EX (tmp, - ::Components::Deployment::Containers (this->containers_.size ()), - CORBA::NO_MEMORY ()); - - ::Components::Deployment::Containers_var retval (tmp); - CORBA::ULong pos (0); - retval->length (this->containers_.size ()); - - for (CONTAINERS::iterator i = this->containers_.begin (); - i.done () != 1; i.advance ()) - { - retval[pos++] = ::CIAO::Deployment::Container::_duplicate (*i); - } - - return retval._retn (); - } - - - void - CIAO_ComponentServer_i::remove (void) - { - CIAO_TRACE("CIAO_ComponentServer_i::remove"); - - bool successful = true; - - for (CONTAINERS::iterator i = this->containers_.begin (); - i.done () != 1; i.advance ()) - { - try - { - (*i)->remove (); - } - catch (const CORBA::Exception &ex) - { - successful = false; - CIAO_ERROR (1, (LM_ERROR, CLINFO - "CIAO_ComponentServer_i::remove - " - "Intercepted CORBA exception while trying to remove a container:%C\n", - ex._info ().c_str ())); - } - catch (...) - { - successful = false; - CIAO_ERROR (1, (LM_ERROR, CLINFO - "CIAO_ComponentServer_i::remove - " - "Intercepted exception while trying to remove a container\n")); - } - } - - this->containers_.reset (); - - if (!successful) - throw ::Components::RemoveFailure (); - } - - void - CIAO_ComponentServer_i::init (::Components::Deployment::ServerActivator_ptr sa, - Components::ConfigValues *cvs) - { - this->serv_act_ = ::Components::Deployment::ServerActivator::_duplicate(sa); - if (cvs != 0) - { - this->config_values_ = cvs; - - for (CORBA::ULong i = 0; i < this->config_values_->length (); ++i) - { - if (ACE_OS::strcmp (CIAO::Deployment::COMPONENTINSTALLATION_REF, - this->config_values_[i]->name ()) == 0) - { - Components::Deployment::ComponentInstallation_ptr tmp; - this->config_values_[i]->value () >>= tmp; - this->ci_ = Components::Deployment::ComponentInstallation::_duplicate (tmp); - } - } - } - } - } -} |