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 | |
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')
54 files changed, 185 insertions, 4785 deletions
diff --git a/CIAO/ChangeLog b/CIAO/ChangeLog index 20daa3a9f2f..4fb393b18f5 100644 --- a/CIAO/ChangeLog +++ b/CIAO/ChangeLog @@ -1,7 +1,85 @@ +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. + Fri Jun 18 17:47:10 UTC 2010 Martin Corino <mcorino@remedy.nl> * DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp: - Fixed incorrectly place #endif. + Fixed incorrectly place #endif. Fri Jun 18 17:40:57 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl> diff --git a/CIAO/DAnCE/LocalityManager/Daemon/Locality_Manager.mpc b/CIAO/DAnCE/LocalityManager/Daemon/Locality_Manager.mpc index 7d620ef7a56..23183b8a4a1 100644 --- a/CIAO/DAnCE/LocalityManager/Daemon/Locality_Manager.mpc +++ b/CIAO/DAnCE/LocalityManager/Daemon/Locality_Manager.mpc @@ -16,10 +16,14 @@ project (DAnCE_LocalityManager_Impl) : dance_lib, dance_output, naming, \ Locality_Manager_Impl.h Locality_Manager_Impl_Export.h } + + specific { + install_dir = DAnCE/LocalityManager/Daemon + } } project (DAnCE_LocalityManager_Exec) : dance_exe, dance_exe, dance_output, \ - dance_locality_manager, dance_logger, ciao_logger, ciao_componentserver_stub { + dance_locality_manager, dance_logger, ciao_logger, ciao_deployment_handlers { exename = dance_locality_manager libs += CIAO_Deployment_Handlers after += CIAO_Deployment_Handlers @@ -27,4 +31,8 @@ project (DAnCE_LocalityManager_Exec) : dance_exe, dance_exe, dance_output, \ Locality_Manager_Task.cpp Locality_Manager.cpp } + + specific { + install_dir = DAnCE/LocalityManager/Daemon + } } diff --git a/CIAO/DAnCE/LocalityManager/Handler/LocalityHandler.mpc b/CIAO/DAnCE/LocalityManager/Handler/LocalityHandler.mpc index e48673e32bf..d82402e3adb 100644 --- a/CIAO/DAnCE/LocalityManager/Handler/LocalityHandler.mpc +++ b/CIAO/DAnCE/LocalityManager/Handler/LocalityHandler.mpc @@ -6,4 +6,8 @@ project(DAnCE_Locality_Handler) : dance_skel, dance_split_plan, dance_lib, dance LocalityActivator_Impl.cpp Locality_Manager_Handler_Impl.cpp } + + specific { + install_dir = DAnCE/LocalityManager/Handler + } } diff --git a/CIAO/DAnCE/LocalityManager/Scheduler/Scheduler.mpc b/CIAO/DAnCE/LocalityManager/Scheduler/Scheduler.mpc index dd10a4bfc35..9f7bada4beb 100644 --- a/CIAO/DAnCE/LocalityManager/Scheduler/Scheduler.mpc +++ b/CIAO/DAnCE/LocalityManager/Scheduler/Scheduler.mpc @@ -24,4 +24,8 @@ project(DAnCE_Deployment_Scheduler) : dance_lib, dance_output, dance_skel, dance Deployment_Scheduler_export.h Deployment_Completion.h } + + specific { + install_dir = DAnCE/LocalityManager/Scheduler + } }
\ No newline at end of file diff --git a/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.h b/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.h index c9b0a8e7142..bd150f865cf 100644 --- a/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.h +++ b/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.h @@ -21,10 +21,6 @@ #include "ace/Containers_T.h" #include "tao/AnyTypeCode/AnyTypeCode_methods.h" -#include "ccm/CCM_KeylessCCMHomeC.h" -#include "ciao/ComponentServer/CIAO_ServerActivator_Impl.h" - -#include "ccm/ComponentServer/CCM_ComponentServerC.h" #include "Deployment/Deployment_NodeApplicationS.h" #include "Deployment/Deployment_DeploymentPlanC.h" #include "Deployment/DeploymentC.h" diff --git a/CIAO/DAnCE/NodeManager/Node_Manager_Module.cpp b/CIAO/DAnCE/NodeManager/Node_Manager_Module.cpp index b0619e5fc46..70ad129e062 100644 --- a/CIAO/DAnCE/NodeManager/Node_Manager_Module.cpp +++ b/CIAO/DAnCE/NodeManager/Node_Manager_Module.cpp @@ -545,10 +545,6 @@ void DAnCE_NodeManager_Module::register_value_factories (void) { DANCE_TRACE("DAnCE_Node_Manager_Module::register_value_factories (void)"); - DANCE_DEBUG (9, (LM_TRACE, DLINFO ACE_TEXT ("DAnCE_NodeManager_Module::init - ") - ACE_TEXT ("Registering Cookie value factory.\n"))); - CORBA::ValueFactory_var vf = new Components::Cookie_init(); - vf = this->orb_->register_value_factory ("IDL:omg.org/Components/Cookie:1.0", vf.in()); } void diff --git a/CIAO/MPC/config/ciao_componentserver_stub.mpb b/CIAO/MPC/config/ciao_componentserver_stub.mpb deleted file mode 100644 index c8772042a72..00000000000 --- a/CIAO/MPC/config/ciao_componentserver_stub.mpb +++ /dev/null @@ -1,7 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project : ccm_cookie, ccm_configvalue, ccm_componentserver_stub, ciao_logger { - after += CIAO_ComponentServer_stub - libs += CIAO_ComponentServer_stub -} diff --git a/CIAO/MPC/config/ciao_componentserver_svnt.mpb b/CIAO/MPC/config/ciao_componentserver_svnt.mpb deleted file mode 100644 index fa0c767e48c..00000000000 --- a/CIAO/MPC/config/ciao_componentserver_svnt.mpb +++ /dev/null @@ -1,7 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project : ciao_componentserver_stub, ccm_componentserver_svnt, ciao_session_container, ciao_cs_client { - after += CIAO_ComponentServer_svnt - libs += CIAO_ComponentServer_svnt -} diff --git a/CIAO/MPC/config/ciao_cs_client.mpb b/CIAO/MPC/config/ciao_cs_client.mpb deleted file mode 100644 index 90f770d01d9..00000000000 --- a/CIAO/MPC/config/ciao_cs_client.mpb +++ /dev/null @@ -1,7 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project : ccm_stub, ciao_componentserver_stub, ccm_componentserver_svnt, portableserver, threads, avoids_ace_for_tao, ciao_logger { - after += CIAO_CS_Client_svnt - libs += CIAO_CS_Client_svnt -} diff --git a/CIAO/MPC/config/ciao_deployment_handlers.mpb b/CIAO/MPC/config/ciao_deployment_handlers.mpb index 9a1f34ffc8c..04fb1d554e1 100644 --- a/CIAO/MPC/config/ciao_deployment_handlers.mpb +++ b/CIAO/MPC/config/ciao_deployment_handlers.mpb @@ -1,6 +1,6 @@ // $Id$ -project : dance_stub, ciao_session_container, \ - ciao_logger, ciao_componentserver_stub { +project : ciao_base, dance_stub, ciao_session_container, \ + ciao_logger { includes += $(CIAO_ROOT) libs += CIAO_Deployment_Handlers after += CIAO_Deployment_Handlers diff --git a/CIAO/ciao/ComponentServer/CIAO_Base.mpc b/CIAO/ciao/ComponentServer/CIAO_Base.mpc new file mode 100644 index 00000000000..cff6c631d1f --- /dev/null +++ b/CIAO/ciao/ComponentServer/CIAO_Base.mpc @@ -0,0 +1,59 @@ +// $Id$ + +project(CIAO_Base_IDL) : install, ciaoidldefaults, anytypecode { + idlflags += -Wb,stub_export_macro=CIAO_BASE_STUB_Export \ + -Wb,stub_export_include=CIAO_Base_stub_export.h \ + -SS -Sci + custom_only=1 + + IDL_Files { + CIAO_Properties.idl + idlflags += -Gxhst + } + + IDL_Files { + CIAO_FailureReasons.idl + } +} + +project(CIAO_Base_stub) : install, ciaolib_with_idl, ciao_output, \ + ciao_logger, ciao_lib, \ + ccm_cookie, ccm_configvalue { + dynamicflags = CIAO_BASE_STUB_BUILD_DLL + after += CIAO_Base_IDL + + IDL_Files { + } + Source_Files { + CIAO_PropertiesC.cpp + CIAO_FailureReasonsC.cpp + Server_init.cpp + Client_init.cpp + } + Header_Files { + CIAO_FailureReasonsC.h + CIAO_PropertiesC.h + Server_init.h + Client_init.h + CIAO_Properties_stub_export.h + } + + specific { + install_dir = ciao + } + InstallData_Files { + gendir = . + ../../COPYING + ../../NEWS + ../../PROBLEM-REPORT-FORM + ../../VERSION + ../../docs + ../../MPC + } + verbatim(gnuace, postinstall) { +" cp ../../rules.ciao.GNU $(INSTALL_PREFIX)/share/ciao" +" perl -i -pe's!\\$$[{(]CIAO_ROOT[})]!$(INSTALL_PREFIX)/include!g;' -e'if (/ifndef TAO_IDL3_TO_IDL2\\b/) {print qq!TAO_IDL3_TO_IDL2=$(INSTALL_PREFIX)/share/ciao/bin/tao_idl3_to_idl2\\nTAO_IDL3_TO_IDL2DEP=\\$$(TAO_IDL3_TO_IDL2)\\$$(EXEEXT)\\n!}' $(INSTALL_PREFIX)/share/ciao/rules.ciao.GNU" +" echo export CIAO_ROOT=$(INSTALL_PREFIX)/share/ciao> $(INSTALL_PREFIX)/share/ciao/ciao-devel.sh" +" echo export DANCE_ROOT=$(INSTALL_PREFIX)/share/DAnCE>> $(INSTALL_PREFIX)/share/ciao/ciao-devel.sh" + } +} diff --git a/CIAO/ciao/ComponentServer/CIAO_CS_Client.idl b/CIAO/ciao/ComponentServer/CIAO_CS_Client.idl deleted file mode 100644 index c966ac7ccf5..00000000000 --- a/CIAO/ciao/ComponentServer/CIAO_CS_Client.idl +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @file CIAO_CS_Client.idl - * @author William R. Otte <wotte@dre.vanderbilt.edu> - * $Id$ - * A couple CIAO-specific extensions to the component server client - * interfaces. - */ - -#ifndef CIAO_COMPONENTSERVER_IDL_ -#define CIAO_COMPONENTSERVER_IDL_ - -#include <ccm/ComponentServer/CCM_ComponentServer_Client.idl> - -module CIAO -{ - module Deployment - { - interface ServerActivator : ::Components::Deployment::ServerActivator - { - /// Used by spawned component servers to notify the server - /// activator of their object reference and retrieve - /// configuration information. - void component_server_callback (in ::Components::Deployment::ComponentServer serverref, - in string server_UUID, - out ::Components::ConfigValues config); - - void configuration_complete (in string server_UUID); - }; - }; -}; - - -#endif - - diff --git a/CIAO/ciao/ComponentServer/CIAO_ComponentInstallation_Impl.cpp b/CIAO/ciao/ComponentServer/CIAO_ComponentInstallation_Impl.cpp deleted file mode 100644 index 4e6b323ccdb..00000000000 --- a/CIAO/ciao/ComponentServer/CIAO_ComponentInstallation_Impl.cpp +++ /dev/null @@ -1,129 +0,0 @@ -// $Id$ - -#include "CIAO_ComponentInstallation_Impl.h" -#include "ciao/Logger/Log_Macros.h" - -namespace CIAO -{ - namespace Deployment - { - - ComponentInstallation_Impl::ComponentInstallation_Impl() - { - CIAO_TRACE ("ComponentInstallation_Impl::ComponentInstallation_Impl"); - } - - ComponentInstallation_Impl::~ComponentInstallation_Impl() - { - CIAO_TRACE ("ComponentInstallation_Impl::~ComponentInstallation_Impl"); - } - - void - ComponentInstallation_Impl::install (const char * implUUID, const char * component_loc) - { - CIAO_TRACE ("ComponentInstallation_Impl::install"); - - CIAO_DEBUG (6, (LM_DEBUG, CLINFO "ComponentInstallation_Impl::install - " - "implUUID %C, component_loc %C\n", implUUID, component_loc)); - - ACE_CString location = component_loc; - - if (0 == this->locations_.find (implUUID)) - { - this->locations_.bind (implUUID, location); - } - else - { - CIAO_DEBUG (6, (LM_DEBUG, CLINFO "ComponentInstallation_Impl::install - Location for artifact %C " - "already present, replacing.\n", - implUUID)); - this->locations_.rebind (implUUID, location); - } - } - - - void - ComponentInstallation_Impl::replace (const char *uuid, const char *loc) - { - CIAO_TRACE ("ComponentInstallation_Impl::replace"); - - this->locations_.rebind (uuid, loc); - } - - void - ComponentInstallation_Impl::remove (const char *uuid) - { - CIAO_TRACE ("ComponentInstallation_Impl::remove"); - this->locations_.unbind (uuid); - } - - char * - ComponentInstallation_Impl::get_implementation (const char * implUUID) - { - CIAO_TRACE ("ComponentInstallation_Impl::get_implementation"); - - ACE_CString s; - if (0 == this->locations_.find (implUUID, s)) - { - CIAO_DEBUG (6, (LM_DEBUG, CLINFO "ComponentInstallation_Impl::get_implementation - " - "ComponentInstallation_Impl::get_implementation for UUID %C, location %C\n", - implUUID, s.c_str())); - - return CORBA::string_dup (s.c_str()); - } - else - { - CIAO_ERROR (1, (LM_ERROR, CLINFO "ComponentInstallation_Impl::get_implementation - " - "cannot find location for specified implementation UUID %C\n", implUUID)); - throw ::Components::Deployment::UnknownImplId(); - return 0; - } - } - - - char * - ComponentInstallation_Impl::get_valuetypefactory_location (const char * implUUID, - const char * repid) - { - CIAO_TRACE ("ComponentInstallation_Impl::get_valuetypefactory_location"); - - ACE_CString key = ComponentInstallation_Impl::valuefactory_key (implUUID, repid); - ACE_CString s; - if (0 == this->locations_.find (implUUID, s)) - { - CIAO_DEBUG (6, (LM_DEBUG, CLINFO "ComponentInstallation_Impl::get_valuetypefactory_location - " - "UUID:\"%C\" repid:\"%C\" -> location:\"%C\"\n", implUUID, repid, s.c_str())); - return CORBA::string_dup (s.c_str()); - } - else - { - CIAO_ERROR (1, (LM_ERROR, CLINFO "ComponentInstallation_Impl::get_valuetypefactory_location - " - "cannot find location for implementation UUID %C and repid %C.\n", implUUID, repid)); - throw ::Components::Deployment::InstallationFailure(); - return 0; - } - return 0; - } - - - void - ComponentInstallation_Impl::install_valuetypefactory_location (const char * implUUID, - const char * repid, - const char * loc) - { - CIAO_TRACE ("ComponentInstallation_Impl::install_valuetypefactory_location"); - ACE_CString key = ComponentInstallation_Impl::valuefactory_key (implUUID, repid); - if (0 != this->locations_.find (key)) - { - ACE_CString location = loc; - this->locations_.bind (implUUID, location); - } - else - { - // I don't certaint that we should throw exception here - //throw ::Components::Deployment::InstallationFailure(); - } - } - } -} - diff --git a/CIAO/ciao/ComponentServer/CIAO_ComponentInstallation_Impl.h b/CIAO/ciao/ComponentServer/CIAO_ComponentInstallation_Impl.h deleted file mode 100644 index 3ca52bb1608..00000000000 --- a/CIAO/ciao/ComponentServer/CIAO_ComponentInstallation_Impl.h +++ /dev/null @@ -1,65 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file CIAO_ComponentInstallation_Impl.h - * - * $Id$ - * - * @brief Return location of component artifact - * - * @author Erwin Gottlieb <eg@prismtech.com> - */ -//============================================================================= - -#ifndef COMPONENTINSTALLATION_IMPL_H_ -#define COMPONENTINSTALLATION_IMPL_H_ - -#include "ace/Map_Manager.h" -#include "ciao/ComponentServer/CIAO_CS_ClientS.h" - -#include "tao/ORB.h" -#include "ciao/ComponentServer/CIAO_CS_Client_svnt_export.h" - -namespace CIAO -{ - namespace Deployment - { - - class CIAO_CS_CLIENT_SVNT_Export ComponentInstallation_Impl - : public virtual POA_Components::Deployment::ComponentInstallation - { - public: - ComponentInstallation_Impl(); - - virtual ~ComponentInstallation_Impl(); - - virtual void install (const char * implUUID, - const char * component_loc); - - virtual void replace (const char * implUUID, - const char * component_loc); - - virtual void remove (const char * implUUID); - - virtual char * get_implementation (const char * implUUID); - - virtual char * get_valuetypefactory_location (const char * implUUID, - const char * repid); - - void install_valuetypefactory_location (const char * implUUID, - const char * repid, - const char * loc); - - private: - typedef ACE_Map_Manager< ACE_CString, ACE_CString, ACE_Null_Mutex > TLocations; - TLocations locations_; - - static ACE_CString valuefactory_key (const char* uuid, const char* repid) - { - return ACE_CString (repid) + "@" + uuid; - }; - }; - } -} -#endif /*COMPONENTINSTALLATION_IMPL_H_*/ diff --git a/CIAO/ciao/ComponentServer/CIAO_ComponentServer.cpp b/CIAO/ciao/ComponentServer/CIAO_ComponentServer.cpp deleted file mode 100644 index 11960829c16..00000000000 --- a/CIAO/ciao/ComponentServer/CIAO_ComponentServer.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/** - * @file CIAO_ComponentServer.cpp - * @author William R. Otte - * $Id$ - * - * Implementation and main for CIAO_ComponentServer. - */ - -#include "CIAO_ComponentServer_Task.h" -#include "ciao/Logger/Log_Macros.h" - -int ACE_TMAIN (int argc, ACE_TCHAR **argv) -{ - // Tracing disabled by default - CIAO_DISABLE_TRACE (); - - CIAO_TRACE ("CIAO_ComponentServer::ACE_TMAIN"); - - int retval = 0; - try - { - CIAO::Deployment::ComponentServer_Task cs (argc, argv); - cs.run (); - - // Wait for the threads to exit. - //ACE_Thread_Manager::instance ()->wait (); - } - catch (const CIAO::Deployment::ComponentServer_Task::Error &e) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO "CIAO_ComponentServer main: Caught ComponentServer exception: %C\n", - e.err_.c_str ())); - retval = -1; - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ("CIAO_ComponentServer main: Caught corba exception:"); - retval = -1; - } - catch (...) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO "CIAO_ComponentServer main: Caught unknown exception.\n")); - retval = -1; - } - - return retval; -} - diff --git a/CIAO/ciao/ComponentServer/CIAO_ComponentServer.idl b/CIAO/ciao/ComponentServer/CIAO_ComponentServer.idl deleted file mode 100644 index 0acb62bb092..00000000000 --- a/CIAO/ciao/ComponentServer/CIAO_ComponentServer.idl +++ /dev/null @@ -1,79 +0,0 @@ -/** - * @file CIAO_ComponentServer.idl - * @author William R. Otte <wotte@dre.vanderbilt.edu> - * $Id$ - * A couple CIAO-specific extensions to the component server - * interfaces. - */ - -#ifndef CIAO_COMPONENTSERVER_IDL_ -#define CIAO_COMPONENTSERVER_IDL_ - -#include <ccm/CCM_Object.idl> -#include <ccm/ComponentServer/CCM_ComponentServer.idl> - -module CIAO -{ - module Deployment - { - interface ComponentServer : ::Components::Deployment::ComponentServer - { - oneway void shutdown (); - }; - - exception InvalidComponent - { - }; - - /** - * @interface CIAO_Container - * @brief CIAO specific extensions to the component server interface. - */ - interface Container : Components::Deployment::Container - { - /// Instruct the container to install a component without - /// an explicit home. - ::Components::CCMObject install_component (in ::Components::Deployment::UUID id, - in string entrypt, - in ::Components::ConfigValues config) - raises (::Components::Deployment::UnknownImplId, - ::Components::Deployment::ImplEntryPointNotFound, - ::Components::Deployment::InstallationFailure, - ::Components::Deployment::InvalidConfiguration); - - /// Activate component with specified ID, if no ID provided, - /// activates all components. - void activate_component (in ::Components::CCMObject comp) - raises (InvalidComponent); - - /// Passivate component with specified ID, if no ID provided, - /// passivates all components. - void passivate_component (in ::Components::CCMObject comp) - raises (InvalidComponent); - - /// Instruct the container to remove a component installed - /// without an explicit home. If the component was installed - /// with an explicit home, this operation will fail. - void remove_component (in ::Components::CCMObject cref) - raises (::Components::RemoveFailure); - - /// Returns a sequence of all homeless components. - ::Components::CCMObjectSeq get_components (); - - void connect_local_facet (in ::Components::CCMObject provider_ref, - in string provider_port, - in ::Components::CCMObject user_ref, - in string user_port) - raises (::Components::InvalidConnection, - ::Components::AlreadyConnected); - - void disconnect_local_facet (in ::Components::CCMObject provider_ref, - in string provider_port, - in ::Components::CCMObject user_ref, - in string user_port) - raises (::Components::InvalidConnection); - }; - }; -}; - -#endif /* CIAO_COMPONENTSERVER_IDL_ */ diff --git a/CIAO/ciao/ComponentServer/CIAO_ComponentServer.mpc b/CIAO/ciao/ComponentServer/CIAO_ComponentServer.mpc deleted file mode 100644 index 901c09024d4..00000000000 --- a/CIAO/ciao/ComponentServer/CIAO_ComponentServer.mpc +++ /dev/null @@ -1,170 +0,0 @@ -// $Id$ - -project(CIAO_ComponentServer_IDL) : install, ciaoidldefaults, anytypecode { - idlflags += -Wb,stub_export_macro=CIAO_COMPONENTSERVER_STUB_Export \ - -Wb,stub_export_include=CIAO_ComponentServer_stub_export.h \ - -Wb,skel_export_macro=CIAO_COMPONENTSERVER_SVNT_Export \ - -Wb,skel_export_include=CIAO_ComponentServer_svnt_export.h \ - -Gxhst -Gxhsk - - custom_only=1 - - IDL_Files { - CIAO_ComponentServer.idl - } - specific { - install_dir = ciao/ComponentServer - } -} - -project(CIAO_CS_Client_IDL) : install, ciaoidldefaults, anytypecode { - idlflags += -Wb,stub_export_macro=CIAO_COMPONENTSERVER_STUB_Export \ - -Wb,stub_export_include=CIAO_ComponentServer_stub_export.h \ - -Wb,skel_export_macro=CIAO_CS_CLIENT_SVNT_Export \ - -Wb,skel_export_include=CIAO_CS_Client_svnt_export.h - - custom_only=1 - - IDL_Files { - CIAO_Properties.idl - idlflags += -SS -Sci -Gxhsk - } - IDL_Files { - CIAO_CS_Client.idl - } - IDL_Files { - idlflags += -Sci -SS - CIAO_FailureReasons.idl - } - specific { - install_dir = ciao/ComponentServer - } -} - -project(CIAO_ComponentServer_stub) : install, ccm_componentserver_stub, ciaolib_with_idl, ciao_output, \ - messaging, anytypecode, ciao_logger, ciao_lib, ccm_configvalue, \ - ccm_cookie { - after += CIAO_ComponentServer_IDL CIAO_CS_Client_IDL - dynamicflags = CIAO_COMPONENTSERVER_STUB_BUILD_DLL - - IDL_Files { - } - Source_Files { - CIAO_ComponentServerC.cpp - CIAO_CS_ClientC.cpp - CIAO_PropertiesC.cpp - Server_init.cpp - Client_init.cpp - } - Header_Files { - CIAO_ComponentServer_stub_export.h - CIAO_ComponentServerC.h - CIAO_CS_ClientC.h - CIAO_PropertiesC.h - } - Inline_Files { - CIAO_ComponentServerC.inl - CIAO_CS_ClientC.inl - } - specific { - install_dir = ciao/ComponentServer - } -} - -project(CIAO_CS_Client_svnt) : install, ccm_svnt, ccm_componentserver_svnt, ciao_componentserver_stub, portableserver, \ - ciao_lib, threads, avoids_ace_for_tao, ciao_logger { - dynamicflags = CIAO_CS_CLIENT_SVNT_BUILD_DLL - after += CIAO_CS_Client_IDL - IDL_Files { - } - Source_Files { - CIAO_ServerActivator_Impl.cpp - CIAO_ComponentInstallation_Impl.cpp - CIAO_CS_ClientS.cpp - } - Header_Files { - CIAO_ServerActivator_Impl.h - CIAO_ComponentInstallation_Impl.h - CIAO_CS_ClientS.h - CIAO_CS_Client_svnt_export.h - } - Inline_Files { - CIAO_CS_ClientS.inl - } - specific { - install_dir = ciao/ComponentServer - } -} - -project(CIAO_ComponentServer_svnt) : install, ccm_componentserver_svnt, ciao_componentserver_stub, portableserver, \ - ciao_session_container, ciao_lib, ciao_cs_client { - dynamicflags = CIAO_COMPONENTSERVER_SVNT_BUILD_DLL - - IDL_Files { - } - Source_Files { - CIAO_ComponentServer_Impl.cpp - CIAO_ComponentServerS.cpp - CIAO_Container_Impl.cpp - } - Header_Files { - CIAO_ComponentServer_svnt_export.h - CIAO_ComponentServerS.h - CIAO_PropertiesS.h - } - Inline_Files { - CIAO_ComponentServerS.inl - } - specific { - install_dir = ciao/ComponentServer - } -} - -project(CIAO_ComponentServer_exe) : install, ccm_componentserver_svnt, portableserver, ciao_componentserver_svnt, \ - messaging, anytypecode, ciaoexe, ciao_session_container,\ - ciao_logger { - exename = ciao_componentserver - Source_Files { - CIAO_ComponentServer.cpp - CIAO_ComponentServer_Task.cpp - } - Inline_Files { - } - IDL_Files { - } - - specific { - install_dir = ciao - } - InstallData_Files { - gendir = . - ../../COPYING - ../../NEWS - ../../PROBLEM-REPORT-FORM - ../../VERSION - ../../docs - ../../MPC - } - verbatim(gnuace, postinstall) { -" cp ../../rules.ciao.GNU $(INSTALL_PREFIX)/share/ciao" -" perl -i -pe's!\\$$[{(]CIAO_ROOT[})]!$(INSTALL_PREFIX)/include!g;' -e'if (/ifndef TAO_IDL3_TO_IDL2\\b/) {print qq!TAO_IDL3_TO_IDL2=$(INSTALL_PREFIX)/share/ciao/bin/tao_idl3_to_idl2\\nTAO_IDL3_TO_IDL2_DEP=\\$$(TAO_IDL3_TO_IDL2)\\$$(EXEEXT)\\n!}' $(INSTALL_PREFIX)/share/ciao/rules.ciao.GNU" -" echo export CIAO_ROOT=$(INSTALL_PREFIX)/share/ciao> $(INSTALL_PREFIX)/share/ciao/ciao-devel.sh" -" echo export DANCE_ROOT=$(INSTALL_PREFIX)/share/DAnCE>> $(INSTALL_PREFIX)/share/ciao/ciao-devel.sh" - } -} - -project(CIAO_RTComponentServer_exe) : install, ccm_componentserver_svnt, portableserver, ciao_componentserver_svnt, \ - messaging, anytypecode, ciaoexe, ciao_session_container,\ - ciao_logger, rt_server, rtportableserver { - exename = ciao_rtcomponentserver - Source_Files { - CIAO_RTComponentServer.cpp - CIAO_RTComponentServer_Task.cpp - } - Inline_Files { - } - IDL_Files { - } - -} - 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); - } - } - } - } - } -} diff --git a/CIAO/ciao/ComponentServer/CIAO_ComponentServer_Impl.h b/CIAO/ciao/ComponentServer/CIAO_ComponentServer_Impl.h deleted file mode 100644 index 354bc5a7af7..00000000000 --- a/CIAO/ciao/ComponentServer/CIAO_ComponentServer_Impl.h +++ /dev/null @@ -1,82 +0,0 @@ -// $Id$ -/** - * @file CIAO_ComponentServer_Impl.h - * @author William R. Otte <wotte@dre.vanderbilt.edu> - */ - -#ifndef CIAO_COMPONENTSERVER_IMPL_H_ -#define CIAO_COMPONENTSERVER_IMPL_H_ - -#include "ciao/ComponentServer/CIAO_ComponentServerS.h" -#include "ciao/ComponentServer/CIAO_CS_ClientC.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/String_Base.h" -#include "ace/Unbounded_Set_Ex.h" - -namespace CIAO -{ - namespace Deployment - { - class CIAO_COMPONENTSERVER_SVNT_Export CIAO_ComponentServer_i - : public virtual POA_CIAO::Deployment::ComponentServer - { - public: - // Constructor - CIAO_ComponentServer_i (const ACE_CString &uuid, CORBA::ORB_ptr orb, PortableServer::POA_ptr poa); - - // Destructor - virtual ~CIAO_ComponentServer_i (void); - - virtual void shutdown (void); - - virtual ::Components::ConfigValues * configuration (void); - - virtual - ::Components::Deployment::ServerActivator_ptr get_server_activator (void); - - virtual - ::Components::Deployment::Container_ptr create_container (const ::Components::ConfigValues & config); - - virtual - void remove_container (::Components::Deployment::Container_ptr cref); - - virtual - ::Components::Deployment::Containers * get_containers (void); - - virtual - void remove (void); - - void init (::Components::Deployment::ServerActivator_ptr sa, - Components::ConfigValues *cvs); - - private: - ACE_CString uuid_; - CORBA::ORB_var orb_; - PortableServer::POA_var poa_; - ::Components::Deployment::ServerActivator_var serv_act_; - Components::ConfigValues_var config_values_; - - template<typename T> - struct _is_equivalent - { - bool operator() (const T &a, const T &b) const - { - return a->_is_equivalent (const_cast <T&> (b)); - } - }; - - typedef ACE_Unbounded_Set_Ex <Container_var, - _is_equivalent<Container_var> > CONTAINERS; - - CONTAINERS containers_; - - Components::Deployment::ComponentInstallation_var ci_; - }; - } -} - -#endif diff --git a/CIAO/ciao/ComponentServer/CIAO_ComponentServer_Task.cpp b/CIAO/ciao/ComponentServer/CIAO_ComponentServer_Task.cpp deleted file mode 100644 index 732c8e33a30..00000000000 --- a/CIAO/ciao/ComponentServer/CIAO_ComponentServer_Task.cpp +++ /dev/null @@ -1,315 +0,0 @@ -/** - * @file CIAO_ComponentServer_Task.cpp - * @author William R. Otte - * $Id$ - * - * Implementation and main for CIAO_ComponentServer. - */ - -#include "CIAO_ComponentServer_Task.h" - -#include "ace/OS_NS_string.h" -#include "ace/Log_Msg.h" -#include "ace/Get_Opt.h" -#include "tao/ORB.h" -#include "tao/PortableServer/PortableServer.h" -#include "ciao/Logger/Logger_Service.h" -#include "ciao/Logger/Log_Macros.h" -#include "CIAO_ComponentServer_Impl.h" -#include "Server_init.h" - -namespace CIAO -{ - namespace Deployment - { - ComponentServer_Task::Error::Error(const ACE_CString &err) : err_(err) - { - } - - ComponentServer_Task::ComponentServer_Task (int argc, ACE_TCHAR **argv) - { - CIAO_TRACE ("CIAO_ComponentServer_Task::CIAO_ComponentServer_Task ()"); - - Logger_Service - *clf = ACE_Dynamic_Service<Logger_Service>::instance ("CIAO_Logger"); - - if (clf) - { - clf->init (argc, argv); - } - - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "CIAO_ComponentServer_Task::CIAO_ComponentServer_Task - " - "Creating ORB\n")); - - this->orb_ = CORBA::ORB_init (argc, argv); - - this->parse_args (argc, argv); - - CIAO::Server_init (this->orb_.in ()); - - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "CIAO_ComponentServer_Task::CIAO_ComponentServer_Task - " - "CIAO_ComponentServer object created.\n")); - } - - int - ComponentServer_Task::svc (void) - { - CIAO_TRACE ("ComponentServer_Task::svc"); - - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "ComponentServer_Task::svc - " - "Activating the root POA\n")); - - CORBA::Object_var object = - this->orb_->resolve_initial_references ("RootPOA"); - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (object.in ()); - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (); - - poa_manager->activate (); - - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "ComponentServer_Task::svc - " - "Creating server implementation object\n")); - - CIAO::Deployment::CIAO_ComponentServer_i *ci_srv = 0; - ACE_NEW_NORETURN (ci_srv, - CIAO_ComponentServer_i (this->uuid_, - this->orb_.in (), - root_poa.in ())); - - if (ci_srv == 0) - { - CIAO_ERROR (1, (LM_CRITICAL, - "ComponentServer_Task::run - " - "Out of memory error while allocating servant.")); - throw Error ("Out of memory whilst allocating servant."); - } - - PortableServer::ServantBase_var safe_config = ci_srv; - PortableServer::ObjectId_var id = - root_poa->activate_object (ci_srv); - CORBA::Object_var cs_object = root_poa->id_to_reference (id.in ()); - ComponentServer_var cs = - ComponentServer::_narrow (cs_object.in ()); - - if (this->output_file_ != ACE_TEXT("")) - { - CORBA::String_var ior = this->orb_->object_to_string (cs.in ()); - ::CIAO::Utility::write_IOR (this->output_file_.c_str (), ior.in ()); - } - - if (this->callback_ior_str_ != ACE_TEXT("")) - { - CIAO_DEBUG (9, (LM_TRACE, CLINFO "ComponentServer_Task::run - " - "Resolving callback IOR\n")); - CORBA::Object_var obj = - this->orb_->string_to_object (this->callback_ior_str_.c_str ()); - ServerActivator_var sa (ServerActivator::_narrow (obj)); - - if (CORBA::is_nil (sa.in ())) - { - CIAO_DEBUG (6, (LM_ERROR, CLINFO - "ComponentServer_Task::svc - " - "Failed to narrow callback IOR [%s]\n", - this->callback_ior_str_.c_str ())); - throw Error ("Failed to narrow callback IOR"); - } - - Components::ConfigValues_var config; - { - Components::ConfigValues *cf = 0; - ACE_NEW_NORETURN (cf, Components::ConfigValues (0)); - - if (cf == 0) - { - CIAO_ERROR (1, (LM_CRITICAL, "ComponentServer_Task::run - " - "Out of memory error while allocating config values.")); - } - else - { - config = cf; - } - } - - // Make callback. - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "ComponentServer_Task::svc - " - "Making callback on my ServerActivator\n")); - - try - { - // Callback to NodeApplication to get configuration - sa->component_server_callback (cs.in (), - this->uuid_.c_str (), - config.out ()); - - CIAO_DEBUG (9, (LM_TRACE, CLINFO "ComponentServer_Task::svc - " - "Configuration received\n")); - // @@WO: Probably need to do something with these config values. - - ci_srv->init (sa.in (), config._retn ()); - - CIAO_DEBUG (6, (LM_NOTICE, CLINFO "ComponentServer_Task::svc - " - "Configuration complete for component server %C\n", - this->uuid_.c_str ())); - - sa->configuration_complete (this->uuid_.c_str ()); - } - catch (const ::CORBA::BAD_PARAM &) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO "ComponentServer_Task::svc - " - "The Callback IOR provided pointed to the " - "wrong ServerActivator\n")); - throw Error ("Bad callback IOR"); - } - catch (const ::CORBA::Exception &ex) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO "ComponentServer_Task::svc - " - "Caught CORBA Exception %C\n", - ex._info().c_str ())); - throw Error ("Caught exception while calling back"); - } - catch (...) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO "ComponentServer_Task::svc - " - "Caught exception while calling back\n")); - throw Error ("Caught exception while calling back"); - } - - } - else - { - CIAO_DEBUG (9, (LM_TRACE, CLINFO "ComponentServer_Task::svc - " - "Initializing ComponentServer without ServantActivator " - "callback\n")); - ci_srv->init (0, 0); - } - - this->orb_->run (); - - CIAO_DEBUG (9, (LM_TRACE, CLINFO "ComponentServer_Task::svc - " - "ORB Event loop completed.\n")); - - root_poa->destroy (1, 1); - - this->orb_->destroy (); - - return 0; - } - - void - ComponentServer_Task::run (void) - { - CIAO_TRACE ("ComponentServer_Task::run"); - - CIAO_DEBUG (6, (LM_DEBUG, CLINFO "ComponentServer_Task::run - Starting ORB\n")); - this->svc (); - CIAO_DEBUG (6, (LM_INFO, - CLINFO "ComponentServer_Task::run - ORB has " - "shutdown, terminating ComponentServer\n")); - } - - void - ComponentServer_Task::parse_args (int argc, ACE_TCHAR **argv) - { - CIAO_TRACE ("ComponentServer_Task::parse_args"); - - CIAO_DEBUG (9, (LM_TRACE, CLINFO "ComponentServer_Task::parse_args - " - "parsing arguments...\n")); - - ACE_Get_Opt opts (argc, argv, ACE_TEXT("hu:c:"), 1, 0, - ACE_Get_Opt::RETURN_IN_ORDER); - opts.long_option (ACE_TEXT("uuid"), 'u', ACE_Get_Opt::ARG_REQUIRED); - opts.long_option (ACE_TEXT("callback-ior"), 'c', ACE_Get_Opt::ARG_REQUIRED); - opts.long_option (ACE_TEXT("help"), 'h'); - opts.long_option (ACE_TEXT("log-level"),'l', ACE_Get_Opt::ARG_REQUIRED); - opts.long_option (ACE_TEXT("trace"),'t', ACE_Get_Opt::NO_ARG); - opts.long_option (ACE_TEXT("output-ior"),'o', ACE_Get_Opt::ARG_REQUIRED); - - int c = 0; - while ((c = opts ()) != -1) - { - CIAO_DEBUG (9, (LM_TRACE, CLINFO "ComponentServer_Task::parse_args - " - "Found option: \"%s\" with argument \"%s\"\n", - opts.last_option (), opts.opt_arg ())); - - switch (c) - { - case 'u': - CIAO_DEBUG (6, (LM_DEBUG, CLINFO "ComponentServer_Task::parse_args - " - "uuid is %s\n", - opts.opt_arg ())); - this->uuid_ = ACE_TEXT_ALWAYS_CHAR (opts.opt_arg ()); - break; - - case 'c': - CIAO_DEBUG (6, (LM_DEBUG, CLINFO "ComponentServer_Task::parse_args - " - "callback ior is %s\n", - opts.opt_arg ())); - this->callback_ior_str_ = opts.opt_arg (); - break; - - case 'l': - { - continue; // no-op, already taken care of - } - - case 't': - continue; // already taken care of - - case 'o': - CIAO_DEBUG (6, (LM_DEBUG, CLINFO "ComponentServer_Task::parse_args - " - "IOR Output file: %s\n", - opts.opt_arg ())); - this->output_file_ = opts.opt_arg (); - break; - - case 'h': - this->usage (); - throw Error ("Command line help requested, bailing out...."); - - default: - CIAO_ERROR (1, (LM_ERROR, CLINFO " Unknown option: %s\n", - opts.last_option ())); - this->usage (); - ACE_CString err ("Unknown option "); - err += ACE_TEXT_ALWAYS_CHAR (opts.last_option ()); - throw Error (err); - } - } - - // check required options. - if (this->uuid_ == "") - throw Error ("Option required: -u|--uuid"); - if (this->callback_ior_str_ == ACE_TEXT("")) - { - CIAO_ERROR (1, (LM_WARNING, CLINFO - "ComponentServer_Task::parse_args - Starting ComponentServer without a callback IOR\n")); - } - } - - void - ComponentServer_Task::usage (void) - { - CIAO_TRACE ("ComponentServer_Task::usage"); - // Shouldn't be subject to CIAO's logging policy - ACE_ERROR ((LM_EMERGENCY, "Usage: CIAO_ComponentServer <options>\n" - "Options:\n" - "\t-h|--help\t\t\t\tShow help\n" - "\t-l|--log-level <level>\t\t\tSets log level (default 5). 1 - most detailed.\n" - "\t-u|--uuid <uuid> \t\t\tSets UUID of spawned component server (required)\n" - "\t-c|--callback-ior <string ior>\t\tSets callback url for the spawning ServerActivator.\n" - "\t-o|--output-ior <filename>\t\tOutputs the IOR of the component server object to file\n" - )); - - } - } -} - - diff --git a/CIAO/ciao/ComponentServer/CIAO_ComponentServer_Task.h b/CIAO/ciao/ComponentServer/CIAO_ComponentServer_Task.h deleted file mode 100644 index ba3f00d5c31..00000000000 --- a/CIAO/ciao/ComponentServer/CIAO_ComponentServer_Task.h +++ /dev/null @@ -1,50 +0,0 @@ -// $Id$ -/** - * @file CIAO_ComponentServer_Task.h - * @author William R. Otte - * - * Defines interface for the bootstrap element of the CIAO Component - * Server. - */ - -#ifndef CIAO_COMPONENTSERVER_TASK_H_ -#define CIAO_COMPONENTSERVER_TASK_H_ - -#include "ace/String_Base.h" -#include "ace/Task.h" -#include "tao/ORB.h" - -namespace CIAO -{ - namespace Deployment - { - class ComponentServer_Task : ACE_Task_Base - { - public: - ComponentServer_Task (int argc, ACE_TCHAR **argv); - - int svc (void); - - struct Error - { - Error (const ACE_CString &err); - ACE_CString err_; - }; - - void run (void); - - private: - void parse_args (int argc, ACE_TCHAR **argv); - - void usage (void); - - CORBA::ORB_var orb_; - - ACE_CString uuid_; - ACE_TString callback_ior_str_; - ACE_TString output_file_; - }; - } -} - -#endif diff --git a/CIAO/ciao/ComponentServer/CIAO_Container_Impl.cpp b/CIAO/ciao/ComponentServer/CIAO_Container_Impl.cpp deleted file mode 100644 index 20752532008..00000000000 --- a/CIAO/ciao/ComponentServer/CIAO_Container_Impl.cpp +++ /dev/null @@ -1,490 +0,0 @@ -// $Id$ -#include "CIAO_Container_Impl.h" - -#include "ace/Log_Msg.h" -#include "ccm/CCM_HomeC.h" -#include "CIAO_PropertiesC.h" -#include "CIAO_CS_ClientC.h" -#include "Client_init.h" -#include "ciao/Logger/Log_Macros.h" - -namespace CIAO -{ - namespace Deployment - { - // Constructor - CIAO_Container_i::CIAO_Container_i (const Components::ConfigValues &config, - const Static_Config_EntryPoints_Maps *static_entrypts, - const char *name, - const CORBA::PolicyList *policies, - Components::Deployment::ComponentInstallation_ptr ci, - CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa) - : orb_ (CORBA::ORB::_duplicate (orb)), - poa_ (PortableServer::POA::_duplicate (poa)), - config_ (config.length ()), - static_entrypts_maps_ (static_entrypts), - ci_ (Components::Deployment::ComponentInstallation::_duplicate (ci)) - { - CIAO_TRACE("CIAO_Container_i::CIAO_Container_i"); - - for (CORBA::ULong i = 0; i < config.length (); ++i) - { - this->config_[i] = config[i]; - } - - try - { - if (this->static_entrypts_maps_ == 0) - { - CIAO_DEBUG (6, (LM_DEBUG, CLINFO "CIAO_Container_i: creating Session container with dynamic linkage\n")); - this->container_ = new CIAO::Session_Container (this->orb_.in (), this->poa_.in (), this, false, - 0, name, policies); - } - else - { - CIAO_DEBUG (6, (LM_DEBUG, CLINFO "CIAO_Container_i: creating Session container with static linkage\n")); - this->container_ = new CIAO::Session_Container (this->orb_.in (), this->poa_.in (), this, true, - this->static_entrypts_maps_, - name, policies); - } - } - catch (...) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO "CIAO_Container_i::CIAO_Container_i - " - "Caught exception while allocating container implementation\n")); - throw; - } - } - - - // Destructor - CIAO_Container_i::~CIAO_Container_i (void) - { - CIAO_TRACE("CIAO_Container_i::~CIAO_Container_i"); - } - - ::Components::CCMObject_ptr - CIAO_Container_i::install_component (const char * id, - const char * entrypt, - const ::Components::ConfigValues & config) - { - CIAO_TRACE("CIAO_Container_i::install_component"); - - if (!id) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO "CIAO_Container_i::install_component - " - "No home ID provided\n")); - throw ::Components::Deployment::InvalidConfiguration (); - } - - Components::CCMObject_var comp; - - if (this->component_map_.find (id, comp) == 0) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO "CIAO_Container_i::install_component - " - "Component with id %C already installed, aborting\n", - id)); - throw Components::CreateFailure (); - } - - if (!entrypt) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO "CIAO_Container_i::install_component - " - "No executor entrypoint found.\n")); - throw ::Components::Deployment::InvalidConfiguration (); - } - - CIAO_DEBUG (6, (LM_INFO, CLINFO "CIAO_Container_i::install_component - " - "Attempting to install home with id [%C]\n", - id)); - - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "CIAO_Container_i::install_component - " - "Extracting ConfigValues from sequence of length [%u]\n", - config.length ())); - - CIAO::Utility::CONFIGVALUE_MAP cm; - CIAO::Utility::build_config_values_map (cm, config); - CORBA::Any val; - - const char *tmp = 0; - CORBA::String_var exec_art, svnt_art, svnt_entry; - - if (cm.find (SVNT_ENTRYPT, val) == 0) - { - val >>= tmp; - svnt_entry = tmp; - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "CIAO_Container_i::install_component - " - "Found Servant entrypoint %C\n", svnt_entry.in ())); - } - else - { - CIAO_ERROR (1, (LM_ERROR, CLINFO - "CIAO_Container_i::install_component - " - "Error: No Servant entrypoint provided, aborting installation\n")); - throw Components::InvalidConfiguration (); - } - - if (cm.find (SVNT_ARTIFACT, val) == 0) - { - val >>= tmp; - svnt_art = this->ci_->get_implementation (tmp); - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "CIAO_Container_i::install_component - " - "Found Servant artifact %C\n", svnt_art.in ())); - } - else - { - CIAO_ERROR (1, (LM_ERROR, CLINFO - "CIAO_Container_i::install_component - " - "Error: No Servant artifact provided, aborting installation\n")); - throw Components::InvalidConfiguration (); - } - - - if (cm.find (EXEC_ARTIFACT, val) == 0) - { - val >>= tmp; - exec_art = this->ci_->get_implementation (tmp); - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "CIAO_Container_i::install_component - " - "Found executor artifact: %C\n", exec_art.in ())); - } - else - { - CIAO_ERROR (1, (LM_ERROR, CLINFO - "CIAO_Container_i::install_component - " - "Error: No Executor artifact provided, aborting installation\n")); - } - - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "CIAO_Container_i::install_component - " - "Extraction resulted in map of [%u] values\n", cm.current_size ())); - - comp = this->container_->install_component (exec_art, - entrypt, - svnt_art, - svnt_entry, - id); - - if (this->component_map_.bind (id, - Components::CCMObject::_duplicate (comp.in ())) == -1) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO - "CIAO_Container_i::install_component - " - "Unable to bind componnet into component map\n")); - } - - return comp._retn (); - } - - void - CIAO_Container_i::remove_component (::Components::CCMObject_ptr cref) - { - CIAO_TRACE("CIAO_Container_i::remove_component"); - - Component_Iterator i = this->component_map_.begin (); - while (!i.done ()) - { - if (i->item ()->_is_equivalent (cref)) - { - CIAO_DEBUG (9, (LM_TRACE, CLINFO "CIAO_Container_i::remove_component - " - "Successfully found matching component\n")); - break; - } - i.advance (); - } - - if (i.done ()) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO "CIAO_Container_i::remove_component - " - "Unable to find matching component managed by this container, throwing RemoveFailure\n")); - throw Components::RemoveFailure (); - } - - if (!CORBA::is_nil (this->container_.in ())) - { - CIAO_DEBUG (9, (LM_TRACE, CLINFO "CIAO_Container_i::remove_component - " - "Invoking remove on the container impl for component %C.\n", - i->key ().c_str ())); - this->container_->uninstall_component (cref); - CIAO_DEBUG (6, (LM_INFO, CLINFO "CIAO_Container_i::remove_component - " - "Successfully removed component %C\n", - i->key ().c_str ())); - } - - if (this->component_map_.unbind (i->key ()) != 0) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO "CIAO_Container_i::remove_component - " - "Unable to unbind removed component with id %C from component map\n", - i->key ().c_str ())); - } - } - - ::Components::CCMObjectSeq * - CIAO_Container_i::get_components (void) - { - CIAO_TRACE("CIAO_Container_i::get_components"); - throw CORBA::NO_IMPLEMENT (); - } - - ::Components::ConfigValues * - CIAO_Container_i::configuration (void) - { - CIAO_TRACE("CIAO_Container_i::configuration"); - throw CORBA::NO_IMPLEMENT (); - } - - ::Components::Deployment::ComponentServer_ptr - CIAO_Container_i::get_component_server (void) - { - CIAO_TRACE("CIAO_Container_i::get_component_server"); - throw CORBA::NO_IMPLEMENT (); - } - - ::Components::CCMHome_ptr - CIAO_Container_i::install_home (const char * id, - const char * entrypt, - const ::Components::ConfigValues & config) - { - CIAO_TRACE("CIAO_Container_i::install_home"); - - if (!id) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO "CIAO_Container_i::install_home - " - "No home ID provided\n")); - throw ::Components::Deployment::InvalidConfiguration (); - } - - Components::CCMHome_var home; - - if (this->home_map_.find (id, home) == 0) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO "CIAO_Container_i::install_home - " - "Home with id %C already installed, aborting\n", - id)); - throw Components::CreateFailure (); - } - - if (!entrypt) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO "CIAO_Container_i::install_home - " - "No executor entrypoint found.\n")); - throw ::Components::Deployment::InvalidConfiguration (); - } - - CIAO_DEBUG (6, (LM_INFO, CLINFO "CIAO_Container_i::install_home - " - "Attempting to install home with id [%C]\n", id)); - - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "CIAO_Container_i::install_home - " - "Extracting ConfigValues from sequence of length [%u]\n", - config.length ())); - - CIAO::Utility::CONFIGVALUE_MAP cm; - CIAO::Utility::build_config_values_map (cm, config); - CORBA::Any val; - - const char *tmp = 0; - CORBA::String_var exec_art, svnt_art, svnt_entry; - if (cm.find (SVNT_ENTRYPT, val) == 0) - { - val >>= tmp; - svnt_entry = tmp; - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "CIAO_Container_i::install_home - " - "Found Servant entrypoint %C\n", svnt_entry.in ())); - } - else - { - CIAO_ERROR (1, (LM_ERROR, CLINFO - "CIAO_Container_i::install_home - " - "Error: No Servant entrypoint provided, aborting installation\n")); - throw Components::InvalidConfiguration (); - } - - if (cm.find (SVNT_ARTIFACT, val) == 0) - { - val >>= tmp; - svnt_art = this->ci_->get_implementation (tmp); - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "CIAO_Container_i::install_home - " - "Found Servant artifact %C\n", svnt_art.in ())); - } - else - { - CIAO_ERROR (1, (LM_ERROR, CLINFO - "CIAO_Container_i::install_home - " - "Error: No Servant artifact provided, aborting installation\n")); - throw Components::InvalidConfiguration (); - } - - - if (cm.find (EXEC_ARTIFACT, val) == 0) - { - val >>= tmp; - exec_art = this->ci_->get_implementation (tmp); - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "CIAO_Container_i::install_home - " - "Found executor artifact: %C\n", exec_art.in ())); - } - else - { - CIAO_ERROR (1, (LM_ERROR, CLINFO - "CIAO_Container_i::install_home - " - "Error: No Executor artifact provided, aborting installation\n")); - } - - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "CIAO_Container_i::install_home - " - "Extraction resulted in map of [%u] values\n", cm.current_size ())); - - - // extract config values here... - - //CIAO_DEBUG (6, (LM_DEBUG, CLINFO "CIAO_Container_i::install_home - ", - //"Executor entrypoint [%C], servant entrypoint [%C], servant library [%C]\n", - //entrypt, svnt_entrypt.in (), svnt_library.in ())); - - home = this->container_->install_home (exec_art, - entrypt, - svnt_art, - svnt_entry, - id); - - if (this->home_map_.bind (id, - Components::CCMHome::_duplicate (home.in ())) == -1) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO - "CIAO_Container_i::install_home - " - "Unable to bind home into home map\n")); - } - - return home._retn (); - } - - void - CIAO_Container_i::remove_home (::Components::CCMHome_ptr href) - { - CIAO_TRACE("CIAO_Container_i::remove_home"); - - Home_Iterator i = this->home_map_.begin (); - while (!i.done ()) - { - if (i->item ()->_is_equivalent (href)) - { - CIAO_DEBUG (9, (LM_TRACE, CLINFO "CIAO_Container_i::remove_home - " - "Successfully found matching home\n")); - break; - } - i.advance (); - } - - if (i.done ()) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO "CIAO_Container_i::remove_home - " - "Unable to find matching home managed by this container, throwing RemoveFailure\n")); - throw Components::RemoveFailure (); - } - - CIAO_DEBUG (9, (LM_TRACE, CLINFO "CIAO_Container_i::remove_home - " - "Invoking remove on the container impl for home %C.\n", - i->key ().c_str ())); - this->container_->uninstall_home (href); - CIAO_DEBUG (6, (LM_INFO, CLINFO "CIAO_Container_i::remove_home - " - "Successfully removed home %C\n", - i->key ().c_str ())); - - if (this->home_map_.unbind (i->key ()) != 0) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO "CIAO_Container_i::remove_home - " - "Unable to unbind removed home with id %C from home map\n", - i->key ().c_str ())); - } - } - - ::Components::CCMHomes * - CIAO_Container_i::get_homes (void) - { - CIAO_TRACE("CIAO_Container_i::get_homes"); - - ::Components::CCMHomes *tmp_homes = 0; - - ACE_NEW_THROW_EX (tmp_homes, - ::Components::CCMHomes (this->home_map_.current_size ()), - CORBA::NO_MEMORY ()); - - ::Components::CCMHomes_var retval (tmp_homes); - retval->length (this->home_map_.current_size ()); - Home_Iterator i = this->home_map_.begin (); - CORBA::ULong pos = 0; - while (!i.done ()) - { - retval[pos++] = ::Components::CCMHome::_duplicate (i->item ().in ()); - i.advance (); - } - - return retval._retn (); - } - - void - CIAO_Container_i::remove (void) - { - CIAO_TRACE("CIAO_Container_i::remove"); - - if (this->home_map_.current_size () != 0 || - this->component_map_.current_size () != 0) - { - CIAO_ERROR (1, (LM_WARNING, CLINFO "CIAO_Container_i::remove - " - "Attempting to remove container that still has %u homes and %u components installed\n", - this->home_map_.current_size (), - this->component_map_.current_size ())); - } - } - - void - CIAO_Container_i::activate_component (::Components::CCMObject_ptr comp) - { - CIAO_TRACE ("CIAO_Container_i::activate_component"); - - this->container_->activate_component (comp); - } - - - void - CIAO_Container_i::passivate_component (::Components::CCMObject_ptr comp) - { - CIAO_TRACE ("CIAO_Container_i::passivate_component"); - - this->container_->passivate_component (comp); - } - - PortableServer::POA_ptr - CIAO_Container_i::_default_POA (void) - { - CIAO_TRACE ("CIAO_Container_i::_default_POA"); - return PortableServer::POA::_duplicate (this->poa_.in ()); - } - - void CIAO_Container_i::connect_local_facet (::Components::CCMObject_ptr provider, - const char * provider_port, - ::Components::CCMObject_ptr user, - const char * user_port) - { - CIAO_TRACE ("CIAO_Container_i::connect_local_facet"); - this->container_->connect_local_facet (provider, provider_port, user, user_port); - - } - - void CIAO_Container_i::disconnect_local_facet (::Components::CCMObject_ptr provider, - const char * provider_port, - ::Components::CCMObject_ptr user, - const char * user_port) - { - CIAO_TRACE ("CIAO_Container_i::connect_local_facet"); - this->container_->disconnect_local_facet (provider, provider_port, user, user_port); - } - } -} diff --git a/CIAO/ciao/ComponentServer/CIAO_Container_Impl.h b/CIAO/ciao/ComponentServer/CIAO_Container_Impl.h deleted file mode 100644 index ea0b19e1a2d..00000000000 --- a/CIAO/ciao/ComponentServer/CIAO_Container_Impl.h +++ /dev/null @@ -1,129 +0,0 @@ -// $Id$ -/** - * @file CIAO_Container_Impl.h - * @author William R. Otte <wotte@dre.vanderbilt.edu> - */ - -#ifndef CIAO_CONTAINER_IMPL_H_ -#define CIAO_CONTAINER_IMPL_H_ - -#include "CIAO_ComponentServerS.h" -#include "CIAO_CS_ClientC.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ciao/Containers/Session/Session_Container.h" - -#include "CIAO_ComponentServer_svnt_export.h" - -namespace CIAO -{ - namespace Deployment - { - /** - * @class CIAO_Container - * @brief Implements external interface for CIAO container. - */ - class CIAO_COMPONENTSERVER_SVNT_Export CIAO_Container_i - : public virtual POA_CIAO::Deployment::Container - { - public: - /// Constructor - CIAO_Container_i (const Components::ConfigValues &config, - const Static_Config_EntryPoints_Maps *, - const char *name, - const CORBA::PolicyList *, - Components::Deployment::ComponentInstallation_ptr, - CORBA::ORB_ptr, - PortableServer::POA_ptr); - - /// Destructor - virtual ~CIAO_Container_i (void); - - virtual ::Components::CCMObject_ptr install_component ( - const char * id, - const char * entrypt, - const ::Components::ConfigValues & config); - - virtual void remove_component (::Components::CCMObject_ptr cref); - - virtual ::Components::CCMObjectSeq * get_components (void); - - virtual ::Components::ConfigValues * configuration (void); - - virtual - ::Components::Deployment::ComponentServer_ptr get_component_server (void); - - virtual ::Components::CCMHome_ptr install_home (const char * id, - const char * entrypt, - const ::Components::ConfigValues & config); - - virtual void remove_home (::Components::CCMHome_ptr href); - - virtual ::Components::CCMHomes * get_homes (void); - - virtual void remove (void); - - virtual void activate_component (::Components::CCMObject_ptr comp); - - virtual void passivate_component (::Components::CCMObject_ptr comp); - - virtual PortableServer::POA_ptr _default_POA (void); - - virtual void connect_local_facet (::Components::CCMObject_ptr provider, - const char * provider_port, - ::Components::CCMObject_ptr user, - const char * user_port); - - virtual void disconnect_local_facet (::Components::CCMObject_ptr provider, - const char * provider_port, - ::Components::CCMObject_ptr user, - const char * user_port); - - private: - /// Keep a pointer to the managing ORB serving this servant. - CORBA::ORB_var orb_; - - PortableServer::POA_var poa_; - - CIAO::Container_var container_; - - Components::ConfigValues config_; - - const Static_Config_EntryPoints_Maps* static_entrypts_maps_; - - /// To store all created CCMHome object - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - Components::CCMHome_var, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> CCMHome_Map; - - typedef CCMHome_Map::iterator Home_Iterator; - CCMHome_Map home_map_; - - /// To store all created Component object. - // @@Gan, see how this caching is duplicated.. - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - Components::CCMObject_var, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> CCMComponent_Map; - - typedef CCMComponent_Map::iterator Component_Iterator; - CCMComponent_Map component_map_; - - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - ACE_CString, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> CCMNaming_Map; - CCMNaming_Map naming_map_; - - Components::Deployment::ComponentInstallation_var ci_; - }; - } -} -#endif /* CIAO_CONTAINER_IMPL_H_ */ diff --git a/CIAO/ciao/ComponentServer/CIAO_RTComponentServer.cpp b/CIAO/ciao/ComponentServer/CIAO_RTComponentServer.cpp deleted file mode 100644 index 9501b81c4de..00000000000 --- a/CIAO/ciao/ComponentServer/CIAO_RTComponentServer.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @file CIAO_RTComponentServer.cpp - * - * $Id$ - * - * Implementation and main for CIAO_RTComponentServer. - */ - -#include "CIAO_RTComponentServer_Task.h" -#include "ace/Thread_Manager.h" -#include "ciao/Logger/Log_Macros.h" - -int ACE_TMAIN (int argc, ACE_TCHAR **argv) -{ - // Tracing disabled by default - CIAO_DISABLE_TRACE (); - - CIAO_TRACE ("CIAO_RTComponentServer::ACE_TMAIN"); - - int retval = 0; - try - { - CIAO::Deployment::RTComponentServer_Task cs (argc, argv); - cs.run (); - - // Wait for the threads to exit. - //ACE_Thread_Manager::instance ()->wait (); - } - catch (const CIAO::Deployment::RTComponentServer_Task::Error &e) - { - CIAO_DEBUG (6, (LM_ALERT, CLINFO "CIAO_RTComponentServer main: Caught ComponentServer exception: %C\n", - e.err_.c_str ())); - retval = -1; - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ("CIAO_RTComponentServer main: Caught corba exception:"); - retval = -1; - } - catch (...) - { - CIAO_DEBUG (6, (LM_ALERT, CLINFO "CIAO_RTComponentServer main: Caught unknown exception.\n")); - retval = -1; - } - - return retval; -} - diff --git a/CIAO/ciao/ComponentServer/CIAO_RTComponentServer_Task.cpp b/CIAO/ciao/ComponentServer/CIAO_RTComponentServer_Task.cpp deleted file mode 100644 index 4fadbf8b1b5..00000000000 --- a/CIAO/ciao/ComponentServer/CIAO_RTComponentServer_Task.cpp +++ /dev/null @@ -1,429 +0,0 @@ -/** - * @file CIAO_RTComponentServer_Task.cpp - * @author Johnny Willemsen <jwillemsen@remedy.nl> - * $Id$ - * - * Implementation and main for CIAO_RTComponentServer. - */ - -#include "CIAO_RTComponentServer_Task.h" - -#include "ace/OS_NS_string.h" -#include "ace/Log_Msg.h" -#include "ace/Get_Opt.h" -#include "tao/ORB.h" -#include "tao/PortableServer/PortableServer.h" -#include "tao/RTPortableServer/RTPortableServer.h" -#include "ciao/Logger/Logger_Service.h" -#include "ciao/Logger/Log_Macros.h" -#include "CIAO_ComponentServer_Impl.h" -#include "Server_init.h" -#include "tao/RTCORBA/Priority_Mapping_Manager.h" -#include "tao/Protocols_Hooks.h" -#include "tao/ORB_Core.h" - -namespace CIAO -{ - namespace Deployment - { - CORBA::Short - get_implicit_thread_CORBA_priority (CORBA::ORB_ptr orb) - { - CORBA::Object_var obj = - orb->resolve_initial_references (TAO_OBJID_PRIORITYMAPPINGMANAGER); - - TAO_Priority_Mapping_Manager_var mapping_manager = - TAO_Priority_Mapping_Manager::_narrow (obj.in ()); - - if (CORBA::is_nil (mapping_manager.in ())) - throw CORBA::INTERNAL (); - - RTCORBA::PriorityMapping *pm = - mapping_manager.in ()->mapping (); - - TAO_Protocols_Hooks *tph = - orb->orb_core ()->get_protocols_hooks (); - - CORBA::Short corba_priority; - CORBA::Short native_priority; - - if (tph->get_thread_native_priority (native_priority) == 0 && - pm->to_CORBA (native_priority, corba_priority)) - { - return corba_priority; - } - - ACE_DEBUG ((LM_DEBUG, "get_implicit_thread_CORBA_priority - failed to access priority\n")); - throw CORBA::DATA_CONVERSION (CORBA::OMGVMCID | 2, CORBA::COMPLETED_NO); - } - - RTComponentServer_Task::Error::Error(const ACE_CString &err) : err_(err) - { - } - - RTComponentServer_Task::RTComponentServer_Task (int argc, ACE_TCHAR **argv) : - static_threads_ (0), - dynamic_threads_ (0) - { - CIAO_TRACE ("CIAO_RTComponentServer_Task::CIAO_RTComponentServer_Task"); - - Logger_Service - *clf = ACE_Dynamic_Service<Logger_Service>::instance ("CIAO_Logger"); - - if (clf) - { - clf->init (argc, argv); - } - - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "CIAO_RTComponentServer_Task::CIAO_RTComponentServer_Task - " - "Creating ORB\n")); - - this->orb_ = CORBA::ORB_init (argc, argv); - - this->parse_args (argc, argv); - - CIAO::Server_init (this->orb_.in ()); - - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "CIAO_RTComponentServer_Task::CIAO_RTComponentServer_Task - " - "CIAO_ComponentServer object created.\n")); - } - - int - RTComponentServer_Task::svc (void) - { - CIAO_TRACE ("RTComponentServer_Task::svc"); - - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "RTComponentServer_Task::svc - " - "Activating the root POA\n")); - - CORBA::Object_var object = - this->orb_->resolve_initial_references ("RootPOA"); - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (object.in ()); - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (); - - poa_manager->activate (); - - object = - this->orb_->resolve_initial_references ("RTORB"); - - RTCORBA::RTORB_var rt_orb = - RTCORBA::RTORB::_narrow (object.in ()); - CORBA::ULong stacksize = 0; - CORBA::Boolean allow_request_buffering = false; - CORBA::ULong max_buffered_requests = 0; - CORBA::ULong max_request_buffer_size = 0; - - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "RTComponentServer_Task::svc - " - "Creating server implementation object\n")); - - CORBA::PolicyList policies (0); - - if (this->static_threads_ > 0) - { - object = - this->orb_->resolve_initial_references ("RTCurrent"); - - RTCORBA::Current_var current = - RTCORBA::Current::_narrow (object.in ()); - - RTCORBA::Priority default_thread_priority = - get_implicit_thread_CORBA_priority (this->orb_.in ()); - - RTCORBA::ThreadpoolId threadpool_id_1 = - rt_orb->create_threadpool (stacksize, - this->static_threads_, - this->dynamic_threads_, - default_thread_priority, - allow_request_buffering, - max_buffered_requests, - max_request_buffer_size); - - CORBA::Policy_var threadpool_policy_1 = - rt_orb->create_threadpool_policy (threadpool_id_1); - - policies.length (2); - policies[0] = - CORBA::Policy::_duplicate (threadpool_policy_1); - - policies[1] = - rt_orb->create_priority_model_policy (RTCORBA::SERVER_DECLARED, - 0); - } - - // Create the POA under the RootPOA. - PortableServer::POA_var poa = - root_poa->create_POA ("RTPOA", - poa_manager, - policies); - - // Creation of POAs is over. Destroy the Policy objects. - for (CORBA::ULong i = 0; - i < policies.length (); - ++i) - { - policies[i]->destroy (); - } - - CIAO::Deployment::CIAO_ComponentServer_i *ci_srv = 0; - ACE_NEW_NORETURN (ci_srv, - CIAO_ComponentServer_i (this->uuid_, - this->orb_.in (), - poa.in ())); - - if (ci_srv == 0) - { - CIAO_ERROR (1, (LM_CRITICAL, - "RTComponentServer_Task::run - " - "Out of memory error while allocating servant.")); - throw Error ("Out of memory whilst allocating servant."); - } - - PortableServer::ServantBase_var safe (ci_srv); - - PortableServer::ObjectId_var id = - poa->activate_object (ci_srv); - CORBA::Object_var cs_object = poa->id_to_reference (id.in ()); - ComponentServer_var cs = - ComponentServer::_narrow (cs_object.in ()); - - if (this->output_file_ != ACE_TEXT("")) - { - CORBA::String_var ior = this->orb_->object_to_string (cs.in ()); - ::CIAO::Utility::write_IOR (this->output_file_.c_str (), ior.in ()); - } - - - if (this->callback_ior_str_ != ACE_TEXT("")) - { - CIAO_DEBUG (9, (LM_TRACE, CLINFO "RTComponentServer_Task::run - " - "Resolving callback IOR\n")); - CORBA::Object_var obj = - this->orb_->string_to_object (this->callback_ior_str_.c_str ()); - ServerActivator_var sa (ServerActivator::_narrow (obj)); - - if (CORBA::is_nil (sa.in ())) - { - CIAO_DEBUG (6, (LM_ERROR, CLINFO - "RTComponentServer_Task::svc - " - "Failed to narrow callback IOR\n")); - throw Error ("Failed to narrow callback IOR"); - } - - Components::ConfigValues_var config; - { - Components::ConfigValues *cf = 0; - ACE_NEW_NORETURN (cf, Components::ConfigValues (0)); - - if (cf == 0) - { - CIAO_ERROR (1, (LM_CRITICAL, "RTComponentServer_Task::run - " - "Out of memory error while allocating config values.")); - } - else - { - config = cf; - } - } - - // Make callback. - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "RTComponentServer_Task::svc - " - "Making callback on my ServerActivator\n")); - - try - { - // Callback to NodeApplication to get configuration - sa->component_server_callback (cs.in (), - this->uuid_.c_str (), - config.out ()); - - CIAO_DEBUG (9, (LM_TRACE, CLINFO "RTComponentServer_Task::svc - " - "Configuration received\n")); - // @@WO: Probably need to do something with these config values. - - ci_srv->init (sa.in (), config._retn ()); - - CIAO_DEBUG (6, (LM_NOTICE, CLINFO "RTComponentServer_Task::svc - " - "Configuration complete for component server %C\n", - this->uuid_.c_str ())); - - sa->configuration_complete (this->uuid_.c_str ()); - } - catch (const CORBA::BAD_PARAM &) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO "RTComponentServer_Task::svc - " - "The Callback IOR provided pointed to the " - "wrong ServerActivator\n")); - throw Error ("Bad callback IOR"); - } - catch (const ::CORBA::Exception &ex) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO "RTComponentServer_Task::svc - " - "Caught CORBA Exception %C\n", - ex._info().c_str ())); - throw Error ("Caught exception while calling back"); - } - catch (...) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO "RTComponentServer_Task::svc - " - "Caught exception while calling back\n")); - throw Error ("Caught exception while calling back"); - } - - } - else - { - CIAO_DEBUG (9, (LM_TRACE, CLINFO "RTComponentServer_Task::svc - " - "Initializing ComponentServer without ServantActivator " - "callback\n")); - ci_srv->init (0, 0); - } - - this->orb_->run (); - - CIAO_DEBUG (9, (LM_TRACE, CLINFO "RTComponentServer_Task::svc - " - "ORB Event loop completed.\n")); - - root_poa->destroy (1, 1); - - this->orb_->destroy (); - - return 0; - } - - void - RTComponentServer_Task::run (void) - { - CIAO_TRACE ("RTComponentServer_Task::run"); - - CIAO_DEBUG (6, (LM_DEBUG, CLINFO "RTComponentServer_Task::run - Starting ORB\n")); - this->svc (); - CIAO_DEBUG (6, (LM_INFO, - CLINFO "RTComponentServer_Task::run - ORB has " - "shutdown, terminating ComponentServer\n")); - } - - void - RTComponentServer_Task::parse_args (int argc, ACE_TCHAR **argv) - { - CIAO_TRACE ("RTComponentServer_Task::parse_args"); - - CIAO_DEBUG (9, (LM_TRACE, CLINFO "RTComponentServer_Task::parse_args - " - "parsing arguments...\n")); - - ACE_Get_Opt opts (argc, argv, ACE_TEXT("hu:c:s:d:"), 1, 0, - ACE_Get_Opt::RETURN_IN_ORDER); - opts.long_option (ACE_TEXT("uuid"), 'u', ACE_Get_Opt::ARG_REQUIRED); - opts.long_option (ACE_TEXT("callback-ior"), 'c', ACE_Get_Opt::ARG_REQUIRED); - opts.long_option (ACE_TEXT("help"), 'h'); - opts.long_option (ACE_TEXT("log-level"),'l', ACE_Get_Opt::ARG_REQUIRED); - opts.long_option (ACE_TEXT("trace"),'t', ACE_Get_Opt::NO_ARG); - opts.long_option (ACE_TEXT("output-ior"),'o', ACE_Get_Opt::ARG_REQUIRED); - opts.long_option (ACE_TEXT("static"),'s', ACE_Get_Opt::ARG_REQUIRED); - opts.long_option (ACE_TEXT("dynamic"),'d', ACE_Get_Opt::ARG_REQUIRED); - - int c = 0; - while ((c = opts ()) != -1) - { - CIAO_DEBUG (9, (LM_TRACE, CLINFO "RTComponentServer_Task::parse_args - " - "Found option: \"%s\" with argument \"%s\"\n", - opts.last_option (), opts.opt_arg ())); - - switch (c) - { - case 's': - this->static_threads_ = ACE_OS::atoi (opts.opt_arg ()); - CIAO_DEBUG (6, (LM_DEBUG, CLINFO "RTComponentServer_Task::parse_args - " - "Using %d static threads\n", - this->static_threads_)); - break; - - case 'd': - this->dynamic_threads_ = ACE_OS::atoi (opts.opt_arg ()); - CIAO_DEBUG (6, (LM_DEBUG, CLINFO "RTComponentServer_Task::parse_args - " - "Using %d dynamic threads\n", - this->dynamic_threads_)); - break; - - case 'u': - CIAO_DEBUG (6, (LM_DEBUG, CLINFO "RTComponentServer_Task::parse_args - " - "uuid is %s\n", - opts.opt_arg ())); - this->uuid_ = ACE_TEXT_ALWAYS_CHAR (opts.opt_arg ()); - break; - - case 'c': - CIAO_DEBUG (6, (LM_DEBUG, CLINFO "RTComponentServer_Task::parse_args - " - "callback ior is %s\n", - opts.opt_arg ())); - this->callback_ior_str_ = opts.opt_arg (); - break; - - case 'l': - { - continue; // no-op, already taken care of - } - - case 't': - continue; // already taken care of - - case 'o': - CIAO_DEBUG (6, (LM_DEBUG, CLINFO "RTComponentServer_Task::parse_args - " - "IOR Output file: %s\n", - opts.opt_arg ())); - this->output_file_ = opts.opt_arg (); - break; - - case 'h': - this->usage (); - throw Error ("Command line help requested, bailing out...."); - - default: - CIAO_ERROR (1, (LM_ERROR, CLINFO " Unknown option: %s\n", - opts.last_option ())); - this->usage (); - ACE_CString err ("Unknown option "); - err += ACE_TEXT_ALWAYS_CHAR (opts.last_option ()); - throw Error (err); - } - } - - // check required options. - if (this->uuid_ == "") - throw Error ("Option required: -u|--uuid"); - if (this->callback_ior_str_ == ACE_TEXT("")) - { - CIAO_ERROR (1, (LM_WARNING, CLINFO - "RTComponentServer_Task::parse_args - Starting ComponentServer without a callback IOR\n")); - } - } - - void - RTComponentServer_Task::usage (void) - { - CIAO_TRACE ("RTComponentServer_Task::usage"); - // Shouldn't be subject to CIAO's logging policy - ACE_ERROR ((LM_EMERGENCY, "Usage: CIAO_ComponentServer <options>\n" - "Options:\n" - "\t-h|--help\t\t\t\tShow help\n" - "\t-l|--log-level <level>\t\t\tSets log level (default 5). 1 - most detailed.\n" - "\t-u|--uuid <uuid> \t\t\tSets UUID of spawned component server (required)\n" - "\t-c|--callback-ior <string ior>\t\tSets callback url for the spawning ServerActivator.\n" - "\t-o|--output-ior <filename>\t\tOutputs the IOR of the component server object to file\n" - "\t-s|--static <number>\t\tNumber of static threads to run\n" - "\t-d|--dynamic <number>\t\tNumber of dynamic threads to run\n" - )); - - } - } -} - - diff --git a/CIAO/ciao/ComponentServer/CIAO_RTComponentServer_Task.h b/CIAO/ciao/ComponentServer/CIAO_RTComponentServer_Task.h deleted file mode 100644 index 4212bcb7751..00000000000 --- a/CIAO/ciao/ComponentServer/CIAO_RTComponentServer_Task.h +++ /dev/null @@ -1,54 +0,0 @@ -// $Id$ -/** - * @file CIAO_RTComponentServer_Task.h - * @author William R. Otte - * - * Defines interface for the bootstrap element of the CIAO Component - * Server. - */ - -#ifndef CIAO_COMPONENTSERVER_TASK_H_ -#define CIAO_COMPONENTSERVER_TASK_H_ - -#include "ace/String_Base.h" -#include "ace/Task.h" -#include "tao/ORB.h" -#include "tao/RTPortableServer/RTPortableServer.h" - -namespace CIAO -{ - namespace Deployment - { - class RTComponentServer_Task : ACE_Task_Base - { - public: - RTComponentServer_Task (int argc, ACE_TCHAR **argv); - - int svc (void); - - struct Error - { - Error (const ACE_CString &err); - ACE_CString err_; - }; - - void run (void); - - private: - void parse_args (int argc, ACE_TCHAR **argv); - - void usage (void); - - CORBA::ORB_var orb_; - - ACE_CString uuid_; - ACE_TString callback_ior_str_; - ACE_TString output_file_; - - CORBA::ULong static_threads_; - CORBA::ULong dynamic_threads_; - }; - } -} - -#endif diff --git a/CIAO/ciao/ComponentServer/CIAO_ServerActivator_Impl.cpp b/CIAO/ciao/ComponentServer/CIAO_ServerActivator_Impl.cpp deleted file mode 100644 index 4c17f0fac0d..00000000000 --- a/CIAO/ciao/ComponentServer/CIAO_ServerActivator_Impl.cpp +++ /dev/null @@ -1,510 +0,0 @@ -// $Id$ - -#include "CIAO_ServerActivator_Impl.h" -#include "ace/Log_Msg.h" -#include "ace/UUID.h" -#include "ciao/Logger/Log_Macros.h" - -#include "CIAO_FailureReasonsC.h" -#include "CIAO_ComponentServerC.h" -#include "CIAO_PropertiesC.h" - -namespace CIAO -{ - namespace Deployment - { - CIAO_ServerActivator_i::CIAO_ServerActivator_i (CORBA::ULong def_spawn_delay, - const char * default_cs_path, - const char * cs_args, - bool multithreaded, - Components::Deployment::ComponentInstallation_ptr ci, - CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa) - : spawn_delay_ (def_spawn_delay), - multithreaded_ (multithreaded), - orb_ (CORBA::ORB::_duplicate (orb)), - poa_ (PortableServer::POA::_duplicate (poa)), - cs_path_ (default_cs_path), - cs_args_ (cs_args), - mutex_ (), - condition_ (mutex_), - ci_ (Components::Deployment::ComponentInstallation::_duplicate (ci)) - - { - CIAO_TRACE ("CIAO_ServerActivator_i::CIAO_ServerActivator_i"); - ACE_Utils::UUID_GENERATOR::instance ()->init (); - } - - CIAO_ServerActivator_i::~CIAO_ServerActivator_i(void) - { - } - - void - CIAO_ServerActivator_i::component_server_callback ( - ::Components::Deployment::ComponentServer_ptr serverref, - const char * server_UUID, - ::Components::ConfigValues_out config) - { - CIAO_TRACE("CIAO_ServerActivator_i::component_server_callback"); - - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "CIAO_ServerActivator_i::component_server_callback - " - "Received callback from ComponentServer %C\n", - server_UUID)); - - Server_Info *info = 0; - - for (SERVER_INFOS::iterator i (this->server_infos_.begin ()); - !i.done (); ++i) - { - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "CIAO_ServerActivator_i::component_server_callback - " - "Comparing %C with %C\n", (*i)->uuid_.c_str (), server_UUID)); - if ((*i)->uuid_ == server_UUID) - { - info = (*i).get (); - } - } - - if (!info) - { - CIAO_ERROR (1, (LM_WARNING, CLINFO - "CIAO_ServerActivator_i::component_server_callback - " - "Received callback from ComponentServer %C, which doesn't belong to me.\n", - server_UUID)); - throw ::CORBA::BAD_PARAM (); - } - - if (info->activated_) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO - "CIAO_ServerActivator_i::component_server_callback - " - "Received callback from ComponentServer %C, which has already been configured.\n", - server_UUID)); - throw ::CORBA::BAD_INV_ORDER (); - } - - if (!CORBA::is_nil (info->ref_)) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO - "CIAO_ServerActivator_i::component_server_callback - " - "Received callback from ComponentServer %C, which has already called back.\n", - server_UUID)); - throw ::CORBA::BAD_INV_ORDER (); - } - - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "CIAO_ServerActivator_i::component_server_callback - " - "Received callback from ComponentServer %C\n", - server_UUID)); - - info->ref_ = ::Components::Deployment::ComponentServer::_duplicate (serverref); - - this->create_component_server_config_values (*info, config); - - // @@TODO: May want to print out configvalues here. - CIAO_DEBUG (6, (LM_DEBUG, CLINFO - "CIAO_ServerActivator_i::component_server_callback - " - "Generated %u ConfigValues for ComponentServer %C\n", - config->length (), server_UUID)); - } - - void - CIAO_ServerActivator_i::configuration_complete (const char *server_UUID) - { - CIAO_TRACE ("CIAO_ServerActivator_i::configuration_complete"); - - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "CIAO_ServerActivator_i::configuration_complete - " - "Received configuration_complete from ComponentServer %C\n", - server_UUID)); - - try - { - Server_Info *info = 0; - - for (SERVER_INFOS::ITERATOR j (this->server_infos_); - !j.done (); ++j) - { - if ((*j)->uuid_ == server_UUID) - { - info = (*j).get (); - } - } - - if (!info) - { - CIAO_ERROR (1, (LM_WARNING, CLINFO - "CIAO_ServerActivator_i::configuration_complete - " - "Received configuration_complete from ComponentServer %C, which doesn't belong to me.\n", - server_UUID)); - throw ::CORBA::BAD_PARAM (); - } - - if (info->activated_) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO - "CIAO_ServerActivator_i::configuration_complete - " - "Received configuration_complete from ComponentServer %C, which has already been completed.\n", - server_UUID)); - throw ::CORBA::BAD_INV_ORDER (); - } - - if (CORBA::is_nil (info->ref_.in ())) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO - "CIAO_ServerActivator_i::configuration_complete - " - "Received configuration_complete from ComponentServer %C, which has not called back.\n", - server_UUID)); - throw ::CORBA::BAD_INV_ORDER (); - } - - info->activated_ = true; - } - catch (...) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO - "CIAO_ServerActivator_i::configuration_complete - " - "Caught unknown exception while processing configuration_complete\n")); - throw; - } - } - - ::Components::Deployment::ComponentServer_ptr - CIAO_ServerActivator_i::create_component_server (const ::Components::ConfigValues & config) - { - CIAO_TRACE("CIAO_ServerActivator_i::create_component_server"); - - Safe_Server_Info server (new Server_Info (config.length () + 1)); - - CIAO::Utility::build_config_values_map (*server->cmap_, config); - - ACE_CString cmd_options = this->construct_command_line (*server); - - CIAO_DEBUG (6, (LM_DEBUG, CLINFO - "CIAO_ServerActivator_i::create_component_server - ComponentServer arguments: %C\n", - cmd_options.c_str ())); - - server_infos_.insert_tail (server); - - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "CIAO_ServerActivator_i::create_component_server - " - "Attempting to spawn ComponentServer with UUID %C\n", - server->uuid_.c_str ())); - - // Now we need to get a copy of the one that was inserted... - pid_t const pid = this->spawn_component_server (*server, cmd_options); - ACE_UNUSED_ARG (pid); - - ACE_Time_Value timeout (this->spawn_delay_); - - CORBA::Any val; - - if (server->cmap_->find (SERVER_TIMEOUT, val) == 0) - { - CORBA::ULong t; - if (val >>= t) - { - CIAO_DEBUG (6, (LM_DEBUG, CLINFO "CIAO_ServerActivator_i::create_component_server - " - "Using provided non-default server timeout of %u\n", t)); - timeout = ACE_Time_Value (t); - } - else - { - CIAO_ERROR (1, (LM_WARNING, CLINFO "CIAO_ServerActivator_i::create_component_server - " - "Failed to extract provided non-default server timeout from property '%C', " - "falling back to default timeout of %u\n", - this->spawn_delay_)); - } - } - - if (this->multithreaded_) - this->multi_threaded_wait_for_callback (*server, timeout/*, pid*/); - else - this->single_threaded_wait_for_callback (*server, timeout/*, pid*/); - - CIAO_DEBUG (6, (LM_DEBUG, CLINFO - "CIAO_ServerActivator_i::create_component_server - " - "ComponentServer %C successfully spawned and configured!\n", - server->uuid_.c_str ())); - - return ::Components::Deployment::ComponentServer::_duplicate (server->ref_.in ()); - } - - ACE_CString - CIAO_ServerActivator_i::construct_command_line (Server_Info &server) - { - CIAO_TRACE ("CIAO_ServerActivator_i::construct_command_line"); - - // Build our command line to launch the component server - ACE_CString cmd_options (this->cs_args_); - - CORBA::Any val; - - if (server.cmap_->find (SERVER_UUID, val) == 0) - { - // Nodeapplication has requested a custom uuid - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "CIAO_ServerActivator_i::construct_command_line - Using provided UUID\n")); - const char *uuid = 0; - val >>= uuid; - server.uuid_ = uuid; - } - else - { - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "CIAO_ServerActivator_i::construct_command_line - Using generated UUID\n")); - ACE_Utils::UUID uuid; - ACE_Utils::UUID_GENERATOR::instance ()->generate_UUID (uuid); - server.uuid_ = *uuid.to_string (); - } - - if (server.cmap_->find (SERVER_ARGUMENTS, val) == 0) - { - const char *args = 0; - val >>= args; - - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "CIAO_ServerActivator_i::construct_command_line - " - "Adding provided server arguments %C\n", args)); - - cmd_options += ' '; - cmd_options += args; - cmd_options += ' '; - } - - CIAO_DEBUG (6, (LM_DEBUG, CLINFO - "CIAO_ServerActivator_i::construct_command_line - Creating component server" - " with UUID %C\n", server.uuid_.c_str ())); - - cmd_options += " -u "; - cmd_options += server.uuid_; - - return cmd_options; - } - - pid_t - CIAO_ServerActivator_i::spawn_component_server (const Server_Info &si, - const ACE_CString &cmd_line) - { - CIAO_TRACE ("CIAO_ServerActivator_i::spawn_component_server"); - - // Get my object reference - CORBA::Object_var obj = this->poa_->servant_to_reference (this); - CORBA::String_var ior = this->orb_->object_to_string (obj.in ()); - CORBA::Any val; - - const char *path = this->cs_path_.c_str (); - - if (si.cmap_->find (SERVER_EXECUTABLE, val) == 0) - { - val >>= path; - CIAO_DEBUG (6, (LM_DEBUG, CLINFO "CIAO_ServerActivator_i::spawn_component_server - " - "Using provided component server executable: %C\n", path)); - } - else - { - CIAO_DEBUG (6, (LM_DEBUG, CLINFO "CIAO_ServerActivator_i::spawn_component_server - " - "Using default component server executable\n")); - } - - ACE_Process_Options options (true, - ACE_OS::strlen (path) + ACE_OS::strlen (cmd_line.c_str()) + ACE_OS::strlen (ior.in ()) + 15); - if (options.command_line ("%s %s -c %s", - path, - cmd_line.c_str (), - ior.in ()) != 0) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO - "Failed to create commandline\n")); - throw Components::CreateFailure (CIAO::SERVER_SPAWN_FAILURE); - } - - options.avoid_zombies (0); - - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "CIAO_ServerActivator_i::spawn_component_server - Spawning process, command line is %s\n", - options.command_line_buf ())); - - pid_t const pid = this->process_manager_.spawn (options, - &this->child_handler_); - - if (pid == ACE_INVALID_PID) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO - "Failed to spawn a ComponentServer process\n")); - throw Components::CreateFailure (CIAO::SERVER_SPAWN_FAILURE); - } - - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "CIAO_ServerActivator_i::spawn_component_server - Process successfully spawned with pid %u\n", - pid)); - return pid; - } - - void - CIAO_ServerActivator_i:: - single_threaded_wait_for_callback (const Server_Info &si, - ACE_Time_Value &timeout) - { - CIAO_TRACE ("CIAO_ServerActivator_i::single_threaded_wait_for_callback"); - - // Below code is broken for thread-per-connection concurrency model, - // since the main thread is running ORB event loop and will spawn - // a different thread to handle the call <register_node_application>, - // the <perform_work> operation will not be invoked and finally - // a timeout will occur. For a similar reason, it won't work - // for thread-pool concurrency model. - while (true) - { - this->orb_->perform_work (timeout); - - if (timeout == ACE_Time_Value::zero) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO - "CIAO_ServerActivator_i::single_threaded_wait_for_callback - " - "Timed out while waiting for ComponentServer %C to call back.\n", - si.uuid_.c_str ())); - throw ::Components::CreateFailure (CIAO::CALLBACK_TIMEOUT_EXCEEDED); - } - - if (si.activated_) - { - break; - } - } - } - - void - CIAO_ServerActivator_i:: - multi_threaded_wait_for_callback (const Server_Info &si, - ACE_Time_Value &timeout) - { - CIAO_TRACE ("CIAO_ServerActivator_i::multi_threaded_wait_for_callback"); - - // Wait for a conditional variable - ACE_GUARD_THROW_EX ( TAO_SYNCH_MUTEX, - guard, - this->mutex_, - CORBA::NO_RESOURCES ()); - - while (! si.activated_ ) - if (this->condition_.wait (&timeout) == -1) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO - "CIAO_ServerActivator_i::multi_threaded_wait_for_callback - " - "Timed out while waiting for ComponentServer %C to call back.\n", - si.uuid_.c_str ())); - throw Components::CreateFailure (CIAO::CALLBACK_TIMEOUT_EXCEEDED); - } - } - - void - CIAO_ServerActivator_i::remove_component_server (::Components::Deployment::ComponentServer_ptr server) - { - CIAO_TRACE ("CIAO_ServerActivator_i::remove_component_server"); - - Server_Info *info = 0; - - for (SERVER_INFOS::ITERATOR i (this->server_infos_); - !i.done (); ++i) - { - if ((*i)->ref_->_is_equivalent (server)) - { - info = (*i).get (); - } - } - - if (!info) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO - "CIAO_ServerActivator_i::remove_component_server - " - "Failed to find equivalent ComponentServer under my management.\n")); - throw ::Components::RemoveFailure (); - } - - try - { - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "CIAO_ServerActivator_i::remove_component_server - " - "Calling remove () on ComponentServer %C\n", - info->uuid_.c_str ())); - server->remove (); - } - catch (::Components::RemoveFailure &) - { - CIAO_ERROR (1, (LM_WARNING, CLINFO - "CIAO_ServerActivator_i::remove_component_server - " - "Received RemoveFailure exception from ComponentServer %C\n", - info->uuid_.c_str ())); - } - - // If this is a CIAO component server, call shutdown - CIAO::Deployment::ComponentServer_var ccs = - CIAO::Deployment::ComponentServer::_narrow (server); - if (!CORBA::is_nil (ccs)) - { - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "CIAO_ServerActivator_i::remove_component_server - " - "Calling shutdown () on ComponentServer %C\n", - info->uuid_.c_str ())); - ccs->shutdown (); - } - else - CIAO_DEBUG (9, (LM_TRACE, CLINFO - "CIAO_ServerActivator_i::remove_component_server - " - "ComponentServer %C is not a CIAO_ComponentServer, not calling shutdown.\n", - info->uuid_.c_str ())); - - CIAO_DEBUG (6, (LM_INFO, CLINFO - "CIAO_ServerActivator_i::remove_component_server - " - "ComponentServer %C successfully shut down.\n", - info->uuid_.c_str ())); - } - - ::Components::Deployment::ComponentServers * - CIAO_ServerActivator_i::get_component_servers (void) - { - CIAO_TRACE ("CIAO_ServerActivator_i::get_component_servers"); - - ::Components::Deployment::ComponentServers_var retval = new - Components::Deployment::ComponentServers (this->server_infos_.size ()); - - CORBA::ULong pos = 0; - - for (SERVER_INFOS::ITERATOR i (this->server_infos_); - !i.done (); ++i) - { - retval[pos++] = - ::Components::Deployment::ComponentServer::_duplicate ((*i)->ref_); - } - - return retval._retn (); - } - - void - CIAO_ServerActivator_i::create_component_server_config_values ( - const Server_Info &, - Components::ConfigValues_out &config) - { - ACE_NEW_THROW_EX (config, - Components::ConfigValues (1), - CORBA::NO_MEMORY ()); - - Components::Deployment::ComponentInstallation_ptr ci = - Components::Deployment::ComponentInstallation::_duplicate (this->ci_.in ()); - CORBA::Any ci_any; - ci_any <<= ci; - - OBV_Components::ConfigValue* p = 0; - ACE_NEW_THROW_EX (p, - OBV_Components::ConfigValue (), - CORBA::NO_MEMORY ()); - p->name (CIAO::Deployment::COMPONENTINSTALLATION_REF); - p->value (ci_any); - config->length (1); - config.operator[](0) = p; - } - } -} - diff --git a/CIAO/ciao/ComponentServer/CIAO_ServerActivator_Impl.h b/CIAO/ciao/ComponentServer/CIAO_ServerActivator_Impl.h deleted file mode 100644 index 23057b2c550..00000000000 --- a/CIAO/ciao/ComponentServer/CIAO_ServerActivator_Impl.h +++ /dev/null @@ -1,191 +0,0 @@ -// $Id$ -/** - * @file CIAO_ServerActivator_Impl.h - * @author William R. Otte - */ - -#ifndef CIAO_SERVERACTIVATOR_H_ -#define CIAO_SERVERACTIVATOR_H_ - -#include "ace/Process_Manager.h" -#include "ace/Event_Handler.h" -#include "ace/Condition_T.h" -#include "ace/OS_NS_sys_wait.h" -#include "ace/Refcounted_Auto_Ptr.h" -#include "ace/Unbounded_Set_Ex.h" -#include "ace/Synch_Traits.h" -#include "ace/Condition_T.h" -#include "tao/PortableServer/PortableServer.h" -#include "ciao/ComponentServer/CIAO_CS_ClientS.h" -#include "ciao/ComponentServer/CIAO_ComponentServerC.h" -#include "ciao/ComponentServer/CIAO_CS_Client_svnt_export.h" -#include "Client_init.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -namespace CIAO -{ - namespace Deployment - { - /** - * @brief The signal handler class for the SIGCHLD handling to avoid - * zombies - */ - class Child_Handler : public virtual ACE_Event_Handler - { - public: - virtual int handle_signal (int, - siginfo_t *, - ucontext_t *) - { - // @@ Note that this code is not portable to all OS platforms - // since it uses print statements within signal handler context. - ACE_exitcode status; - // makes a claal to the underlying os system call - // -1 to wait for any child process - // and WNOHANG so that it retuurns immediately - ACE_OS::waitpid (-1 ,&status, WNOHANG, 0); - - return 0; - } - }; - - /** - * @author William R. Otte <wotte@dre.vanderbilt.edu> - * @brief Default server activator for CIAO component servers. - * - * Implements the default component server activation strategy - * which is to spawn new processes. This is not thread-safe, - * nor is it intended to be. Containers are reated serially, - * so there will be only one actor *modifying* data at a particular - * point in time. - */ - class CIAO_CS_CLIENT_SVNT_Export CIAO_ServerActivator_i - : public virtual POA_CIAO::Deployment::ServerActivator - { - public: - /// Constructor - CIAO_ServerActivator_i (CORBA::ULong def_spawn_delay, - const char * default_cs_path, - const char * cs_args, - bool multithreaded, - Components::Deployment::ComponentInstallation_ptr ci, - CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa_); - - /// Destructor - virtual ~CIAO_ServerActivator_i (void); - - virtual - void component_server_callback ( - ::Components::Deployment::ComponentServer_ptr serverref, - const char * server_UUID, - ::Components::ConfigValues_out config); - - virtual void configuration_complete (const char *server_UUID); - - virtual - ::Components::Deployment::ComponentServer_ptr - create_component_server (const ::Components::ConfigValues & config); - - virtual - void remove_component_server ( - ::Components::Deployment::ComponentServer_ptr server); - - virtual - ::Components::Deployment::ComponentServers * get_component_servers (void); - - private: - struct Server_Info; - - /// Builds command line options based on configuration information. - /// May modify the uuid of the component server. - ACE_CString construct_command_line (Server_Info &si); - - /// Spawns the component server process, but does not wait for it - /// to call back. - pid_t spawn_component_server (const Server_Info &si, - const ACE_CString &cmd_line); - - /// This method is only applicable when our program is configured as - /// singled threaded . Internally it uses a @c perform_work blocking - /// call to wait for NA object to call back - void single_threaded_wait_for_callback (const Server_Info &si, - ACE_Time_Value &timeout); - - /// This method is only applicable when our program is configured as - /// multiple threaded. Internally it waits on a conditional variable - /// that could be modified by the callback servant which runs in - /// another thread - void multi_threaded_wait_for_callback (const Server_Info &si, - ACE_Time_Value &timeout); - - void create_component_server_config_values (const Server_Info &info, - Components::ConfigValues_out &config); - - struct Server_Info - { - Server_Info (size_t cmap_size_hint = 128) - : cmap_ (new CIAO::Utility::CONFIGVALUE_MAP (cmap_size_hint)), - ref_ (Components::Deployment::ComponentServer::_nil ()), - pid_ (ACE_INVALID_PID), - activated_ (false) {} - - typedef ACE_Refcounted_Auto_Ptr <CIAO::Utility::CONFIGVALUE_MAP, - ACE_Null_Mutex> CONFIGVALUE_MAP_PTR; - - ACE_CString uuid_; - CONFIGVALUE_MAP_PTR cmap_; - Components::Deployment::ComponentServer_var ref_; - pid_t pid_; - bool activated_; - }; - - typedef ACE_Refcounted_Auto_Ptr<Server_Info, ACE_Null_Mutex> Safe_Server_Info; - - struct _server_info - { - bool operator() (const Safe_Server_Info &a, const Safe_Server_Info &b) const - { - return a->uuid_ == b->uuid_; - } - }; - - // Presumably, there won't be too many component servers per node application - typedef ACE_Unbounded_Set_Ex <Safe_Server_Info, _server_info> SERVER_INFOS; - - /// Default args to pass to all componentservers. - ACE_CString default_args_; - - SERVER_INFOS server_infos_; - - ACE_Process_Manager process_manager_; - - Child_Handler child_handler_; - - CORBA::ULong spawn_delay_; - - /////*******NEW - bool multithreaded_; - - CORBA::ORB_var orb_; - - PortableServer::POA_var poa_; - - ACE_CString cs_path_; - - ACE_CString cs_args_; - - TAO_SYNCH_MUTEX mutex_; - - ACE_Condition<TAO_SYNCH_MUTEX> condition_; - - Components::Deployment::ComponentInstallation_var ci_; - }; - - - } -} -#endif /* CIAO_SERVERACTIVATOR_H_ */ diff --git a/CIAO/ciao/ComponentServer/Client_init.h b/CIAO/ciao/ComponentServer/Client_init.h index d2a7c9323c4..07be2fcbae4 100644 --- a/CIAO/ciao/ComponentServer/Client_init.h +++ b/CIAO/ciao/ComponentServer/Client_init.h @@ -24,7 +24,7 @@ #include "tao/AnyTypeCode/Any.h" #include "ccm/CCM_StandardConfiguratorC.h" -#include "ciao/ComponentServer/CIAO_ComponentServer_stub_export.h" +#include "ciao/ComponentServer/CIAO_Base_stub_export.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL namespace CORBA @@ -43,7 +43,7 @@ namespace CIAO * should be call right after ORB initialization but we should try * to register these stuff automatically. */ - CIAO_COMPONENTSERVER_STUB_Export int Client_init (CORBA::ORB_ptr o); + CIAO_BASE_STUB_Export int Client_init (CORBA::ORB_ptr o); namespace Utility { @@ -53,10 +53,10 @@ namespace CIAO ACE_Equal_To<ACE_CString>, ACE_Null_Mutex> CONFIGVALUE_MAP; - CIAO_COMPONENTSERVER_STUB_Export void build_config_values_map (CONFIGVALUE_MAP &map, + CIAO_BASE_STUB_Export void build_config_values_map (CONFIGVALUE_MAP &map, const ::Components::ConfigValues &config); - CIAO_COMPONENTSERVER_STUB_Export void build_config_values_sequence (::Components::ConfigValues &config, + CIAO_BASE_STUB_Export void build_config_values_sequence (::Components::ConfigValues &config, const CONFIGVALUE_MAP &map); } } diff --git a/CIAO/ciao/ComponentServer/Server_init.h b/CIAO/ciao/ComponentServer/Server_init.h index d56c5fe50fc..a5ba167476d 100644 --- a/CIAO/ciao/ComponentServer/Server_init.h +++ b/CIAO/ciao/ComponentServer/Server_init.h @@ -16,7 +16,7 @@ #include /**/ "ace/pre.h" -#include "ciao/ComponentServer/CIAO_ComponentServer_stub_export.h" +#include "ciao/ComponentServer/CIAO_Base_stub_export.h" #if !defined ACE_LACKS_PRAGMA_ONCE #pragma once @@ -42,14 +42,14 @@ namespace CIAO * should be call right after ORB initialization but we should try * to register these stuff automatically. */ - CIAO_COMPONENTSERVER_STUB_Export int Server_init (CORBA::ORB_ptr o); + CIAO_BASE_STUB_Export int Server_init (CORBA::ORB_ptr o); namespace Utility { /// Write a string (usually a stringified IOR) to a file /// designated by the @c pathname. The file named will always get /// overwritten. - CIAO_COMPONENTSERVER_STUB_Export int write_IOR (const ACE_TCHAR *pathname, + CIAO_BASE_STUB_Export int write_IOR (const ACE_TCHAR *pathname, const char *IOR); } } diff --git a/CIAO/ciao/Containers/Session/Session_Container.cpp b/CIAO/ciao/Containers/Session/Session_Container.cpp index 937091aade4..d3345d32c42 100644 --- a/CIAO/ciao/Containers/Session/Session_Container.cpp +++ b/CIAO/ciao/Containers/Session/Session_Container.cpp @@ -5,7 +5,6 @@ #include "tao/Utils/PolicyList_Destroyer.h" #include "ciao/Containers/Servant_Activator.h" #include "ccm/ComponentServer/CCM_ComponentServer_BaseC.h" -#include "ciao/ComponentServer/CIAO_ComponentServerC.h" #include "ciao/Servants/Servant_Impl_Base.h" #include "ciao/Logger/Log_Macros.h" diff --git a/CIAO/ciao/Containers/Session/Session_Container.mpc b/CIAO/ciao/Containers/Session/Session_Container.mpc index 5532d41d81c..09acfb23f85 100644 --- a/CIAO/ciao/Containers/Session/Session_Container.mpc +++ b/CIAO/ciao/Containers/Session/Session_Container.mpc @@ -14,7 +14,7 @@ project(CIAO_Session_Container_idl) : install, ciaoidldefaults { } } -project(CIAO_Session_Container) : install, ccm_svnt, ciao_lib, ciao_container_base, utils, \ +project(CIAO_Session_Container) : install, ccm_svnt, ciao_lib, ciao_container_base, utils, ciao_base, \ ccm_componentserver_stub, ciao_servant_activator, ciao_servant { after += CIAO_Session_Container_idl dynamicflags += SESSION_CONTAINER_BUILD_DLL diff --git a/CIAO/ciao/Deployment/Handlers/CIAO_Deployment_Handlers.mpc b/CIAO/ciao/Deployment/Handlers/CIAO_Deployment_Handlers.mpc index d19b038b38e..57999419208 100644 --- a/CIAO/ciao/Deployment/Handlers/CIAO_Deployment_Handlers.mpc +++ b/CIAO/ciao/Deployment/Handlers/CIAO_Deployment_Handlers.mpc @@ -1,6 +1,6 @@ // $Id$ -project (CIAO_Deployment_Handlers) : dance_stub, ciao_lib, ciao_output, \ - ciao_session_container, ciao_logger, ciao_componentserver_stub { +project (CIAO_Deployment_Handlers) : dance_stub, ciao_base, ciao_lib, ciao_output, \ + ciao_session_container, ciao_logger { dynamicflags = CIAO_LOCALITY_HANDLER_BUILD_DLL Source_Files { diff --git a/CIAO/tests/CIAO_ComponentServer/Activator/Activator.mpc b/CIAO/tests/CIAO_ComponentServer/Activator/Activator.mpc deleted file mode 100644 index df8ec43d6f2..00000000000 --- a/CIAO/tests/CIAO_ComponentServer/Activator/Activator.mpc +++ /dev/null @@ -1,6 +0,0 @@ -// $Id$ -project (Activator_CIAOComponentServer_Test) : ciao_componentserver_stub, ccm_configvalue, ciao_cs_client { - Source_Files { - client.cpp - } -}
\ No newline at end of file diff --git a/CIAO/tests/CIAO_ComponentServer/Activator/client.cpp b/CIAO/tests/CIAO_ComponentServer/Activator/client.cpp deleted file mode 100644 index 7357e86679b..00000000000 --- a/CIAO/tests/CIAO_ComponentServer/Activator/client.cpp +++ /dev/null @@ -1,190 +0,0 @@ -// $Id$ - -#include "ace/Get_Opt.h" -#include "ciao/ComponentServer/CIAO_CS_ClientS.h" -#include "ciao/ComponentServer/CIAO_ComponentServerC.h" -#include "ciao/ComponentServer/CIAO_ServerActivator_Impl.h" -#include "ciao/ComponentServer/CIAO_ComponentInstallation_Impl.h" -#include "ciao/Valuetype_Factories/ConfigValue.h" - -const ACE_TCHAR *cs_path = ACE_TEXT ("ciao_componentserver"); -CORBA::ULong spawn_delay = 30; - -int -parse_args (int argc, ACE_TCHAR *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "s:d:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 's': - cs_path = get_opts.opt_arg (); - break; - - case 'd': - spawn_delay = ACE_OS::atoi (get_opts.opt_arg ()); - break; - - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-s <path> " - "-d <uint> " - "\n", - argv [0]), - -1); - } - // Indicates sucessful parsing of the command line - return 0; -} - -int -ACE_TMAIN (int argc, ACE_TCHAR **argv) -{ - using namespace CIAO::Deployment; - - try - { - CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); - - if (parse_args (argc, argv) != 0) - return 1; - - CORBA::Object_var object = - orb->resolve_initial_references ("RootPOA"); - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (object.in ()); - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (); - - poa_manager->activate (); - - CIAO::Deployment::ComponentInstallation_Impl *tmp_ci; - - ACE_NEW_THROW_EX (tmp_ci, - CIAO::Deployment::ComponentInstallation_Impl (), - CORBA::NO_MEMORY ()); - - PortableServer::ServantBase_var safe_servant = tmp_ci; - - CIAO_ServerActivator_i *sa_tmp = new CIAO_ServerActivator_i (spawn_delay, - ACE_TEXT_ALWAYS_CHAR (cs_path), - 0, - false, - tmp_ci->_this (), - orb.in (), - root_poa.in ()); - PortableServer::ServantBase_var safe = sa_tmp; - - ServerActivator_var sa = sa_tmp->_this (); - - // Make our configvalues - // ::Components::ConfigValues_var configs = new - ::Components::ConfigValues configs(2); - //ACE_DEBUG ((LM_DEBUG, "Attempting to create componentserver with no configvalues\n")); - // Make a componentserver with no configvalues - ComponentServer_var server1 (ComponentServer::_narrow (sa->create_component_server (configs))); - //ACE_DEBUG ((LM_DEBUG, "Componentserver with no configvalues created!\n")); - - //ACE_DEBUG ((LM_DEBUG, "Attempting to create componentserver with UUID configvalues\n")); - CORBA::Any val; - val <<= "MyNameIsEarl"; - configs.length (1); - ::Components::ConfigValue_var cv_tmp = new CIAO::ConfigValue_impl ("edu.vanderbilt.dre.ServerUUID", val); - configs[0] = cv_tmp._retn (); - - ComponentServer_var server2 (ComponentServer::_narrow (sa->create_component_server (configs))); - - // Initialize servant - - if (CORBA::is_nil (server1.in ()) || - CORBA::is_nil (server1.in ())) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Nil componentserver references"), -1); - } - - Components::Deployment::Container_var tmp = server1->create_container (0); - Container_var cont1a = Container::_narrow (tmp.in ()); - if (CORBA::is_nil (cont1a.in ())) - { - ACE_ERROR ((LM_ERROR, "Error: Got nil object reference from first create op on server 1 %u %u\n", - tmp.in (), cont1a.in ())); - return -1; - } - //ACE_DEBUG ((LM_DEBUG, "Got container from server 1a\n")); - - Container_var cont1b = Container::_narrow (server1->create_container (0)); - if (CORBA::is_nil (cont1b.in ())) - { - ACE_ERROR ((LM_ERROR, "Error: Got nil object reference from second create op on server 1\n")); - return -1; - } - //ACE_DEBUG ((LM_DEBUG, "Got container from server 1b\n")); - - Container_var cont2a = Container::_narrow (server2->create_container (0)); - if (CORBA::is_nil (cont2a.in ())) - { - ACE_ERROR ((LM_ERROR, "Error: Got nil object reference from first create op on server 2\n")); - return -1; - } - //ACE_DEBUG ((LM_DEBUG, "Got container from server 2a\n")); - - try - { - server2->remove_container (cont1a); - ACE_ERROR ((LM_ERROR, "Error: remove_container removed a container not belonging to the component server\n")); - } - catch (::Components::RemoveFailure &) - { - //ACE_DEBUG ((LM_DEBUG, "Server 2 Refused to remove container it didn't own\n")); - // expected - } - - ::Components::Deployment::Containers_var cses = server1->get_containers (); - - if (cses->length () != 2) - ACE_ERROR ((LM_ERROR, "Error: get_containers returned the wrong number of containers, %u should be 2\n", - cses->length ())); - else //ACE_DEBUG ((LM_DEBUG, "Got %u containers\n", cses->length ())); - - server1->remove_container (cont1a); - //ACE_DEBUG ((LM_DEBUG, "Successfully removed container 1a\n")); - - cses = server1->get_containers (); - - if (cses->length () != 1) - ACE_ERROR ((LM_ERROR, "Error: get_containers returned %u containers after removal, should be 1\n", - cses->length ())); - - server2->remove_container (cont2a); - //ACE_DEBUG ((LM_DEBUG, "Successfully removed container 2a\n")); - server1->remove_container (cont1b); - //ACE_DEBUG ((LM_DEBUG, "Successfully removed container 1b\n")); - - //ACE_DEBUG ((LM_DEBUG, "Removing component server\n")); - sa->remove_component_server (server1.in ()); - sa->remove_component_server (server2.in ()); - //ACE_DEBUG ((LM_DEBUG, "Componentserver removed\n")); - - orb->destroy (); - } - catch (::Components::CreateFailure &) - { - ACE_ERROR ((LM_ERROR, "Error: Caught CreateFailure exception.\n")); - } - catch (::Components::RemoveFailure &) - { - ACE_ERROR ((LM_ERROR, "Error: Caught RemoveFailure exception.\n")); - } - catch (...) - { - ACE_ERROR ((LM_ERROR, "Error: Caught unknown exception\n")); - } - return 0; -} diff --git a/CIAO/tests/CIAO_ComponentServer/Activator/run_test.pl b/CIAO/tests/CIAO_ComponentServer/Activator/run_test.pl deleted file mode 100755 index 91d47475aa7..00000000000 --- a/CIAO/tests/CIAO_ComponentServer/Activator/run_test.pl +++ /dev/null @@ -1,35 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib "$ENV{ACE_ROOT}/bin"; -use PerlACE::TestTarget; - -$status = 0; -$debug_level = '0'; -$ciao_root = "$ENV{CIAO_ROOT}"; - -foreach $i (@ARGV) { - if ($i eq '-debug') { - $debug_level = '10'; - } -} - -my $target = PerlACE::TestTarget::create_target (1); - -$SV1 = $target->CreateProcess ("./client", "-s " . $target->GetArchDir("$ciao_root/bin/") . "ciao_componentserver"); - -$server_status = $SV1->SpawnWaitKill ($target->ProcessStartWaitInterval ()); - -if ($server_status != 0) { - $target->GetStderrLog(); - print STDERR "ERROR: server1 returned $server_status\n"; - exit 1; -} - -$target->GetStderrLog(); - -exit $status; diff --git a/CIAO/tests/CIAO_ComponentServer/Basic/Basic.mpc b/CIAO/tests/CIAO_ComponentServer/Basic/Basic.mpc deleted file mode 100644 index 1de96195bb9..00000000000 --- a/CIAO/tests/CIAO_ComponentServer/Basic/Basic.mpc +++ /dev/null @@ -1,6 +0,0 @@ -// $Id$ -project (Basic_CIAOComponentServer_Test) : ciao_componentserver_stub { - Source_Files { - client.cpp - } -}
\ No newline at end of file diff --git a/CIAO/tests/CIAO_ComponentServer/Basic/client.cpp b/CIAO/tests/CIAO_ComponentServer/Basic/client.cpp deleted file mode 100644 index 8d36037c8f2..00000000000 --- a/CIAO/tests/CIAO_ComponentServer/Basic/client.cpp +++ /dev/null @@ -1,143 +0,0 @@ -// $Id$ - -#include "ace/Get_Opt.h" -#include "ciao/ComponentServer/CIAO_ComponentServerC.h" - -const ACE_TCHAR *server_1 = ACE_TEXT("file://test1.ior"); -const ACE_TCHAR *server_2 = ACE_TEXT("file://test2.ior"); - -int -parse_args (int argc, ACE_TCHAR *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("k:j:")); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'k': - server_1 = get_opts.opt_arg (); - break; - - case 'j': - server_2 = get_opts.opt_arg (); - break; - - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-k <ior> " - "-j <ior> " - "\n", - argv [0]), - -1); - } - // Indicates sucessful parsing of the command line - return 0; -} - -int -ACE_TMAIN (int argc, ACE_TCHAR **argv) -{ - using namespace CIAO::Deployment; - - try - { - CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); - - if (parse_args (argc, argv) != 0) - return 1; - - CORBA::Object_var tmp1 = orb->string_to_object(server_1); - CORBA::Object_var tmp2 = orb->string_to_object(server_2); - - ComponentServer_var server1 (ComponentServer::_narrow (tmp1)), - server2 (ComponentServer::_narrow (tmp2)); - - if (CORBA::is_nil (server1.in ()) || - CORBA::is_nil (server1.in ())) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Nil componentserver references"), -1); - } - - Components::Deployment::Container_var tmp = server1->create_container (0); - Container_var cont1a = Container::_narrow (tmp.in ()); - if (CORBA::is_nil (cont1a.in ())) - { - ACE_ERROR ((LM_ERROR, "Error: Got nil object reference from first create op on server 1 %u %u\n", - tmp.in (), cont1a.in ())); - return -1; - } - ACE_ERROR ((LM_DEBUG, "Got container from server 1a\n")); - - Container_var cont1b = Container::_narrow (server1->create_container (0)); - if (CORBA::is_nil (cont1b.in ())) - { - ACE_ERROR ((LM_ERROR, "Error: Got nil object reference from second create op on server 1\n")); - return -1; - } - ACE_ERROR ((LM_DEBUG, "Got container from server 1b\n")); - - Container_var cont2a = Container::_narrow (server2->create_container (0)); - if (CORBA::is_nil (cont2a.in ())) - { - ACE_ERROR ((LM_ERROR, "Error: Got nil object reference from first create op on server 2\n")); - return -1; - } - ACE_ERROR ((LM_DEBUG, "Got container from server 2a\n")); - - try - { - server2->remove_container (cont1a); - ACE_ERROR ((LM_ERROR, "Error: remove_container removed a container not belonging to the component server\n")); - } - catch (const ::Components::RemoveFailure &) - { - ACE_DEBUG ((LM_DEBUG, "Server 2 Refused to remove container it didn't own\n")); - // expected - } - - ::Components::Deployment::Containers_var cses = server1->get_containers (); - - if (cses->length () != 2) - ACE_ERROR ((LM_ERROR, "Error: get_containers returned the wrong number of containers, %u should be 2\n", - cses->length ())); - else ACE_DEBUG ((LM_DEBUG, "Got %u containers\n", cses->length ())); - - server1->remove_container (cont1a); - ACE_DEBUG ((LM_DEBUG, "Successfully removed container 1a\n")); - - cses = server1->get_containers (); - - if (cses->length () != 1) - ACE_ERROR ((LM_ERROR, "Error: get_containers returned %u containers after removal, should be 1\n", - cses->length ())); - - server2->remove_container (cont2a); - ACE_DEBUG ((LM_DEBUG, "Successfully removed container 2a\n")); - server1->remove_container (cont1b); - ACE_DEBUG ((LM_DEBUG, "Successfully removed container 1b\n")); - - server1->remove (); - server1->shutdown (); - server2->remove (); - server2->shutdown (); - - orb->destroy (); - } - catch (const ::Components::CreateFailure &) - { - ACE_ERROR ((LM_ERROR, "Error: Caught CreateFailure exception.\n")); - } - catch (const ::Components::RemoveFailure &) - { - ACE_ERROR ((LM_ERROR, "Error: Caught RemoveFailure exception.\n")); - } - catch (...) - { - ACE_ERROR ((LM_ERROR, "Error: Caught unknown exception\n")); - } - return 0; -} diff --git a/CIAO/tests/CIAO_ComponentServer/Basic/run_test.pl b/CIAO/tests/CIAO_ComponentServer/Basic/run_test.pl deleted file mode 100755 index ed2f80825a6..00000000000 --- a/CIAO/tests/CIAO_ComponentServer/Basic/run_test.pl +++ /dev/null @@ -1,110 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib "$ENV{ACE_ROOT}/bin"; -use PerlACE::TestTarget; - -$status = 0; -$debug_level = '0'; -$ciao_root = "$ENV{CIAO_ROOT}"; - -foreach $i (@ARGV) { - if ($i eq '-debug') { - $debug_level = '10'; - } -} - -my $target = PerlACE::TestTarget::create_target (1); -my $host = new PerlACE::TestTarget; - -$iorbase1 = "server1.ior"; -$iorbase2 = "server2.ior"; - -$server_iorfile1 = $target->LocalFile ($iorbase1); -$server_iorfile2 = $target->LocalFile ($iorbase2); - -$target->DeleteFile($iorbase1); -$target->DeleteFile($iorbase2); - -$client_iorfile1 = $host->LocalFile ($iorbase1); -$client_iorfile2 = $host->LocalFile ($iorbase2); - -$host->DeleteFile($iorbase1); -$host->DeleteFile($iorbase2); - -$SV1 = $target->CreateProcess ("$ciao_root/bin/ciao_componentserver", "-ORBDebuglevel $debug_level -u $server_iorfile1 -o $server_iorfile1"); -$SV2 = $target->CreateProcess ("$ciao_root/bin/ciao_componentserver", "-ORBDebuglevel $debug_level -u $server_iorfile2 -o $server_iorfile2"); - -$CL = $host->CreateProcess ("client", "-k file://$client_iorfile1 -j file://$client_iorfile2"); - -$server_status1 = $SV1->Spawn (); -$server_status2 = $SV2->Spawn (); - -if ($server_status1 != 0) { - print STDERR "ERROR: server1 returned $server_status1\n"; - exit 1; -} -if ($server_status2 != 0) { - print STDERR "ERROR: server2 returned $server_status2\n"; - exit 1; -} - -if ($target->WaitForFileTimed ($iorbase1, - $target->ProcessStartWaitInterval ()) == -1) { - print STDERR "ERROR: cannot find file <$server_iorfile1>\n"; - $SV1->Kill (); $SV1->TimedWait (1); - exit 1; -} - -if ($target->WaitForFileTimed ($iorbase2, - $target->ProcessStartWaitInterval ()) == -1) { - print STDERR "ERROR: cannot find file <$server_iorfile2>\n"; - $SV2->Kill (); $SV2->TimedWait (1); - exit 1; -} - -if ($target->GetFile ($server_iorfile1, $iorbase) == -1) { - print STDERR "ERROR: cannot retrieve file <$iorbase1>\n"; - $SV1->Kill (); $SV1->TimedWait (1); - exit 1; -} - -if ($target->GetFile ($server_iorfile2, $iorbase) == -1) { - print STDERR "ERROR: cannot retrieve file <$iorbase2>\n"; - $SV2->Kill (); $SV2->TimedWait (1); - exit 1; -} - -$client_status = $CL->SpawnWaitKill ($host->ProcessStartWaitInterval ()); - -if ($client_status != 0) { - print STDERR "ERROR: client returned $client_status\n"; - $status = 1; -} - -$server_status1 = $SV1->WaitKill ($target->ProcessStopWaitInterval ()); -$server_status2 = $SV2->WaitKill ($target->ProcessStopWaitInterval ()); - -if ($server_status1 != 0) { - print STDERR "ERROR: server1 returned $server_status1\n"; - $status = 1; -} - -if ($server_status2 != 0) { - print STDERR "ERROR: server2 returned $server_status2\n"; - $status = 1; -} - -$target->GetStderrLog(); - -$target->DeleteFile($iorbase1); -$target->DeleteFile($iorbase2); - -$host->DeleteFile($iorbase1); -$host->DeleteFile($iorbase2); - -exit $status; diff --git a/CIAO/tests/CIAO_ComponentServer/Local_Facet/Local_Facet.idl b/CIAO/tests/CIAO_ComponentServer/Local_Facet/Local_Facet.idl deleted file mode 100644 index 82b82b5e6a2..00000000000 --- a/CIAO/tests/CIAO_ComponentServer/Local_Facet/Local_Facet.idl +++ /dev/null @@ -1,18 +0,0 @@ -// $Id$ -#include <Components.idl> - -interface trigger -{ - oneway void run_test (); -}; - -local interface Foo -{ - void simple (); -}; - -component Bar supports trigger -{ - uses Foo foo_in; - provides Foo foo_out; -}; diff --git a/CIAO/tests/CIAO_ComponentServer/Local_Facet/Local_Facet.mpc b/CIAO/tests/CIAO_ComponentServer/Local_Facet/Local_Facet.mpc deleted file mode 100644 index f5d15f9dc85..00000000000 --- a/CIAO/tests/CIAO_ComponentServer/Local_Facet/Local_Facet.mpc +++ /dev/null @@ -1,146 +0,0 @@ -// $Id$ -// This file is generated with "generate_component_mpc.pl Local_Facet" - -project(Local_Facet_idl_gen) : componentidldefaults { - - custom_only = 1 - idlflags += -Wb,stub_export_macro=LOCAL_FACET_STUB_Export \ - -Wb,stub_export_include=Local_Facet_stub_export.h \ - -Wb,skel_export_macro=LOCAL_FACET_SVNT_Export \ - -Wb,skel_export_include=Local_Facet_svnt_export.h \ - -Wb,exec_export_macro=LOCAL_FACET_EXEC_Export \ - -Wb,exec_export_include=Local_Facet_exec_export.h - - IDL_Files { - Local_Facet.idl - } -} - -project(Local_Facet_lem_gen) : ciaoidldefaults { - - after += Local_Facet_idl_gen - custom_only = 1 - idlflags += -Wb,stub_export_macro=LOCAL_FACET_LEM_STUB_Export \ - -Wb,stub_export_include=Local_Facet_lem_stub_export.h \ - -SS -Gxhst - - IDL_Files { - Local_FacetE.idl - } -} - -project(Local_Facet_lem_stub) : ccm_svnt { - - after += Local_Facet_lem_gen Local_Facet_stub - libs += Local_Facet_stub - - - sharedname = Local_Facet_lem_stub - dynamicflags = LOCAL_FACET_LEM_STUB_BUILD_DLL - - IDL_Files { - } - - Source_Files { - Local_FacetEC.cpp - } - - Header_Files { - Local_FacetEC.h - Local_Facet_lem_stub_export.h - } - - Inline_Files { - Local_FacetEC.inl - } -} - -project(Local_Facet_stub) : ccm_stub { - - after += Local_Facet_idl_gen - libs += - - - sharedname = Local_Facet_stub - dynamicflags = LOCAL_FACET_STUB_BUILD_DLL - - IDL_Files { - } - - Source_Files { - Local_FacetC.cpp - } - - Header_Files { - Local_FacetC.h - Local_Facet_stub_export.h - } - - Inline_Files { - Local_FacetC.inl - } -} - -project(Local_Facet_exec) : ciao_executor { - - after += Local_Facet_lem_stub Local_Facet_stub - sharedname = Local_Facet_exec - libs += Local_Facet_stub Local_Facet_lem_stub - - - dynamicflags = LOCAL_FACET_EXEC_BUILD_DLL - - IDL_Files { - } - - Source_Files { - Local_Facet_exec.cpp - } - - Header_Files { - Local_Facet_exec.h - Local_Facet_exec_export.h - } - - Inline_Files { - } -} - - -project(Local_Facet_svnt) : ciao_servant { - - after += Local_Facet_lem_stub - sharedname = Local_Facet_svnt - libs += Local_Facet_stub Local_Facet_lem_stub - - - dynamicflags = LOCAL_FACET_SVNT_BUILD_DLL - - IDL_Files { - } - - Source_Files { - Local_FacetS.cpp - Local_Facet_svnt.cpp - } - - Header_Files { - Local_FacetS.h - Local_Facet_svnt.h - Local_Facet_svnt_export.h - } - - Inline_Files { - Local_FacetS.inl - } -} - -project (Lf_CIAOComponentServer_Tst) : ciao_componentserver_stub, ccm_configvalue, ciao_cs_client, ciao_logger { - after += Local_Facet_stub Local_Facet_svnt - libs += Local_Facet_stub - IDL_Files { - } - Source_Files { - client.cpp - } -} diff --git a/CIAO/tests/CIAO_ComponentServer/Local_Facet/Local_Facet_exec.cpp b/CIAO/tests/CIAO_ComponentServer/Local_Facet/Local_Facet_exec.cpp deleted file mode 100644 index 37a96ee10e3..00000000000 --- a/CIAO/tests/CIAO_ComponentServer/Local_Facet/Local_Facet_exec.cpp +++ /dev/null @@ -1,119 +0,0 @@ -// -*- C++ -*- -// $Id$ - -#include "Local_Facet_exec.h" -#include "ciao/Logger/Log_Macros.h" - -namespace CIAO_Bar_Impl -{ - //============================================================ - // Facet Executor Implementation Class: Foo_exec_i - //============================================================ - - Foo_exec_i::Foo_exec_i (void) - { - } - - Foo_exec_i::~Foo_exec_i (void) - { - } - - void Foo_exec_i::simple (void) - { - ACE_DEBUG ((LM_INFO, "Got simple invocation\n")); - } - - // Operations from ::Foo - - //============================================================ - // Component Executor Implementation Class: Bar_exec_i - //============================================================ - - Bar_exec_i::Bar_exec_i (void) - { - } - - Bar_exec_i::~Bar_exec_i (void) - { - } - - // Supported operations and attributes. - - // Component attributes and port operations. - - ::CCM_Foo_ptr - Bar_exec_i::get_foo_out (void) - { - return new Foo_exec_i (); - } - - // Operations from Components::SessionComponent. - - void - Bar_exec_i::set_session_context ( - ::Components::SessionContext_ptr ctx) - { - this->context_ = - ::CCM_Bar_Context::_narrow (ctx); - - if ( ::CORBA::is_nil (this->context_.in ())) - { - throw ::CORBA::INTERNAL (); - } - } - - void - Bar_exec_i::run_test (void) - { - ::Foo_var foo_intf = this->context_->get_connection_foo_in (); - - if (CORBA::is_nil (foo_intf)) - { - ACE_ERROR ((LM_ERROR, "ERROR: Local_Facet_Test: got a nil object reference for my connection\n")); - return; - } - - ACE_DEBUG ((LM_DEBUG, "Invoking simple\n")); - foo_intf->simple (); - - ACE_DEBUG ((LM_INFO, "Test successful!\n")); - } - - void - Bar_exec_i::configuration_complete (void) - { - /* Your code here. */ - } - - void - Bar_exec_i::ccm_activate (void) - { - /* Your code here. */ - } - - void - Bar_exec_i::ccm_passivate (void) - { - /* Your code here. */ - } - - void - Bar_exec_i::ccm_remove (void) - { - /* Your code here. */ - } - - extern "C" LOCAL_FACET_EXEC_Export ::Components::EnterpriseComponent_ptr - create_Bar_Impl (void) - { - ::Components::EnterpriseComponent_ptr retval = - ::Components::EnterpriseComponent::_nil (); - - ACE_NEW_NORETURN ( - retval, - Bar_exec_i); - - return retval; - } -} - diff --git a/CIAO/tests/CIAO_ComponentServer/Local_Facet/Local_Facet_exec.h b/CIAO/tests/CIAO_ComponentServer/Local_Facet/Local_Facet_exec.h deleted file mode 100644 index 4113d147adc..00000000000 --- a/CIAO/tests/CIAO_ComponentServer/Local_Facet/Local_Facet_exec.h +++ /dev/null @@ -1,81 +0,0 @@ -// -*- C++ -*- -// $Id$ - -#ifndef CIAO_LOCAL_FACET_EXEC_H_ -#define CIAO_LOCAL_FACET_EXEC_H_ - -#include /**/ "ace/pre.h" - -#include "Local_FacetEC.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include /**/ "Local_Facet_exec_export.h" -#include "tao/LocalObject.h" - - -namespace CIAO_Bar_Impl -{ - class LOCAL_FACET_EXEC_Export Foo_exec_i - : public virtual ::CCM_Foo, - public virtual ::CORBA::LocalObject - { - public: - Foo_exec_i (void); - virtual ~Foo_exec_i (void); - - // Operations and attributes from ::Foo - virtual void simple (void); - }; - - class LOCAL_FACET_EXEC_Export Bar_exec_i - : public virtual Bar_Exec, - public virtual ::CORBA::LocalObject - { - public: - Bar_exec_i (void); - virtual ~Bar_exec_i (void); - - //@{ - /** Supported operations and attributes. */ - virtual void run_test (void); - - //@} - - //@{ - /** Component attributes and port operations. */ - - - virtual ::CCM_Foo_ptr - get_foo_out (void); - //@} - - //@{ - /** Operations from Components::SessionComponent. */ - - virtual void - set_session_context ( - ::Components::SessionContext_ptr ctx); - - virtual void configuration_complete (void); - - virtual void ccm_activate (void); - virtual void ccm_passivate (void); - virtual void ccm_remove (void); - //@} - - - private: - ::CCM_Bar_Context_var context_; - }; - - extern "C" LOCAL_FACET_EXEC_Export ::Components::EnterpriseComponent_ptr - create_Bar_Impl (void); -} - -#include /**/ "ace/post.h" - -#endif /* ifndef */ - diff --git a/CIAO/tests/CIAO_ComponentServer/Local_Facet/client.cpp b/CIAO/tests/CIAO_ComponentServer/Local_Facet/client.cpp deleted file mode 100644 index 10009051d88..00000000000 --- a/CIAO/tests/CIAO_ComponentServer/Local_Facet/client.cpp +++ /dev/null @@ -1,186 +0,0 @@ -// $Id$ - -#include "ace/Get_Opt.h" -#include "ciao/ComponentServer/CIAO_CS_ClientS.h" -#include "ciao/ComponentServer/CIAO_ComponentServerC.h" -#include "ciao/ComponentServer/CIAO_ServerActivator_Impl.h" -#include "ciao/ComponentServer/CIAO_ComponentInstallation_Impl.h" -#include "ciao/ComponentServer/CIAO_PropertiesC.h" -#include "ciao/Valuetype_Factories/ConfigValue.h" -#include "ciao/Logger/Logger_Service.h" - -#include "Local_FacetC.h" - -const char *cs_path = "ciao_componentserver"; -CORBA::ULong spawn_delay = 30; - -int -parse_args (int argc, ACE_TCHAR *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("s:d:")); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 's': - cs_path = ACE_TEXT_ALWAYS_CHAR (get_opts.opt_arg ()); - break; - - case 'd': - spawn_delay = ACE_OS::atoi (get_opts.opt_arg ()); - break; - - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-s <path> " - "-d <uint> " - "\n", - argv [0]), - -1); - } - // Indicates sucessful parsing of the command line - return 0; -} - -int -ACE_TMAIN (int argc, ACE_TCHAR **argv) -{ - using namespace CIAO::Deployment; - - CIAO::Logger_Service logger; - - logger.init (argc, argv); - try - { - CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); - if (parse_args (argc, argv) != 0) - return 1; - - CORBA::Object_var object = - orb->resolve_initial_references ("RootPOA"); - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (object.in ()); - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (); - - poa_manager->activate (); - ACE_DEBUG ((LM_DEBUG, "foo\n")); - - CIAO::Deployment::ComponentInstallation_Impl *tmp_ci = 0; - - ACE_NEW_THROW_EX (tmp_ci, - CIAO::Deployment::ComponentInstallation_Impl (), - CORBA::NO_MEMORY ()); - - PortableServer::ServantBase_var safe_servant = tmp_ci; - - root_poa->activate_object (tmp_ci); - - CIAO_ServerActivator_i *sa_tmp = new CIAO_ServerActivator_i (spawn_delay, - cs_path, - 0, - false, - tmp_ci->_this (), - orb.in (), - root_poa.in ()); - - PortableServer::ServantBase_var safe = sa_tmp; - - ServerActivator_var sa = sa_tmp->_this (); - - //ACE_DEBUG ((LM_DEBUG, "Attempting to create componentserver with no configvalues\n")); - // Make a componentserver with no configvalues - ComponentServer_var server1 (ComponentServer::_narrow (sa->create_component_server (0))); - - if (CORBA::is_nil (server1.in ())) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Nil componentserver references"), -1); - } - - Components::Deployment::Container_var tmp = server1->create_container (0); - Container_var cont1a = Container::_narrow (tmp.in ()); - - if (CORBA::is_nil (cont1a.in ())) - { - ACE_ERROR ((LM_ERROR, "Error: Got nil object reference from first create op on server 1 %u %u\n", - tmp.in (), cont1a.in ())); - return -1; - } - - // Make our configvalues - // ::Components::ConfigValues_var configs = new - CORBA::Any val; - ::Components::ConfigValues configs(3); - configs.length (3); - - val <<= "create_Bar_Servant"; - configs[0] = new CIAO::ConfigValue_impl (CIAO::Deployment::SVNT_ENTRYPT, - val); - val <<= "Local_Facet_svnt"; - configs[1] = new CIAO::ConfigValue_impl (CIAO::Deployment::SVNT_ARTIFACT, - val); - tmp_ci->install ("Local_Facet_svnt", "Local_Facet_svnt"); - val <<= "Local_Facet_exec"; - configs[2] = new CIAO::ConfigValue_impl (CIAO::Deployment::EXEC_ARTIFACT, - val); - tmp_ci->install ("Local_Facet_exec", "Local_Facet_exec"); - - // Install Components - Components::CCMObject_var comp1 = cont1a->install_component ("User", - "create_Bar_Impl", - configs); - Components::CCMObject_var comp2 = cont1a->install_component ("Provider", - "create_Bar_Impl", - configs); - - if (CORBA::is_nil (comp1) || CORBA::is_nil (comp2)) - { - ACE_ERROR ((LM_ERROR, "Got back a nil component ref from install_component\n")); - return -1; - } - - ::Bar_var user = ::Bar::_narrow (comp1.in ()); - - - if (CORBA::is_nil (user)) - { - ACE_ERROR ((LM_ERROR, "Narrow failed from CCMObject to Bar\n")); - return -1; - } - - - cont1a->connect_local_facet (comp2, "foo_out", comp1, "foo_in"); - - user->run_test (); - - cont1a->remove_component (comp1.in ()); - cont1a->remove_component (comp2.in ()); - - server1->remove_container (cont1a.in ()); - - //ACE_DEBUG ((LM_DEBUG, "Removing component server\n")); - sa->remove_component_server (server1.in ()); - //ACE_DEBUG ((LM_DEBUG, "Componentserver removed\n")); - - orb->destroy (); - } - catch (::Components::CreateFailure &) - { - ACE_ERROR ((LM_ERROR, "Error: Caught CreateFailure exception.\n")); - } - catch (::Components::RemoveFailure &) - { - ACE_ERROR ((LM_ERROR, "Error: Caught RemoveFailure exception.\n")); - } - catch (...) - { - ACE_ERROR ((LM_ERROR, "Error: Caught unknown exception\n")); - } - return 0; -} diff --git a/CIAO/tests/CIAO_ComponentServer/Local_Facet/run_test.pl b/CIAO/tests/CIAO_ComponentServer/Local_Facet/run_test.pl deleted file mode 100755 index d382c821cea..00000000000 --- a/CIAO/tests/CIAO_ComponentServer/Local_Facet/run_test.pl +++ /dev/null @@ -1,26 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib "$ENV{ACE_ROOT}/bin"; -use PerlACE::TestTarget; - -$status = 0; -$ciao_root = "$ENV{CIAO_ROOT}"; - -my $target = PerlACE::TestTarget::create_target (1); - -$TG = $target->CreateProcess ("client", "-s " . $target->GetArchDir("$ciao_root/bin/") . "ciao_componentserver -d 120"); -$server_status = $TG->SpawnWaitKill ($target->ProcessStartWaitInterval ()); - -if ($server_status != 0) { - print STDERR "ERROR: process returned $server_status\n"; - exit 1; -} - -$target->GetStderrLog(); - -exit $status; diff --git a/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent.idl b/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent.idl deleted file mode 100644 index dcf676fb276..00000000000 --- a/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent.idl +++ /dev/null @@ -1,21 +0,0 @@ -//$Id$ - -#include <Components.idl> - -module Foo -{ - interface Simple - { - void trigger (); - }; - - component SimpleComponent supports Simple - { - readonly attribute string creationtype_; - }; - - home SimpleHome manages SimpleComponent - { - }; -}; - diff --git a/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent.mpc b/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent.mpc deleted file mode 100644 index cf6400373a5..00000000000 --- a/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent.mpc +++ /dev/null @@ -1,112 +0,0 @@ -// $Id$ -// This file is generated with "generate_component_mpc.pl SimpleComponent" - -project(SimpleComponent_idl_gen) : componentidldefaults { - custom_only = 1 - idlflags += -Wb,stub_export_macro=SIMPLECOMPONENT_STUB_Export \ - -Wb,stub_export_include=SimpleComponent_stub_export.h \ - -Wb,skel_export_macro=SIMPLECOMPONENT_SVNT_Export \ - -Wb,skel_export_include=SimpleComponent_svnt_export.h \ - -Wb,exec_export_macro=SIMPLECOMPONENT_EXEC_Export \ - -Wb,exec_export_include=SimpleComponent_exec_export.h - - IDL_Files { - SimpleComponent.idl - } -} - -project(SimpleComponent_lem_gen) : ciaoidldefaults { - custom_only = 1 - after += SimpleComponent_idl_gen - idlflags += -Wb,export_macro=SIMPLECOMPONENT_EXEC_Export \ - -Wb,export_include=SimpleComponent_exec_export.h \ - -SS - - IDL_Files { - SimpleComponentE.idl - } -} - -project(SimpleComponent_stub) : ccm_stub { - after += SimpleComponent_idl_gen - - sharedname = SimpleComponent_stub - dynamicflags = SIMPLECOMPONENT_STUB_BUILD_DLL - - IDL_Files { - } - - Source_Files { - SimpleComponentC.cpp - } - - Header_Files { - SimpleComponentC.h - SimpleComponent_stub_export.h - } - - Inline_Files { - SimpleComponentC.inl - } -} - -project(SimpleComponent_exec) : ciao_executor { - after += SimpleComponent_lem_gen SimpleComponent_stub - sharedname = SimpleComponent_exec - libs += SimpleComponent_stub - - dynamicflags = SIMPLECOMPONENT_EXEC_BUILD_DLL - - IDL_Files { - } - - Source_Files { - SimpleComponentEC.cpp - SimpleComponent_exec.cpp - } - - Header_Files { - SimpleComponentEC.h - SimpleComponent_exec.h - SimpleComponent_exec_export.h - } - - Inline_Files { - SimpleComponentEC.inl - } -} - - -project(SimpleComponent_svnt) : ciao_servant { - sharedname = SimpleComponent_svnt - libs += SimpleComponent_stub SimpleComponent_exec - after += SimpleComponent_stub SimpleComponent_exec - dynamicflags = SIMPLECOMPONENT_SVNT_BUILD_DLL - - IDL_Files { - } - Source_Files { - SimpleComponentS.cpp - SimpleComponent_svnt.cpp - } - - Header_Files { - SimpleComponentS.h - SimpleComponent_svnt.h - SimpleComponent_svnt_export.h - } - - Inline_Files { - SimpleComponentS.inl - } -} - -project (SimpleComp_CIAOComponentServer_Tst) : ciao_componentserver_stub, ccm_configvalue, ciao_cs_client, ciao_logger { - after += SimpleComponent_stub SimpleComponent_svnt - libs += SimpleComponent_stub - IDL_Files { - } - Source_Files { - client.cpp - } -} diff --git a/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_exec.cpp b/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_exec.cpp deleted file mode 100644 index 60d0a6eebf7..00000000000 --- a/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_exec.cpp +++ /dev/null @@ -1,131 +0,0 @@ -// $Id$ - -#include "SimpleComponent_exec.h" -#include "ciao/Logger/Log_Macros.h" - -namespace CIAO_Foo_SimpleComponent_Impl -{ - //================================================================== - // Component Executor Implementation Class: SimpleComponent_exec_i - //================================================================== - - SimpleComponent_exec_i::SimpleComponent_exec_i (const char *type) - : type_ (CORBA::string_dup (type)) - { - } - - SimpleComponent_exec_i::~SimpleComponent_exec_i (void) - { - } - - // Supported or inherited operations. - - void - SimpleComponent_exec_i::trigger () - { - ACE_DEBUG ((LM_EMERGENCY, "Hello, world!!!!!!!!\n")); - } - - // Attribute operations. - - char * - SimpleComponent_exec_i::creationtype_ () - { - return CORBA::string_dup (this->type_.in ()); - } - - // Port operations. - - // Operations from Components::SessionComponent - - void - SimpleComponent_exec_i::set_session_context ( - ::Components::SessionContext_ptr ctx) - { - this->context_ = - ::Foo::CCM_SimpleComponent_Context::_narrow (ctx); - - if (CORBA::is_nil (this->context_.in ())) - { - throw ::CORBA::INTERNAL (); - } - } - - void - SimpleComponent_exec_i::configuration_complete () - { - // Your code here. - } - - void - SimpleComponent_exec_i::ccm_activate () - { - // Your code here. - } - - void - SimpleComponent_exec_i::ccm_passivate () - { - // Your code here. - } - - void - SimpleComponent_exec_i::ccm_remove () - { - // Your code here. - } - - //================================================================== - // Home Executor Implementation Class: SimpleHome_exec_i - //================================================================== - - SimpleHome_exec_i::SimpleHome_exec_i (void) - { - CIAO_TRACE ("SimpleHome_exec_i::SimpleHome_exec_i"); - ACE_DEBUG ((LM_NOTICE, CLINFO "SimpleHome_exec_i::SimpleHome_exec_i - " - "Home constructed\n")); - } - - SimpleHome_exec_i::~SimpleHome_exec_i (void) - { - } - - // Supported or inherited operations. - - // Home operations. - - // Factory and finder operations. - - // Attribute operations. - - // Implicit operations. - - ::Components::EnterpriseComponent_ptr - SimpleHome_exec_i::create () - { - ::Components::EnterpriseComponent_ptr retval = - ::Components::EnterpriseComponent::_nil (); - - ACE_NEW_THROW_EX ( - retval, - SimpleComponent_exec_i ("HomeCreated"), - ::CORBA::NO_MEMORY ()); - - return retval; - } - - extern "C" SIMPLECOMPONENT_EXEC_Export ::Components::HomeExecutorBase_ptr - create_Foo_SimpleHome_Impl (void) - { - ::Components::HomeExecutorBase_ptr retval = - ::Components::HomeExecutorBase::_nil (); - - ACE_NEW_RETURN ( - retval, - SimpleHome_exec_i, - ::Components::HomeExecutorBase::_nil ()); - - return retval; - } -} - diff --git a/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_exec.h b/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_exec.h deleted file mode 100644 index 04afe9ffc2c..00000000000 --- a/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_exec.h +++ /dev/null @@ -1,90 +0,0 @@ -// $Id$ - -#ifndef CIAO_SIMPLECOMPONENT_EXEC_H -#define CIAO_SIMPLECOMPONENT_EXEC_H - -#include /**/ "ace/pre.h" - -#include "SimpleComponentEC.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "SimpleComponent_exec_export.h" -#include "tao/LocalObject.h" - -namespace CIAO_Foo_SimpleComponent_Impl -{ - class SIMPLECOMPONENT_EXEC_Export SimpleComponent_exec_i - : public virtual SimpleComponent_Exec, - public virtual ::CORBA::LocalObject - { - public: - SimpleComponent_exec_i (const char *CreateType); - virtual ~SimpleComponent_exec_i (void); - - // Supported or inherited operations. - - virtual void - trigger (); - - // Attribute operations. - - virtual char * - creationtype_ () - ; - - // Port operations. - - // Operations from Components::SessionComponent - - virtual void - set_session_context ( - ::Components::SessionContext_ptr ctx); - - virtual void configuration_complete (); - - virtual void ccm_activate (); - - virtual void ccm_passivate (); - - virtual void ccm_remove (); - - private: - ::Foo::CCM_SimpleComponent_Context_var context_; - - CORBA::String_var type_; - - }; - - class SIMPLECOMPONENT_EXEC_Export SimpleHome_exec_i - : public virtual SimpleHome_Exec, - public virtual ::CORBA::LocalObject - { - public: - SimpleHome_exec_i (void); - virtual ~SimpleHome_exec_i (void); - - // Supported or inherited operations. - - // Home operations. - - // Factory and finder operations. - - // Attribute operations. - - // Implicit operations. - - virtual ::Components::EnterpriseComponent_ptr - create (); - }; - - extern "C" SIMPLECOMPONENT_EXEC_Export ::Components::HomeExecutorBase_ptr - create_Foo_SimpleHome_Impl (void); -} - -#include /**/ "ace/post.h" - -#endif /* CIAO_SIMPLECOMPONENT_EXEC_H */ - diff --git a/CIAO/tests/CIAO_ComponentServer/SimpleComponent/client.cpp b/CIAO/tests/CIAO_ComponentServer/SimpleComponent/client.cpp deleted file mode 100644 index bdcdf022d1a..00000000000 --- a/CIAO/tests/CIAO_ComponentServer/SimpleComponent/client.cpp +++ /dev/null @@ -1,187 +0,0 @@ -// $Id$ - -#include "ace/Get_Opt.h" -#include "ciao/ComponentServer/CIAO_CS_ClientS.h" -#include "ciao/ComponentServer/CIAO_ComponentServerC.h" -#include "ciao/ComponentServer/CIAO_ServerActivator_Impl.h" -#include "ciao/ComponentServer/CIAO_ComponentInstallation_Impl.h" -#include "ciao/ComponentServer/CIAO_PropertiesC.h" -#include "ciao/Valuetype_Factories/ConfigValue.h" -#include "ciao/Logger/Logger_Service.h" - -#include "SimpleComponentC.h" - -const char *cs_path = "ciao_componentserver"; -CORBA::ULong spawn_delay = 30; - -int -parse_args (int argc, ACE_TCHAR *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("s:d:")); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 's': - cs_path = ACE_TEXT_ALWAYS_CHAR (get_opts.opt_arg ()); - break; - - case 'd': - spawn_delay = ACE_OS::atoi (get_opts.opt_arg ()); - break; - - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-s <path> " - "-d <uint> " - "\n", - argv [0]), - -1); - } - // Indicates sucessful parsing of the command line - return 0; -} - -int -ACE_TMAIN (int argc, ACE_TCHAR **argv) -{ - using namespace CIAO::Deployment; - - CIAO::Logger_Service logger; - - logger.init (argc, argv); - try - { - CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); - if (parse_args (argc, argv) != 0) - return 1; - - CORBA::Object_var object = - orb->resolve_initial_references ("RootPOA"); - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (object.in ()); - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (); - - poa_manager->activate (); - ACE_DEBUG ((LM_DEBUG, "foo\n")); - - CIAO::Deployment::ComponentInstallation_Impl *tmp_ci = 0; - - ACE_NEW_THROW_EX (tmp_ci, - CIAO::Deployment::ComponentInstallation_Impl (), - CORBA::NO_MEMORY ()); - - PortableServer::ServantBase_var safe_servant = tmp_ci; - - root_poa->activate_object (tmp_ci); - - CIAO_ServerActivator_i *sa_tmp = new CIAO_ServerActivator_i (spawn_delay, - cs_path, - 0, - false, - tmp_ci->_this (), - orb.in (), - root_poa.in ()); - - PortableServer::ServantBase_var safe = sa_tmp; - - ServerActivator_var sa = sa_tmp->_this (); - - //ACE_DEBUG ((LM_DEBUG, "Attempting to create componentserver with no configvalues\n")); - // Make a componentserver with no configvalues - ComponentServer_var server1 (ComponentServer::_narrow (sa->create_component_server (0))); - - if (CORBA::is_nil (server1.in ())) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Nil componentserver references"), -1); - } - - Components::Deployment::Container_var tmp = server1->create_container (0); - Container_var cont1a = Container::_narrow (tmp.in ()); - - if (CORBA::is_nil (cont1a.in ())) - { - ACE_ERROR ((LM_ERROR, "Error: Got nil object reference from first create op on server 1 %u %u\n", - tmp.in (), cont1a.in ())); - return -1; - } - - // Make our configvalues - // ::Components::ConfigValues_var configs = new - CORBA::Any val; - ::Components::ConfigValues configs(3); - configs.length (3); - - val <<= "create_Foo_SimpleHome_Servant"; - configs[0] = new CIAO::ConfigValue_impl (CIAO::Deployment::SVNT_ENTRYPT, - val); - val <<= "SimpleComponent_svnt"; - configs[1] = new CIAO::ConfigValue_impl (CIAO::Deployment::SVNT_ARTIFACT, - val); - tmp_ci->install ("SimpleComponent_svnt", "SimpleComponent_svnt"); - val <<= "SimpleComponent_exec"; - configs[2] = new CIAO::ConfigValue_impl (CIAO::Deployment::EXEC_ARTIFACT, - val); - tmp_ci->install ("SimpleComponent_exec", "SimpleComponent_exec"); - - // Install Home - Components::CCMHome_var home = cont1a->install_home ("MyNameIsEarl", - "create_Foo_SimpleHome_Impl", - configs); - - if (CORBA::is_nil (home)) - { - ACE_ERROR ((LM_ERROR, "Got back a nil home ref from install_home\n")); - return -1; - } - - Foo::SimpleHome_var shome = Foo::SimpleHome::_narrow (home.in ()); - - if (CORBA::is_nil (shome)) - { - ACE_ERROR ((LM_ERROR, "Narrow failed from CCM_Home to SimpleHome\n")); - return -1; - } - - - Foo::SimpleComponent_var sc = shome->create (); - - if (CORBA::is_nil (sc)) - { - ACE_ERROR ((LM_ERROR, "Home failed to make a component\n")); - return -1; - } - - sc->trigger (); - - cont1a->remove_home (home.in ()); - - server1->remove_container (cont1a.in ()); - - //ACE_DEBUG ((LM_DEBUG, "Removing component server\n")); - sa->remove_component_server (server1.in ()); - //ACE_DEBUG ((LM_DEBUG, "Componentserver removed\n")); - - orb->destroy (); - } - catch (::Components::CreateFailure &) - { - ACE_ERROR ((LM_ERROR, "Error: Caught CreateFailure exception.\n")); - } - catch (::Components::RemoveFailure &) - { - ACE_ERROR ((LM_ERROR, "Error: Caught RemoveFailure exception.\n")); - } - catch (...) - { - ACE_ERROR ((LM_ERROR, "Error: Caught unknown exception\n")); - } - return 0; -} diff --git a/CIAO/tests/CIAO_ComponentServer/SimpleComponent/run_test.pl b/CIAO/tests/CIAO_ComponentServer/SimpleComponent/run_test.pl deleted file mode 100755 index d382c821cea..00000000000 --- a/CIAO/tests/CIAO_ComponentServer/SimpleComponent/run_test.pl +++ /dev/null @@ -1,26 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib "$ENV{ACE_ROOT}/bin"; -use PerlACE::TestTarget; - -$status = 0; -$ciao_root = "$ENV{CIAO_ROOT}"; - -my $target = PerlACE::TestTarget::create_target (1); - -$TG = $target->CreateProcess ("client", "-s " . $target->GetArchDir("$ciao_root/bin/") . "ciao_componentserver -d 120"); -$server_status = $TG->SpawnWaitKill ($target->ProcessStartWaitInterval ()); - -if ($server_status != 0) { - print STDERR "ERROR: process returned $server_status\n"; - exit 1; -} - -$target->GetStderrLog(); - -exit $status; diff --git a/CIAO/tests/CIF/Common/CIF_Common.mpc b/CIAO/tests/CIF/Common/CIF_Common.mpc index 4255b1d343c..5f985b5f264 100644 --- a/CIAO/tests/CIF/Common/CIF_Common.mpc +++ b/CIAO/tests/CIF/Common/CIF_Common.mpc @@ -1,8 +1,9 @@ // $Id$ -project (CIF_Common) : ciao_componentserver_stub, ccm_configvalue, ciao_cs_client, ciao_logger { +project (CIF_Common) : ccm_configvalue, ciao_logger { dynamicflags = CIF_COMMON_BUILD_DLL sharedname = CIF_Common + requires += dummy_label libout = ../lib IDL_Files { } diff --git a/CIAO/tests/CIF/Navigation/Navigation.mpc b/CIAO/tests/CIF/Navigation/Navigation.mpc index d544cc72ed8..4d14409b95d 100644 --- a/CIAO/tests/CIF/Navigation/Navigation.mpc +++ b/CIAO/tests/CIF/Navigation/Navigation.mpc @@ -1,7 +1,7 @@ // $Id$ project(Navigation_idl_gen) : componentidldefaults { - + requires += dummy_label custom_only = 1 idlflags += -Wb,stub_export_macro=NAVIGATION_STUB_Export \ -Wb,stub_export_include=Navigation_stub_export.h \ @@ -16,7 +16,7 @@ project(Navigation_idl_gen) : componentidldefaults { } project(Navigation_lem_gen) : ciaoidldefaults { - + requires += dummy_label after += Navigation_idl_gen custom_only = 1 idlflags += -Wb,stub_export_macro=NAVIGATION_LEM_STUB_Export \ @@ -29,7 +29,7 @@ project(Navigation_lem_gen) : ciaoidldefaults { } project(Navigation_lem_stub) : ccm_svnt { - + requires += dummy_label after += Navigation_lem_gen Navigation_stub libs += Navigation_stub libpaths += ../lib @@ -56,7 +56,7 @@ project(Navigation_lem_stub) : ccm_svnt { } project(Navigation_stub) : ccm_stub { - + requires += dummy_label after += Navigation_idl_gen libs += libpaths += ../lib @@ -84,7 +84,7 @@ project(Navigation_stub) : ccm_stub { } project(Navigation_exec) : ciao_executor { - + requires += dummy_label after += Navigation_lem_stub Navigation_stub sharedname = Navigation_exec libs += Navigation_stub Navigation_lem_stub @@ -112,7 +112,7 @@ project(Navigation_exec) : ciao_executor { project(Navigation_svnt) : ciao_servant { - + requires += dummy_label after += Navigation_lem_stub sharedname = Navigation_svnt libs += Navigation_stub Navigation_lem_stub @@ -141,12 +141,12 @@ project(Navigation_svnt) : ciao_servant { } } -project (Navigation_client_test) : ciao_componentserver_stub, ccm_configvalue, ciao_cs_client, ciao_logger { +project (Navigation_client_test) : ccm_configvalue, ciao_logger { after += Navigation_stub Navigation_svnt CIF_Common libpaths += ../lib libs += Navigation_stub CIF_Common includes += .. - + requires += dummy_label IDL_Files { } diff --git a/CIAO/tests/CIF/Receptacle/Receptacle.mpc b/CIAO/tests/CIF/Receptacle/Receptacle.mpc index 0b1180c5fc0..8dce83e4f82 100644 --- a/CIAO/tests/CIF/Receptacle/Receptacle.mpc +++ b/CIAO/tests/CIF/Receptacle/Receptacle.mpc @@ -1,7 +1,7 @@ // $Id$ project(Receptacle_idl_gen) : componentidldefaults { - + requires += dummy_label custom_only = 1 idlflags += -Wb,stub_export_macro=RECEPTACLE_STUB_Export \ -Wb,stub_export_include=Receptacle_stub_export.h \ @@ -16,7 +16,7 @@ project(Receptacle_idl_gen) : componentidldefaults { } project(Receptacle_lem_gen) : ciaoidldefaults { - + requires += dummy_label after += Receptacle_idl_gen custom_only = 1 idlflags += -Wb,stub_export_macro=RECEPTACLE_LEM_STUB_Export \ @@ -29,7 +29,7 @@ project(Receptacle_lem_gen) : ciaoidldefaults { } project(Receptacle_lem_stub) : ccm_svnt { - + requires += dummy_label after += Receptacle_lem_gen Receptacle_stub libs += Receptacle_stub libpaths += ../lib @@ -56,7 +56,7 @@ project(Receptacle_lem_stub) : ccm_svnt { } project(Receptacle_stub) : ccm_stub { - + requires += dummy_label after += Receptacle_idl_gen libs += libpaths += ../lib @@ -84,7 +84,7 @@ project(Receptacle_stub) : ccm_stub { } project(Receptacle_exec) : ciao_executor { - + requires += dummy_label after += Receptacle_lem_stub Receptacle_stub sharedname = Receptacle_exec libs += Receptacle_stub Receptacle_lem_stub @@ -112,7 +112,7 @@ project(Receptacle_exec) : ciao_executor { project(Receptacle_svnt) : ciao_servant { - + requires += dummy_label after += Receptacle_lem_stub sharedname = Receptacle_svnt libs += Receptacle_stub Receptacle_lem_stub @@ -141,12 +141,12 @@ project(Receptacle_svnt) : ciao_servant { } } -project (Receptacle_client_test) : ciao_componentserver_stub, ccm_configvalue, ciao_cs_client, ciao_logger { +project (Receptacle_client_test) : ccm_configvalue, ciao_logger { after += Receptacle_stub Receptacle_svnt CIF_Common libpaths += ../lib libs += Receptacle_stub CIF_Common includes += .. - + requires += dummy_label IDL_Files { } |