diff options
Diffstat (limited to 'TAO/CIAO/DAnCE')
63 files changed, 1129 insertions, 2148 deletions
diff --git a/TAO/CIAO/DAnCE/Config_Handlers/Basic_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/Basic_Handler.h index a8d31ea54f1..6c7089915b6 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/Basic_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/Basic_Handler.h @@ -11,7 +11,7 @@ #ifndef BASIC_HANDLER_H #define BASIC_HANDLER_H -#include "Config.h" +#include "Deployment.h" #include "ace/SString.h" #include "ace/Null_Mutex.h" diff --git a/TAO/CIAO/DAnCE/Config_Handlers/CAD_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/CAD_Handler.h index 515a59d70c2..1e867628279 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/CAD_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/CAD_Handler.h @@ -11,17 +11,18 @@ #define CAD_HANDLER_H #include /**/ "ace/pre.h" -#include "ciao/DeploymentC.h" +#include "DeploymentC.h" +#include "Config_Handler_export.h" +#include "ace/SString.h" +#include "ace/Hash_Map_Manager.h" +#include "ace/Null_Mutex.h" + +#include "Basic_Handler.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) #pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "Basic_Handler.h" -#include "Config_Handler_export.h" -#include "ace/SString.h" -#include "ace/Hash_Map_Manager.h" -#include "ace/Null_Mutex.h" #include "ace/Auto_Ptr.h" #include "ace/Log_Msg.h" #include "ace/OS_main.h" diff --git a/TAO/CIAO/DAnCE/Config_Handlers/CEPE_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/CEPE_Handler.h index 18eabeff80e..3d1fb12b00b 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/CEPE_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/CEPE_Handler.h @@ -11,13 +11,13 @@ #define CEPE_HANDLER_H #include /**/ "ace/pre.h" -#include "ciao/DeploymentC.h" +#include "DeploymentC.h" +#include "Config_Handler_export.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) #pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "Config_Handler_export.h" #include <xercesc/util/XercesDefs.hpp> #include <xercesc/dom/DOM.hpp> #include "XercesString.h" diff --git a/TAO/CIAO/DAnCE/Config_Handlers/CPK_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/CPK_Handler.h index 2c34055e08e..2eaa7b6a216 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/CPK_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/CPK_Handler.h @@ -12,7 +12,7 @@ #define CPK_HANDLER_H #include /**/ "ace/pre.h" -#include "ciao/DeploymentC.h" +#include "DeploymentC.h" #include "Config_Handler_export.h" #include <xercesc/util/XercesDefs.hpp> diff --git a/TAO/CIAO/DAnCE/Config_Handlers/CPR_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/CPR_Handler.h index 8e9c8132f17..4d56f71a3ca 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/CPR_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/CPR_Handler.h @@ -11,13 +11,13 @@ #define CPR_HANDLER_H #include /**/ "ace/pre.h" -#include "ciao/DeploymentC.h" +#include "DeploymentC.h" +#include "Config_Handler_export.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) #pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "Config_Handler_export.h" #include "ace/SString.h" #include <xercesc/util/XercesDefs.hpp> #include <xercesc/dom/DOM.hpp> diff --git a/TAO/CIAO/DAnCE/Config_Handlers/Cap_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/Cap_Handler.h index f680961f75d..2abfcf09deb 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/Cap_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/Cap_Handler.h @@ -12,7 +12,7 @@ #define CAP_HANDLER_H #include /**/ "ace/pre.h" -#include "ciao/DeploymentC.h" +#include "DeploymentC.h" #include "Config_Handler_export.h" #include "ace/SString.h" #include "ace/Hash_Map_Manager.h" diff --git a/TAO/CIAO/DAnCE/Config_Handlers/CompIntrDesc_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/CompIntrDesc_Handler.h index 7c4e2e22898..7932ebd4b30 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/CompIntrDesc_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/CompIntrDesc_Handler.h @@ -4,7 +4,7 @@ #define COMPINTRDESC_HANDLER_H #include /**/ "ace/pre.h" -#include "ciao/DeploymentC.h" +#include "DeploymentC.h" #include "Config_Handler_export.h" #include "ace/SString.h" #include "ace/Hash_Map_Manager.h" diff --git a/TAO/CIAO/DAnCE/Config_Handlers/CompPkgDesc_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/CompPkgDesc_Handler.h index 9cd81ffa5f5..202afca9b2c 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/CompPkgDesc_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/CompPkgDesc_Handler.h @@ -12,7 +12,7 @@ #define COMPPKGDESC_HANDLER_H #include /**/ "ace/pre.h" -#include "ciao/DeploymentC.h" +#include "DeploymentC.h" #include "Config_Handler_export.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) diff --git a/TAO/CIAO/DAnCE/Config_Handlers/Config_Error_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/Config_Error_Handler.h index ba1b8b5514c..4c039938d90 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/Config_Error_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/Config_Error_Handler.h @@ -42,7 +42,7 @@ namespace CIAO }; - } + }; } #include /**/ "ace/post.h" diff --git a/TAO/CIAO/DAnCE/Config_Handlers/Config_Handlers.mpc b/TAO/CIAO/DAnCE/Config_Handlers/Config_Handlers.mpc index 12ab9879d79..d8b0271f991 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/Config_Handlers.mpc +++ b/TAO/CIAO/DAnCE/Config_Handlers/Config_Handlers.mpc @@ -2,14 +2,13 @@ project (Config_Handlers) : ciao_deployment_stub { - after += CIAO_DnC_Server sharedname = Config_Handlers dynamicflags = CONFIG_HANDLER_BUILD_DLL macros += XML_USE_PTHREADS requires += exceptions - includes += $(XERCESCROOT)/include - libpaths += $(XERCESCROOT)/lib - libs += xerces-c CIAO_DnC_Server TAO_IFR_Client TAO_Valuetype + includes += /usr/include $(XERCESCROOT)/include + libpaths += /usr/lib $(XERCESCROOT)/lib + libs += xerces-c CIAO_DnC_Server TAO_IFR_Client Source_Files { Utils.cpp @@ -47,42 +46,3 @@ project (Config_Handlers) : ciao_deployment_stub { XercesString.cpp } } - -project (XSC_Config_Handlers) : ciao_deployment_stub { - - requires += dummy_label - - sharedname = XSC_Config_Handlers - dynamicflags = CONFIG_HANDLER_BUILD_DLL - macros += XML_USE_PTHREADS - requires += exceptions - includes += $(XERCESCROOT)/include . - libpaths += $(XERCESCROOT)/lib - libs += xerces-c CIAO_DnC_Server TAO_IFR_Client - - Source_Files { - Basic_Deployment_Data.cpp - ccd.cpp - cdd.cpp - cdp.cpp - cid.cpp - cpd.cpp - Deployment.cpp - iad.cpp - pcd.cpp - toplevel.cpp - } - - Header_Files { - Basic_Deployment_Data.hpp - ccd.hpp - cdd.hpp - cdp.hpp - cid.hpp - cpd.hpp - Deployment.hpp - iad.hpp - pcd.hpp - toplevel.hpp - } -} diff --git a/TAO/CIAO/DAnCE/Config_Handlers/DT_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/DT_Handler.h index 8cd04c66650..faac487e828 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/DT_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/DT_Handler.h @@ -12,6 +12,7 @@ #define DT_HANDLER_H #include /**/ "ace/pre.h" +#include "DeploymentC.h" #include "Config_Handler_export.h" #include "tao/ORB.h" diff --git a/TAO/CIAO/DAnCE/Config_Handlers/Deployment.h b/TAO/CIAO/DAnCE/Config_Handlers/Deployment.h new file mode 100644 index 00000000000..a3fc3b72004 --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/Deployment.h @@ -0,0 +1,17 @@ +//================================================================== +/** + * @file Deployment.h + * + * $Id$ + * + * @author Emre Turkay <emre.turkay@vanderbilt.edu> + */ +//===================================================================== + +#ifndef DEPLOYMENT_H +#define DEPLOYMENT_H + +#define BEGIN_DEPLOYMENT_NAMESPACE namespace CIAO { namespace Config_Handler { +#define END_DEPLOYMENT_NAMESPACE }; }; + +#endif // DEPLOYMENT_H diff --git a/TAO/CIAO/DAnCE/Config_Handlers/DnC_Dump.h b/TAO/CIAO/DAnCE/Config_Handlers/DnC_Dump.h index b20b98469e9..47d7899432b 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/DnC_Dump.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/DnC_Dump.h @@ -37,8 +37,8 @@ namespace Deployment public: /// Dump functions for CORBA sequences - static void dump (const char* caption, - const ::CORBA::StringSeq &str_seq); + static void DnC_Dump::dump (const char* caption, + const ::CORBA::StringSeq &str_seq); template <typename SEQUENCE> static void dump_sequence (const char* caption, const SEQUENCE &seq); diff --git a/TAO/CIAO/DAnCE/Config_Handlers/Domain_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/Domain_Handler.h index 327bfe54bba..a29e7cf7fd1 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/Domain_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/Domain_Handler.h @@ -11,7 +11,7 @@ #define DOMAIN_HANDLER_H #include /**/ "ace/pre.h" -#include "ciao/DeploymentC.h" +#include "DeploymentC.h" #include "Config_Handler_export.h" #include "Basic_Handler.h" #include "XercesString.h" diff --git a/TAO/CIAO/DAnCE/Config_Handlers/ERE_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/ERE_Handler.h index 272bd8ecc63..3fdafe87009 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/ERE_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/ERE_Handler.h @@ -13,13 +13,13 @@ #define ERE_HANDLER_H #include /**/ "ace/pre.h" -#include "ciao/DeploymentC.h" +#include "DeploymentC.h" +#include "Config_Handler_export.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) #pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "Config_Handler_export.h" #include <xercesc/util/XercesDefs.hpp> #include <xercesc/dom/DOM.hpp> #include "XercesString.h" diff --git a/TAO/CIAO/DAnCE/Config_Handlers/IAD_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/IAD_Handler.h index 8cbfabd510e..a46de1d885f 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/IAD_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/IAD_Handler.h @@ -12,7 +12,7 @@ #define IAD_HANDLER_H #include /**/ "ace/pre.h" -#include "ciao/DeploymentC.h" +#include "DeploymentC.h" #include "Config_Handler_export.h" #include "ace/SString.h" #include "ace/Hash_Map_Manager.h" diff --git a/TAO/CIAO/DAnCE/Config_Handlers/ID_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/ID_Handler.h index c2142cfb706..ef7f9c5c86d 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/ID_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/ID_Handler.h @@ -12,7 +12,7 @@ #define ID_HANDLER_H #include /**/ "ace/pre.h" -#include "ciao/DeploymentC.h" +#include "DeploymentC.h" #include "Config_Handler_export.h" #include <xercesc/util/XercesDefs.hpp> diff --git a/TAO/CIAO/DAnCE/Config_Handlers/IR_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/IR_Handler.h index d7ff20f1c99..9e159ed2636 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/IR_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/IR_Handler.h @@ -12,7 +12,7 @@ #define IR_HANDLER_H #include /**/ "ace/pre.h" -#include "ciao/DeploymentC.h" +#include "DeploymentC.h" #include "Config_Handler_export.h" #include "Basic_Handler.h" diff --git a/TAO/CIAO/DAnCE/Config_Handlers/MID_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/MID_Handler.h index 4c99ef81621..17c3a2c4a3d 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/MID_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/MID_Handler.h @@ -4,7 +4,7 @@ #define MID_HANDLER_H #include /**/ "ace/pre.h" -#include "ciao/DeploymentC.h" +#include "DeploymentC.h" #include "Config_Handler_export.h" #include "ace/SString.h" #include "ace/Hash_Map_Manager.h" diff --git a/TAO/CIAO/DAnCE/Config_Handlers/NIA_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/NIA_Handler.h index cc3b1fd2a11..38ad44beed2 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/NIA_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/NIA_Handler.h @@ -12,7 +12,7 @@ #define NIA_HANDLER_H #include /**/ "ace/pre.h" -#include "ciao/DeploymentC.h" +#include "DeploymentC.h" #include "Config_Handler_export.h" #include "Basic_Handler.h" diff --git a/TAO/CIAO/DAnCE/Config_Handlers/PCI_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/PCI_Handler.h index 95cefcf5a90..841db0fc0a6 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/PCI_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/PCI_Handler.h @@ -12,7 +12,7 @@ #define PCI_HANDLER_H #include /**/ "ace/pre.h" -#include "ciao/DeploymentC.h" +#include "DeploymentC.h" #include "Config_Handler_export.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) diff --git a/TAO/CIAO/DAnCE/Config_Handlers/PC_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/PC_Handler.h index 9dfa24dd354..224f298f0a4 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/PC_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/PC_Handler.h @@ -12,7 +12,7 @@ #define PC_HANDLER_H #include /**/ "ace/pre.h" -#include "ciao/DeploymentC.h" +#include "DeploymentC.h" #include "Config_Handler_export.h" #include "Basic_Handler.h" diff --git a/TAO/CIAO/DAnCE/Config_Handlers/Plan_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/Plan_Handler.h index c4994e4255d..3983e4f1faf 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/Plan_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/Plan_Handler.h @@ -11,17 +11,17 @@ #define PLAN_HANDLER_H #include /**/ "ace/pre.h" -#include "ciao/DeploymentC.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - +#include "DeploymentC.h" #include "Basic_Handler.h" #include "Config_Handler_export.h" #include "ace/SString.h" #include "ace/Hash_Map_Manager.h" #include "ace/Null_Mutex.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +#pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "ace/Auto_Ptr.h" #include "ace/Log_Msg.h" #include "ace/OS_main.h" diff --git a/TAO/CIAO/DAnCE/Config_Handlers/Process_Element.h b/TAO/CIAO/DAnCE/Config_Handlers/Process_Element.h index bec9e523fe4..c60c1e14b75 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/Process_Element.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/Process_Element.h @@ -12,8 +12,8 @@ #ifndef PROCESS_ELEMENT_H #define PROCESS_ELEMENT_H -#include "ciao/DeploymentC.h" -#include "Config.h" +#include "DeploymentC.h" +#include "Deployment.h" #include "Basic_Handler.h" #include "Config_Handler_export.h" #include "ace/SString.h" diff --git a/TAO/CIAO/DAnCE/Config_Handlers/Property_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/Property_Handler.h index 1e392aea185..3367a2e1348 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/Property_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/Property_Handler.h @@ -10,14 +10,16 @@ #ifndef PROPERTY_HANDLER_H #define PROPERTY_HANDLER_H -#include /**/ "ace/pre.h" -#include "ciao/DeploymentC.h" +#include /**/ "ace/pre.h" +#include "DeploymentC.h" #include "Config_Handler_export.h" + #include <xercesc/util/XercesDefs.hpp> #include <xercesc/dom/DOM.hpp> #include "XercesString.h" + using Config_Handler::XStr; using xercesc::XMLString; using xercesc::DOMText; diff --git a/TAO/CIAO/DAnCE/Config_Handlers/RS_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/RS_Handler.h index dff3a6e149d..11d858b4141 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/RS_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/RS_Handler.h @@ -12,7 +12,7 @@ #define RS_HANDLER_H #include /**/ "ace/pre.h" -#include "ciao/DeploymentC.h" +#include "DeploymentC.h" #include "Config_Handler_export.h" #include <xercesc/util/XercesDefs.hpp> diff --git a/TAO/CIAO/DAnCE/Config_Handlers/RUK_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/RUK_Handler.h index b988eead549..70536e39072 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/RUK_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/RUK_Handler.h @@ -12,7 +12,7 @@ #define RUK_HANDLER_H #include /**/ "ace/pre.h" -#include "ciao/DeploymentC.h" +#include "DeploymentC.h" #include "Config_Handler_export.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) diff --git a/TAO/CIAO/DAnCE/Config_Handlers/Requirement_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/Requirement_Handler.h index c01ead11cab..b960e9b70d7 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/Requirement_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/Requirement_Handler.h @@ -12,7 +12,7 @@ #define REQUIREMENT_HANDLER_H #include /**/ "ace/pre.h" -#include "ciao/DeploymentC.h" +#include "DeploymentC.h" #include "Config_Handler_export.h" #include <xercesc/util/XercesDefs.hpp> diff --git a/TAO/CIAO/DAnCE/Config_Handlers/SPK_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/SPK_Handler.h index 7a9caa3c2a0..51b6f1eb8b2 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/SPK_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/SPK_Handler.h @@ -12,7 +12,7 @@ #define SPK_HANDLER_H #include /**/ "ace/pre.h" -#include "ciao/DeploymentC.h" +#include "DeploymentC.h" #include "Config_Handler_export.h" #include <xercesc/util/XercesDefs.hpp> diff --git a/TAO/CIAO/DAnCE/Config_Handlers/SP_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/SP_Handler.h index a45dcf7d508..a5402097793 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/SP_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/SP_Handler.h @@ -12,7 +12,7 @@ #define SP_HANDLER_H #include /**/ "ace/pre.h" -#include "ciao/DeploymentC.h" +#include "DeploymentC.h" #include "Config_Handler_export.h" #include <xercesc/util/XercesDefs.hpp> diff --git a/TAO/CIAO/DAnCE/Config_Handlers/TPD_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/TPD_Handler.h index 20b7020bd58..30265026f8c 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/TPD_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/TPD_Handler.h @@ -12,7 +12,7 @@ #define TPD_HANDLER_H #include /**/ "ace/pre.h" -#include "ciao/DeploymentC.h" +#include "DeploymentC.h" #include "Config_Handler_export.h" #include "Basic_Handler.h" diff --git a/TAO/CIAO/DAnCE/Config_Handlers/Utils.h b/TAO/CIAO/DAnCE/Config_Handlers/Utils.h index c47cd4a37c2..dd051603d40 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/Utils.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/Utils.h @@ -17,7 +17,7 @@ #include /**/ "ace/pre.h" #include "Config_Handler_export.h" -#include "ciao/DeploymentC.h" +#include "DeploymentC.h" #include "tao/Basic_Types.h" #include "XercesString.h" diff --git a/TAO/CIAO/DAnCE/ExecutionManager/ExecutionManager_Impl.h b/TAO/CIAO/DAnCE/ExecutionManager/ExecutionManager_Impl.h index 1d009de77a6..ebc5aab66e3 100644 --- a/TAO/CIAO/DAnCE/ExecutionManager/ExecutionManager_Impl.h +++ b/TAO/CIAO/DAnCE/ExecutionManager/ExecutionManager_Impl.h @@ -126,7 +126,7 @@ namespace CIAO TAO::Utils::Servant_Var<CIAO::DomainApplicationManager_Impl> dam_servant_; }; -} +}; #include /**/ "ace/post.h" #endif /* EXECUTIONMANAGER_IMPL_H */ diff --git a/TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager.cpp b/TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager.cpp index 7c8101ee800..3a253faa012 100644 --- a/TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager.cpp +++ b/TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager.cpp @@ -28,7 +28,7 @@ #include "tao/IORTable/IORTable.h" // Include Name Service header -#include "orbsvcs/CosNamingC.h" +#include "orbsvcs/orbsvcs/CosNamingC.h" #include "ace/SString.h" #include "ace/Read_Buffer.h" @@ -102,17 +102,14 @@ write_IOR(const char* ior) return 0; } -bool +int register_with_ns (const char * name_context, CORBA::ORB_ptr orb, - CIAO::ExecutionManagerDaemon_ptr obj - ACE_ENV_ARG_DECL) + CIAO::ExecutionManagerDaemon_ptr obj) { // Naming Service related operations CORBA::Object_var naming_context_object = - orb->resolve_initial_references ("NameService" - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (false); + orb->resolve_initial_references ("NameService"); CosNaming::NamingContext_var naming_context = CosNaming::NamingContext::_narrow (naming_context_object.in ()); @@ -121,15 +118,12 @@ register_with_ns (const char * name_context, CosNaming::Name name (1); name.length (1); // Register the name with the NS - name[0].id = name_context; + name[0].id = CORBA::string_dup (name_context); // Register the servant with the Naming Service - naming_context->bind (name, - obj - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (false); + naming_context->bind (name, obj); - return true; + return 0; } int @@ -137,8 +131,6 @@ main (int argc, char *argv[]) { ACE_TRY_NEW_ENV { - // @@ Error checking is very bad! Need to be fixed! - // -- bala // Initialize orb CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, @@ -166,8 +158,7 @@ main (int argc, char *argv[]) ACE_TRY_CHECK; IORTable::Table_var adapter = - IORTable::Table::_narrow (table_object.in () - ACE_ENV_ARG_PARAMETER); + IORTable::Table::_narrow (table_object.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (CORBA::is_nil (adapter.in ())) @@ -183,18 +174,14 @@ main (int argc, char *argv[]) // Implicit activation PortableServer::ServantBase_var safe_daemon (daemon_servant); - CIAO::ExecutionManagerDaemon_var daemon = - daemon_servant->_this (); + CIAO::ExecutionManagerDaemon_var daemon = daemon_servant->_this (); // Now register daemon with IOR table and write its IOR. - CORBA::String_var str = - orb->object_to_string (daemon.in () - ACE_ENV_ARG_PARAMETER); + CORBA::String_var str = orb->object_to_string (daemon.in () + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - adapter->bind ("ExecutionManager", - str.in () - ACE_ENV_ARG_PARAMETER); + adapter->bind ("ExecutionManager", str.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (write_to_ior_) @@ -202,17 +189,10 @@ main (int argc, char *argv[]) else if (register_with_ns_) { // Register this name with the Naming Service - (void) register_with_ns (name, - orb.in (), - daemon.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + register_with_ns (name, orb.in (), daemon.in ()); } -#if 0 - ACE_DEBUG ((LM_INFO, - "CIAO_ExecutionMananger IOR: %s\n", str.in ())); -#endif /*if 0*/ + ACE_DEBUG ((LM_INFO, "CIAO_ExecutionMananger IOR: %s\n", str.in ())); // Activate POA manager PortableServer::POAManager_var mgr diff --git a/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp b/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp index 86ef0881fa8..2021a7b5839 100644 --- a/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp +++ b/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp @@ -239,8 +239,7 @@ create_connections (ACE_ENV_SINGLE_ARG_DECL) const CORBA::ULong facet_len = facets->length (); const CORBA::ULong consumer_len = consumers->length (); - CORBA::ULong curr_len = retv->length (); - retv->length (curr_len + facet_len + consumer_len); + retv->length (facet_len + consumer_len); CORBA::ULong i = 0; for (i = 0; i < facet_len; ++i) @@ -309,7 +308,7 @@ startLaunch (const Deployment::Properties & configProperty, Deployment::ComponentInfos_var comp_info; // For debugging. - if (true) //(CIAO::debug_level () > 1) + if (CIAO::debug_level () > 1) { const CORBA::ULong info_len = infos.length (); for (CORBA::ULong i = 0; i < info_len; ++i) diff --git a/TAO/CIAO/DAnCE/NodeManager/NodeDaemon_Impl.cpp b/TAO/CIAO/DAnCE/NodeManager/NodeDaemon_Impl.cpp index a48fa385a45..49cb6647fb1 100644 --- a/TAO/CIAO/DAnCE/NodeManager/NodeDaemon_Impl.cpp +++ b/TAO/CIAO/DAnCE/NodeManager/NodeDaemon_Impl.cpp @@ -3,6 +3,9 @@ #include "NodeDaemon_Impl.h" #include "../NodeApplicationManager/NodeApplicationManager_Impl.h" +// @@ (OO) Method definitions should never use "_WITH_DEFAULTS" +// versions of emulated exception parameters. Please remove +// the "_WITH_DEFAULTS" CIAO::NodeDaemon_Impl::NodeDaemon_Impl (const char *name, CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, @@ -19,30 +22,27 @@ CIAO::NodeDaemon_Impl::NodeDaemon_Impl (const char *name, { ACE_DECLARE_NEW_CORBA_ENV; ACE_TRY - { - //create the call back poa for NAM. - PortableServer::POAManager_var mgr - = this->poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - this->callback_poa_ = - this->poa_->create_POA ("callback_poa", - mgr.in (), - 0 - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + { + //create the call back poa for NAM. + PortableServer::POAManager_var mgr + = this->poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; - } + this->callback_poa_ = + this->poa_->create_POA ("callback_poa", + mgr.in (), + 0 + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + } ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "NodeDaemon_Impl::constructor\t\n"); - // @@ This is bogus and will not work with emulated exceptions - // -- Bala - ACE_RE_THROW; - } + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "NodeDaemon_Impl::constructor\t\n"); + ACE_RE_THROW; + } ACE_ENDTRY; - ACE_CHECK; } CIAO::NodeDaemon_Impl::~NodeDaemon_Impl () @@ -125,12 +125,19 @@ CIAO::NodeDaemon_Impl::preparePlan (const Deployment::DeploymentPlan &plan ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; + // Obtain the Object Reference + //CORBA::Object_var obj = + // this->poa_->servant_to_reference (app_mgr ACE_ENV_ARG_PARAMETER); + //ACE_TRY_CHECK; + + //this->manager_ = + // Deployment::NodeApplicationManager::_narrow (obj.in ()); + if (CORBA::is_nil (this->manager_.in ())) { - ACE_ERROR ((LM_ERROR, - "CIAO.NodeDaemon (%P|%t) -- ", - "preparePlan: NodeApplicationManager ref", - "is nil\n")); + ACE_DEBUG ((LM_DEBUG, + "NodeDaemon_Impl:preparePlan: " + "NodeApplicationManager ref is nil\n")); ACE_TRY_THROW (Deployment::StartError ()); } } @@ -152,8 +159,7 @@ CIAO::NodeDaemon_Impl::preparePlan (const Deployment::DeploymentPlan &plan void CIAO::NodeDaemon_Impl::destroyManager (Deployment::NodeApplicationManager_ptr ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Deployment::StopError)) + ACE_THROW_SPEC ((CORBA::SystemException, Deployment::StopError)) { ACE_TRY { @@ -163,12 +169,10 @@ CIAO::NodeDaemon_Impl::destroyManager (Deployment::NodeApplicationManager_ptr ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - this->poa_->deactivate_object (id.in () - ACE_ENV_ARG_PARAMETER); + this->poa_->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - this->manager_ = - Deployment::NodeApplicationManager::_nil (); + this->manager_ = Deployment::NodeApplicationManager::_nil (); } ACE_CATCHANY { diff --git a/TAO/CIAO/DAnCE/NodeManager/NodeDaemon_Impl.h b/TAO/CIAO/DAnCE/NodeManager/NodeDaemon_Impl.h index a30fe5a2244..7266604d2f7 100644 --- a/TAO/CIAO/DAnCE/NodeManager/NodeDaemon_Impl.h +++ b/TAO/CIAO/DAnCE/NodeManager/NodeDaemon_Impl.h @@ -1,4 +1,5 @@ // -*- C++ -*- + //============================================================================= /** * @file NodeDaemon_Impl.h @@ -6,11 +7,11 @@ * $Id$ * * This file contains servant implementation for Deployment:NodeManager - * interface. In the current design of the NodeManager, as with the - * legacy implementation of CIAO, Each NodeManager corresponds to - * ONE NodeApplication Manager. Though, the name intuitively suggests - * that there be one NodeManager for every node, our design, allows - * the end-user to have multiple components run on the same node. + * interface. In the current design of the NodeManager, as with the legacy + * implementation of CIAO, Each NodeManager corresponds to ONE NodeApplication + * Manager. Though, the name intuitively suggests that there be one NodeManager + * for every node, our design, allows the end-user to have multiple components + * run on the same node. * * @author Arvind S. Krishna <arvindk@dre.vanderbilt.edu> */ @@ -27,21 +28,13 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#if defined (_MSC_VER) -# if (_MSC_VER >= 1200) -# pragma warning(push) -# endif /* _MSC_VER >= 1200 */ -# pragma warning (disable:4250) -#endif /* _MSC_VER */ - namespace CIAO { /** * @class NodeDaemon_Impl * - * @brief Servant implementation CIAO's daemon process control - * interface + * @brief Servant implementation CIAO's daemon process control interface * * This class implements the CIAO:NodeDaemon interface. * @@ -58,9 +51,10 @@ namespace CIAO PortableServer::POA_ptr p, const char * nodeapp_loc, int spawn_delay) - ACE_THROW_SPEC ((CORBA::SystemException)); + ACE_THROW_SPEC ((CORBA::SystemException)); - /// POA operation.. + /// Get the containing POA. This operation does *not* + /// increase the reference count of the POA. virtual PortableServer::POA_ptr _default_POA (void); /// CIAO::Daemon defined attributes/operations. @@ -94,11 +88,12 @@ namespace CIAO Deployment::StopError)); protected: - /// Since this class is reference counted, making this - /// destructor protected to enforce proper memory managment - /// through the reference counting mechanism (i.e. to - /// disallow calling operator delete() on an instance of - /// this class. + // Since this class is reference counted, making this + // destructor protected to enforce proper memory managment + // through the reference counting mechanism (i.e. to + // disallow calling operator delete() on an instance of + // this class. + /// Destructor virtual ~NodeDaemon_Impl (void); // Keep a pointer to the managing ORB serving this servant. @@ -121,13 +116,9 @@ namespace CIAO // Cache reference of last NodeAppManager Deployment::NodeApplicationManager_var manager_; + }; } - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -#pragma warning(pop) -#endif /* _MSC_VER */ - #if defined (__ACE_INLINE__) # include "NodeDaemon_Impl.inl" #endif /* __ACE_INLINE__ */ diff --git a/TAO/CIAO/DAnCE/NodeManager/Node_Daemon.cpp b/TAO/CIAO/DAnCE/NodeManager/Node_Daemon.cpp index 11dd2165059..f29c5d50922 100644 --- a/TAO/CIAO/DAnCE/NodeManager/Node_Daemon.cpp +++ b/TAO/CIAO/DAnCE/NodeManager/Node_Daemon.cpp @@ -1,14 +1,35 @@ // $Id$ +//============================================================== +/** + * @file Node_Daemon.cpp + * + * @brief CIAO's Node Daemon implementation + * + * NodeDaemon is the bootstraping mechanism to create new + * NodeApplication on the localhost. We currently depend on + * starting the NodeApplicationManager process on some port of all + * the hosts that have NodeApplication install to function properly. + * The port to run this daemon can be set by using the TAO ORB options + * command of -ORBEndpoint <port>. This replaces the earlier CIAO_Daemon + * implementation of CIAO as defined in the CCM specification. + * + * @author Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + * @author Tao Lu <lu@dre.vanderbilt.edu> + */ +//=============================================================== + #include "NodeDaemon_Impl.h" -#include "orbsvcs/CosNamingC.h" #include "tao/IORTable/IORTable.h" + +// Include Name Service header +#include "orbsvcs/orbsvcs/CosNamingC.h" + #include "ace/SString.h" #include "ace/Read_Buffer.h" #include "ace/Get_Opt.h" #include "ace/OS_NS_stdio.h" #include "ace/OS_NS_unistd.h" -#include "ace/os_include/os_netdb.h" #include "ciao/Server_init.h" #include "ciao/CIAO_common.h" @@ -90,17 +111,14 @@ write_IOR(const char* ior) return 0; } -bool +int register_with_ns (const char * name_context, CORBA::ORB_ptr orb, - CIAO::NodeDaemon_ptr obj - ACE_ENV_ARG_DECL) + CIAO::NodeDaemon_ptr obj) { // Naming Service related operations CORBA::Object_var naming_context_object = - orb->resolve_initial_references ("NameService" - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (false); + orb->resolve_initial_references ("NameService"); CosNaming::NamingContext_var naming_context = CosNaming::NamingContext::_narrow (naming_context_object.in ()); @@ -108,12 +126,13 @@ register_with_ns (const char * name_context, // Initialize the Naming Sequence CosNaming::Name name (1); name.length (1); - name[0].id = name_context; + // Register the name with the NS + name[0].id = CORBA::string_dup (name_context); // Register the servant with the Naming Service naming_context->bind (name, obj); - return true; + return 0; } int @@ -122,7 +141,6 @@ main (int argc, char *argv[]) ACE_TRY_NEW_ENV { // Initialize orb - // @@TODO: Add error checking. There is absoluteley none. CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, "" @@ -177,39 +195,30 @@ main (int argc, char *argv[]) spawn_delay), -1); PortableServer::ServantBase_var safe_daemon (daemon_servant); - // Implicit activation - CIAO::NodeDaemon_var daemon = - daemon_servant->_this (); - CORBA::String_var str = - orb->object_to_string (daemon.in () - ACE_ENV_ARG_PARAMETER); + CIAO::NodeDaemon_var daemon = daemon_servant->_this (); + + CORBA::String_var str = orb->object_to_string (daemon.in () + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - adapter->bind ("NodeManager", - str.in () - ACE_ENV_ARG_PARAMETER); + adapter->bind ("NodeManager", str.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (write_to_ior_) write_IOR (str.in ()); else if (register_with_ns_) { - char name [MAXHOSTNAMELEN + 1]; + char name [100]; if (ACE_OS::hostname (name, 100) == -1) { - ACE_ERROR ((LM_ERROR, - "gethostname call failed! \n")); + ACE_DEBUG ((LM_DEBUG, "gethostname call failed! \n")); exit (1); } // Register this name with the Naming Service - (void) register_with_ns (name, - orb.in (), - daemon.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + register_with_ns (name, orb.in (), daemon.in ()); } ACE_DEBUG ((LM_INFO, "CIAO_NodeDaemon IOR: %s\n", str.in ())); diff --git a/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.cpp b/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.cpp index fa5b840ef43..60055845cad 100644 --- a/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.cpp +++ b/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.cpp @@ -4,7 +4,6 @@ #include "RepositoryManager_Impl.h" #include "Repository_Manager_conf.h" #include "Config_Handlers/TPD_Handler.h" -#include "Config_Handlers/DnC_Dump.h" CIAO::RepositoryManager_Impl::RepositoryManager_Impl (CORBA::ORB_ptr orb, @@ -80,9 +79,7 @@ installPackage (const char* installation_name, DOMNodeFilter::SHOW_TEXT); Deployment::PackageConfiguration pc; pc_handler.process_PackageConfiguration (pc); - //Deployment::DnC_Dump::dump (pc); - this->pc_table_.bind (installation_name, (pc)); - //Deployment::DnC_Dump::dump (*(&pc)); + this->pc_table_.bind (installation_name, &(pc)); } catch (CORBA::Exception& ex) { @@ -133,18 +130,11 @@ CIAO::RepositoryManager_Impl::findPackageByName (const char* name ACE_THROW_SPEC ((CORBA::SystemException, Deployment::NoSuchName)) { - Deployment::PackageConfiguration pc; + Deployment::PackageConfiguration* pc = 0; if (pc_table_.find (name, pc) == 0) { - //Deployment::PackageConfiguration* dup_pc = pc; - //Deployment::DnC_Dump::dump (*pc); - //return dup_pc; - Deployment::PackageConfiguration_var pc_var = 0; - ACE_NEW_THROW_EX (pc_var, - Deployment::PackageConfiguration (pc), - CORBA::NO_MEMORY ()); - //Deployment::DnC_Dump::dump (*pc_var); - return pc_var._retn (); + Deployment::PackageConfiguration* dup_pc = pc; + return dup_pc; } else { diff --git a/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.h b/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.h index afe7dd36542..2ad95826023 100644 --- a/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.h +++ b/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.h @@ -144,7 +144,7 @@ namespace CIAO // destructor typedef ACE_Hash_Map_Manager_Ex<const char *, - Deployment::PackageConfiguration, + Deployment::PackageConfiguration*, ACE_Hash<const char *>, ACE_Equal_To<const char *>, TAO_SYNCH_MUTEX> pc_table; @@ -157,7 +157,7 @@ namespace CIAO pc_table pc_table_; }; -} +}; #include /**/ "ace/post.h" #endif /* REPOSITORYMANAGER_IMPL_H */ diff --git a/TAO/CIAO/DAnCE/RepositoryManager/Repository_Manager.cpp b/TAO/CIAO/DAnCE/RepositoryManager/Repository_Manager.cpp index 4605a1ea41b..312d01d0bfd 100644 --- a/TAO/CIAO/DAnCE/RepositoryManager/Repository_Manager.cpp +++ b/TAO/CIAO/DAnCE/RepositoryManager/Repository_Manager.cpp @@ -3,7 +3,6 @@ #include "RepositoryManager_Impl.h" #include "Update_Plan.h" #include "ExecutionManager/ExecutionManagerC.h" -#include "Config_Handlers/DnC_Dump.h" #include "NodeManager/NodeDaemonC.h" #include "ace/OS_NS_stdio.h" #include "ace/streams.h" @@ -68,10 +67,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) // Initialize the ORB so that CORBA::Any will work // - CORBA::ORB_var orb = - CORBA::ORB_init (argc, - argv, - ""); + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, ""); try { @@ -106,9 +102,9 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) return 1; } - //DOMDocument* tpd_doc = tpd_parser->parseURI (package_url); + DOMDocument* tpd_doc = tpd_parser->parseURI (package_url); - //ACE_UNUSED_ARG (tpd_doc); + ACE_UNUSED_ARG (tpd_doc); if (tpd_handler.getErrors()) { @@ -119,7 +115,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) { ACE_DEBUG ((LM_DEBUG, "Null DOM Document obtained, \ May be the URL is wrong!!\n")); - throw CIAO::Null_Dom_Document (); + throw Null_Dom_Document (); } // free up DOMBuilder. DOMBuilder also deletes the DOMDocument memory. @@ -143,14 +139,13 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) rep_impl->installPackage ("PC", package_url); pc = rep_impl->findPackageByName ("PC"); - //Deployment::DnC_Dump::dump (*pc); - CIAO::REF_MAP ref_map; - CIAO::REF_MAP primary_ref_map; + REF_MAP ref_map; + REF_MAP primary_ref_map; // traverse the PackageConfiguration IDL data structure and // update the deployment plan IDL data structure. - CIAO::traverse_package (pc, plan, ref_map, primary_ref_map); + traverse_package (pc, plan, ref_map, primary_ref_map); //Deployment::DnC_Dump::dump (plan); @@ -259,7 +254,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) catch (CORBA::Exception& ex) { ACE_PRINT_EXCEPTION (ex, "Caught CORBA Exception: "); - while (true); + while (true); return -1; } catch (const DOMException& e) @@ -278,13 +273,13 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) } //ACE_PRINT_EXCEPTION ("Caught DOM Exception: "); ACE_ERROR ((LM_ERROR, "Caught DOM exception\n")); - while (true); + while (true); return -1; } catch (...) { ACE_ERROR ((LM_ERROR, "Caught unknown exception\n")); - while (true); + while (true); return -1; } diff --git a/TAO/CIAO/DAnCE/RepositoryManager/Update_Plan.cpp b/TAO/CIAO/DAnCE/RepositoryManager/Update_Plan.cpp index f8f16019b95..76f4fa242ca 100644 --- a/TAO/CIAO/DAnCE/RepositoryManager/Update_Plan.cpp +++ b/TAO/CIAO/DAnCE/RepositoryManager/Update_Plan.cpp @@ -7,77 +7,54 @@ #include "ace/OS_NS_stdio.h" #include "ace/streams.h" -ACE_RCSID (DAnCE, - RepositoryManager, - "$Id$") - -using namespace Deployment; - -namespace CIAO +void traverse_package (Deployment::PackageConfiguration* &pc, + Deployment::DeploymentPlan &plan, + REF_MAP &ref_map, REF_MAP &primary_ref_map) { - void - traverse_package (PackageConfiguration* &pc, - DeploymentPlan &plan, - REF_MAP &ref_map, - REF_MAP &primary_ref_map) - { - // traverse the package configuration structure to get to the - // BasePackage which consists of assemblies. - // - CORBA::ULong bp_len = - pc->basePackage.length (); - - for (CORBA::ULong x = 0; x != bp_len; ++x) - { - CORBA::ULong impl_len = - pc->basePackage[x].implementation.length (); - - for (CORBA::ULong y = 0; - y != impl_len; - ++y) - { - // traverse the .cpd file and get to the referenced .cid file - // - ComponentImplementationDescription cid = - pc->basePackage[x].implementation[y].referencedImplementation; - CORBA::ULong assembly_len = cid.assemblyImpl.length (); - - for (CORBA::ULong z = 0; - z != assembly_len; - ++z) - { - // traverse the .cid file and get to each - // of the "assemblyImpl" tags. - // - ComponentAssemblyDescription assembly = - cid.assemblyImpl[z]; - // - // traverse the individual assembly. - // - traverse_assembly (assembly, plan, ref_map, primary_ref_map); - } - } - } - } - - void - traverse_assembly (ComponentAssemblyDescription &assembly, - DeploymentPlan &plan, - REF_MAP &ref_map, REF_MAP &primary_ref_map) - { - // traverse the assembly (ComponentAssemblyDescription) and - // processes the instances and the connection within the assembly. - // - CORBA::ULong ins_len = assembly.instance.length (); - for (CORBA::ULong k = 0; k < ins_len; ++k) - { - SubcomponentInstantiationDescription ins = - assembly.instance[k]; - const char* in_name = ins.name; - - CORBA::ULong plan_ins_len = - plan.instance.length (); + // traverse the package configuration structure to get to the + // BasePackage which consists of assemblies. + // + CORBA::ULong bp_len = pc->basePackage.length (); + for (CORBA::ULong x = 0; x < bp_len; ++x) + { + CORBA::ULong impl_len = pc->basePackage[x].implementation.length (); + for (CORBA::ULong y = 0; y < impl_len; ++y) + { + // traverse the .cpd file and get to the referenced .cid file + // + Deployment::ComponentImplementationDescription cid = + pc->basePackage[x].implementation[y].referencedImplementation; + CORBA::ULong assembly_len = cid.assemblyImpl.length (); + for (CORBA::ULong z = 0; z < assembly_len; ++z) + { + // traverse the .cid file and get to each + // of the "assemblyImpl" tags. + // + Deployment::ComponentAssemblyDescription assembly = + cid.assemblyImpl[z]; + // + // traverse the individual assembly. + // + traverse_assembly (assembly, plan, ref_map, primary_ref_map); + } + } + } +} +void traverse_assembly (Deployment::ComponentAssemblyDescription &assembly, + Deployment::DeploymentPlan &plan, + REF_MAP &ref_map, REF_MAP &primary_ref_map) +{ + // traverse the assembly (ComponentAssemblyDescription) and + // processes the instances and the connection within the assembly. + // + CORBA::ULong ins_len = assembly.instance.length (); + for (CORBA::ULong k = 0; k < ins_len; ++k) + { + Deployment::SubcomponentInstantiationDescription ins = + assembly.instance[k]; + const char* in_name = ins.name; + CORBA::ULong plan_ins_len = plan.instance.length (); for (CORBA::ULong l = 0; l < plan_ins_len; ++l) { const char* plan_name = plan.instance[l].name; @@ -87,47 +64,43 @@ namespace CIAO ref_map, primary_ref_map); } } - } - - CORBA::ULong assembly_conn_len = - assembly.connection.length (); - - for (CORBA::ULong m = 0; m < assembly_conn_len; ++m) - { - AssemblyConnectionDescription - assembly_connection = assembly.connection[m]; - traverse_assembly_connection (assembly, - assembly_connection, - plan); - } - } + } + CORBA::ULong assembly_conn_len = assembly.connection.length (); + for (CORBA::ULong m = 0; m < assembly_conn_len; ++m) + { + Deployment::AssemblyConnectionDescription + assembly_connection = assembly.connection[m]; + traverse_assembly_connection (assembly, + assembly_connection, + plan); + } +} - void - traverse_assembly_connection (ComponentAssemblyDescription - &assembly, - AssemblyConnectionDescription - &assembly_connection, - DeploymentPlan &plan) - { - // traverse the assembly connection and get information about the - // portName and the instances at each end of the connection. - // Also traverse the InterfaceDescriptions for each of those instances - // and populate the portKind information. - // - CORBA::ULong con_length (plan.connection.length ()); - plan.connection.length (con_length + 1); - CORBA::ULong iepe_len = assembly_connection.internalEndpoint.length (); - for (CORBA::ULong n = 0; n < iepe_len; ++n) - { - CORBA::ULong iep_len (plan.connection[con_length]. - internalEndpoint.length ()); +void traverse_assembly_connection (Deployment::ComponentAssemblyDescription + &assembly, + Deployment::AssemblyConnectionDescription + &assembly_connection, + Deployment::DeploymentPlan &plan) +{ + // traverse the assembly connection and get information about the + // portName and the instances at each end of the connection. + // Also traverse the InterfaceDescriptions for each of those instances + // and populate the portKind information. + // + CORBA::ULong con_length (plan.connection.length ()); + plan.connection.length (con_length + 1); + CORBA::ULong iepe_len = assembly_connection.internalEndpoint.length (); + for (CORBA::ULong n = 0; n < iepe_len; ++n) + { + CORBA::ULong iep_len (plan.connection[con_length]. + internalEndpoint.length ()); plan.connection[con_length].internalEndpoint - .length (iep_len + 1); + .length (iep_len + 1); plan.connection[con_length].internalEndpoint - [iep_len].portName = assembly_connection. - internalEndpoint[n].portName; + [iep_len].portName = assembly_connection. + internalEndpoint[n].portName; CORBA::ULong ins_ref = assembly_connection.internalEndpoint[n]. - instanceRef; + instanceRef; const char* ins_name = assembly.instance[ins_ref].name; CORBA::ULong plan_ins_len = plan.instance.length (); for (CORBA::ULong w = 0; w < plan_ins_len; ++w) @@ -143,243 +116,233 @@ namespace CIAO traverse_interface (assembly.instance[ins_ref], plan.connection[con_length]. internalEndpoint[iep_len]); - } - } - - void - traverse_interface (SubcomponentInstantiationDescription - &instance, - PlanSubcomponentPortEndpoint - &pspe) - { - // traverse the InterfaceDescription of the instance and get information - // about the portkind of the port. - // - CORBA::ULong pack_len = instance.package.length (); - for (CORBA::ULong m = 0; m < pack_len; ++m) - { - ComponentPackageDescription - package = instance.package[m]; - - ComponentInterfaceDescription - cid = package.realizes; - - CORBA::ULong port_len = cid.port.length (); - - for (CORBA::ULong n = 0; n < port_len; ++n) - { - const char* main_port_name = cid.port[n].name; - const char* port_name = pspe.portName; - if (strcmp (main_port_name, port_name) == 0) - { - pspe.kind = cid.port[n].kind; - } - } - } - } + } +} - void - traverse_assembly_instance ( - SubcomponentInstantiationDescription - &instance, - DeploymentPlan &plan, int l, - REF_MAP &ref_map, REF_MAP &primary_ref_map) - { - // Each instance has a package. - // Each package has an implementation and their correspoding artifacts. - // Traverse this information and populate the artifact and the - // implementation information within the DeploymentPlan. - // - ART_REF_MAP art_ref_map; +void traverse_interface (Deployment::SubcomponentInstantiationDescription + &instance, + Deployment::PlanSubcomponentPortEndpoint + &pspe) +{ + // traverse the InterfaceDescription of the instance and get information + // about the portkind of the port. + // + CORBA::ULong pack_len = instance.package.length (); + for (CORBA::ULong m = 0; m < pack_len; ++m) + { + Deployment::ComponentPackageDescription + package = instance.package[m]; - CORBA::ULong pack_len = instance.package.length (); + Deployment::ComponentInterfaceDescription + cid = package.realizes; - for (CORBA::ULong m = 0; m < pack_len; ++m) - { - ComponentPackageDescription - package = instance.package[m]; - CORBA::ULong pack_impl_len = package.implementation.length (); + CORBA::ULong port_len = cid.port.length (); - for (CORBA::ULong n = 0; n < pack_impl_len; ++n) - { - PackagedComponentImplementation - impl = package.implementation[n]; - CORBA::ULong impl_length (plan.implementation.length ()); - plan.implementation.length (impl_length + 1); - plan.implementation[impl_length].name = plan.instance[l].name; - plan.instance[l].implementationRef = impl_length; - CORBA::ULong mono_impl_len = - impl.referencedImplementation.monolithicImpl.length (); + for (CORBA::ULong n = 0; n < port_len; ++n) + { + const char* main_port_name = cid.port[n].name; + const char* port_name = pspe.portName; + if (strcmp (main_port_name, port_name) == 0) + { + pspe.kind = cid.port[n].kind; + } + } + } +} - for (CORBA::ULong p = 0; p < mono_impl_len; ++p) - { - MonolithicImplementationDescription - mid = impl.referencedImplementation.monolithicImpl[p]; +void traverse_assembly_instance (Deployment:: + SubcomponentInstantiationDescription + &instance, + Deployment::DeploymentPlan &plan, int l, + REF_MAP &ref_map, REF_MAP &primary_ref_map) +{ + // Each instance has a package. + // Each package has an implementation and their correspoding artifacts. + // Traverse this information and populate the artifact and the + // implementation information within the DeploymentPlan. + // + ART_REF_MAP art_ref_map; + + CORBA::ULong pack_len = instance.package.length (); + + for (CORBA::ULong m = 0; m < pack_len; ++m) + { + Deployment::ComponentPackageDescription + package = instance.package[m]; + CORBA::ULong pack_impl_len = package.implementation.length (); + + for (CORBA::ULong n = 0; n < pack_impl_len; ++n) + { + Deployment::PackagedComponentImplementation + impl = package.implementation[n]; + CORBA::ULong impl_length (plan.implementation.length ()); + plan.implementation.length (impl_length + 1); + plan.implementation[impl_length].name = plan.instance[l].name; + plan.instance[l].implementationRef = impl_length; + CORBA::ULong mono_impl_len = + impl.referencedImplementation.monolithicImpl.length (); + + for (CORBA::ULong p = 0; p < mono_impl_len; ++p) + { + Deployment::MonolithicImplementationDescription + mid = impl.referencedImplementation.monolithicImpl[p]; - update_artifacts (mid, plan, plan.instance[l], + update_artifacts (mid, plan, plan.instance[l], ref_map, primary_ref_map, art_ref_map, - plan.implementation[impl_length]); - } - update_impl_config_property (impl, plan.implementation[impl_length], - plan.instance[l]); - } - } - } - - void - update_artifacts (MonolithicImplementationDescription &mid, - DeploymentPlan &plan, - InstanceDeploymentDescription &instance, - REF_MAP &ref_map, REF_MAP &primary_ref_map, - ART_REF_MAP &art_ref_map, - MonolithicDeploymentDescription &mdd) - { - CORBA::ULong prim_art_len = mid.primaryArtifact.length (); - for (CORBA::ULong q = 0; q < prim_art_len; ++q) - { - ImplementationArtifactDescription - pack_iad = mid.primaryArtifact[q].referencedArtifact; - ACE_TString artifact_name = (const char*)mid.primaryArtifact[q].name; - int arti_len; - CORBA::ULong art_length (plan.artifact.length ()); + plan.implementation[impl_length]); + } + update_impl_config_property (impl, plan.implementation[impl_length], + plan.instance[l]); + } + } +} - if (ref_map.find (artifact_name, arti_len) != 0) - { - plan.artifact.length (art_length + 1); - plan.artifact[art_length].name = mid.primaryArtifact[q].name; - plan.artifact[art_length].node = instance.node; - ref_map.bind (artifact_name, art_length); - primary_ref_map.bind (artifact_name, art_length); - CORBA::ULong art_ref_len (mdd.artifactRef.length ()); - mdd.artifactRef.length (art_ref_len + 1); - mdd.artifactRef[art_ref_len] = art_length; - update_artifact_location (pack_iad, +void update_artifacts (Deployment::MonolithicImplementationDescription &mid, + Deployment::DeploymentPlan &plan, + Deployment::InstanceDeploymentDescription &instance, + REF_MAP &ref_map, REF_MAP &primary_ref_map, + ART_REF_MAP &art_ref_map, + Deployment::MonolithicDeploymentDescription &mdd) +{ + CORBA::ULong prim_art_len = mid.primaryArtifact.length (); + for (CORBA::ULong q = 0; q < prim_art_len; ++q) + { + Deployment::ImplementationArtifactDescription + pack_iad = mid.primaryArtifact[q].referencedArtifact; + ACE_TString artifact_name = (const char*)mid.primaryArtifact[q].name; + int arti_len; + CORBA::ULong art_length (plan.artifact.length ()); + + if (ref_map.find (artifact_name, arti_len) != 0) + { + plan.artifact.length (art_length + 1); + plan.artifact[art_length].name = mid.primaryArtifact[q].name; + plan.artifact[art_length].node = instance.node; + ref_map.bind (artifact_name, art_length); + primary_ref_map.bind (artifact_name, art_length); + CORBA::ULong art_ref_len (mdd.artifactRef.length ()); + mdd.artifactRef.length (art_ref_len + 1); + mdd.artifactRef[art_ref_len] = art_length; + update_artifact_location (pack_iad, + plan.artifact[art_length]); + update_artifact_property (pack_iad, plan.artifact[art_length]); - update_artifact_property (pack_iad, - plan.artifact[art_length]); - } - update_common_artifact_and_art_ref (pack_iad, - primary_ref_map, ref_map, + } + update_common_artifact_and_art_ref (pack_iad, + primary_ref_map, ref_map, art_ref_map, mdd, - plan, instance); - } - } - - void - update_common_artifact_and_art_ref ( - ImplementationArtifactDescription - &pack_iad, - REF_MAP &primary_ref_map, - REF_MAP &ref_map, - ART_REF_MAP &art_ref_map, - - MonolithicDeploymentDescription &mid, - DeploymentPlan &plan, + plan, instance); + } +} +void update_common_artifact_and_art_ref (Deployment:: + ImplementationArtifactDescription + &pack_iad, + REF_MAP &primary_ref_map, + REF_MAP &ref_map, + ART_REF_MAP &art_ref_map, + Deployment:: + MonolithicDeploymentDescription &mid, + Deployment::DeploymentPlan &plan, + Deployment:: InstanceDeploymentDescription &instance) - { - CORBA::ULong deps_len = pack_iad.dependsOn.length (); - for (CORBA::ULong g = 0; g < deps_len; ++g) - { - ACE_TString dep_name = - (const char*)pack_iad.dependsOn[g].name; - int arti_len; - - if (ref_map.find (dep_name, arti_len) == 0) - { - if (primary_ref_map.find (dep_name, arti_len) != 0) - { - if (art_ref_map.find (arti_len, arti_len) != 0) - { - update_impl_art_ref (mid, arti_len); - art_ref_map.bind (arti_len, arti_len); - } - } - } - else - { - ImplementationArtifactDescription - depends_iad = pack_iad.dependsOn[g]. - referencedArtifact; - CORBA::ULong new_art_length (plan.artifact.length ()); - plan.artifact.length (new_art_length + 1); - plan.artifact[new_art_length].name = - pack_iad.dependsOn[g].name; - plan.artifact[new_art_length].node = instance.node; - update_artifact_location (depends_iad, - plan.artifact - [new_art_length]); - ref_map.bind ( - (const char*)plan.artifact[new_art_length].name, - new_art_length); - update_impl_art_ref (mid, new_art_length); - art_ref_map.bind (new_art_length, new_art_length); - } - } - } - - void - update_impl_config_property (PackagedComponentImplementation - &impl, - MonolithicDeploymentDescription - &mid, +{ + CORBA::ULong deps_len = pack_iad.dependsOn.length (); + for (CORBA::ULong g = 0; g < deps_len; ++g) + { + ACE_TString dep_name = + (const char*)pack_iad.dependsOn[g].name; + int arti_len; + + if (ref_map.find (dep_name, arti_len) == 0) + { + if (primary_ref_map.find (dep_name, arti_len) != 0) + { + if (art_ref_map.find (arti_len, arti_len) != 0) + { + update_impl_art_ref (mid, arti_len); + art_ref_map.bind (arti_len, arti_len); + } + } + } + else + { + Deployment::ImplementationArtifactDescription + depends_iad = pack_iad.dependsOn[g]. + referencedArtifact; + CORBA::ULong new_art_length (plan.artifact.length ()); + plan.artifact.length (new_art_length + 1); + plan.artifact[new_art_length].name = + pack_iad.dependsOn[g].name; + plan.artifact[new_art_length].node = instance.node; + update_artifact_location (depends_iad, + plan.artifact + [new_art_length]); + ref_map.bind ( + (const char*)plan.artifact[new_art_length].name, + new_art_length); + update_impl_art_ref (mid, new_art_length); + art_ref_map.bind (new_art_length, new_art_length); + } + } +} +void update_impl_config_property (Deployment::PackagedComponentImplementation + &impl, + Deployment::MonolithicDeploymentDescription + &mid, + Deployment:: InstanceDeploymentDescription - &instance) - { - CORBA::ULong pro_len = + &instance) +{ + CORBA::ULong pro_len = impl.referencedImplementation.configProperty.length (); + for (CORBA::ULong x = 0; x < pro_len; ++x) + { + CORBA::ULong impl_pro_len (mid.execParameter.length ()); + mid.execParameter.length (impl_pro_len + 1); + mid.execParameter[impl_pro_len] + = impl.referencedImplementation.configProperty[x]; + CORBA::ULong ins_pro_len (instance.configProperty. length ()); + instance.configProperty.length (ins_pro_len + 1); + instance.configProperty[ins_pro_len] + = impl.referencedImplementation.configProperty[x]; + } +} - for (CORBA::ULong x = 0; x < pro_len; ++x) - { - CORBA::ULong impl_pro_len (mid.execParameter.length ()); - mid.execParameter.length (impl_pro_len + 1); - mid.execParameter[impl_pro_len] - = impl.referencedImplementation.configProperty[x]; - CORBA::ULong ins_pro_len (instance.configProperty. length ()); - instance.configProperty.length (ins_pro_len + 1); - instance.configProperty[ins_pro_len] - = impl.referencedImplementation.configProperty[x]; - } - } - - void - update_impl_art_ref (MonolithicDeploymentDescription &mid, - int arti_len) - { - CORBA::ULong new_art_ref_len (mid.artifactRef.length ()); - mid.artifactRef.length (new_art_ref_len + 1); - mid.artifactRef[new_art_ref_len] = arti_len; - } +void update_impl_art_ref (Deployment::MonolithicDeploymentDescription + &mid, int arti_len) +{ + CORBA::ULong new_art_ref_len (mid.artifactRef.length ()); + mid.artifactRef.length (new_art_ref_len + 1); + mid.artifactRef[new_art_ref_len] = arti_len; +} - void - update_artifact_location (ImplementationArtifactDescription - &pack_iad, - ArtifactDeploymentDescription - &plan_artifact) - { - CORBA::ULong loc_len = pack_iad.location.length (); - for (CORBA::ULong e = 0; e < loc_len; ++e) - { - CORBA::ULong art_loc_len (plan_artifact.location.length ()); - plan_artifact.location.length (art_loc_len + 1); - plan_artifact.location[art_loc_len] = pack_iad.location[e]; - } - } +void update_artifact_location (Deployment::ImplementationArtifactDescription + &pack_iad, + Deployment::ArtifactDeploymentDescription + &plan_artifact) +{ + CORBA::ULong loc_len = pack_iad.location.length (); + for (CORBA::ULong e = 0; e < loc_len; ++e) + { + CORBA::ULong art_loc_len (plan_artifact.location.length ()); + plan_artifact.location.length (art_loc_len + 1); + plan_artifact.location[art_loc_len] = pack_iad.location[e]; + } +} - void - update_artifact_property (ImplementationArtifactDescription - &pack_iad, - ArtifactDeploymentDescription - &plan_artifact) - { - CORBA::ULong para_len = pack_iad.execParameter.length (); - for (CORBA::ULong f = 0; f < para_len; ++f) - { - CORBA::ULong art_pro_len (plan_artifact.execParameter.length ()); - plan_artifact.execParameter.length (art_pro_len + 1); - plan_artifact.execParameter[art_pro_len] = pack_iad.execParameter[f]; - } - } +void update_artifact_property (Deployment::ImplementationArtifactDescription + &pack_iad, + Deployment::ArtifactDeploymentDescription + &plan_artifact) +{ + CORBA::ULong para_len = pack_iad.execParameter.length (); + for (CORBA::ULong f = 0; f < para_len; ++f) + { + CORBA::ULong art_pro_len (plan_artifact.execParameter.length ()); + plan_artifact.execParameter.length (art_pro_len + 1); + plan_artifact.execParameter[art_pro_len] = pack_iad.execParameter[f]; + } } diff --git a/TAO/CIAO/DAnCE/RepositoryManager/Update_Plan.h b/TAO/CIAO/DAnCE/RepositoryManager/Update_Plan.h index 3a67955bd2f..018a090cb94 100644 --- a/TAO/CIAO/DAnCE/RepositoryManager/Update_Plan.h +++ b/TAO/CIAO/DAnCE/RepositoryManager/Update_Plan.h @@ -12,101 +12,86 @@ * *======================================================================*/ -#ifndef CIAO_REPOSITORY_MANAGER_UPDATE_PLAN_H -#define CIAO_REPOSITORY_MANAGER_UPDATE_PLAN_H -#include /**/ "ace/pre.h" +#ifndef UPDATE_PLAN_H +#define UPDATE_PLAN_H +#include "DeploymentC.h" #include "ace/Hash_Map_Manager.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ - -namespace Deployment -{ - struct SubcomponentInstantiationDescription; - struct DeploymentPlan; - struct ComponentAssemblyDescription; - struct SubcomponentInstantiationDescription; - struct AssemblyConnectionDescription; -} - -namespace CIAO -{ - class Null_Dom_Document { }; - // exception thrown when we have a null dom document. - - typedef ACE_Hash_Map_Manager<ACE_TString, int, ACE_Null_Mutex> REF_MAP; - typedef ACE_Hash_Map_Manager<int, int, ACE_Null_Mutex> ART_REF_MAP; - - void - traverse_assembly_instance (Deployment:: - SubcomponentInstantiationDescription &instance, - Deployment::DeploymentPlan &plan, - int l, - REF_MAP &ref_map, - REF_MAP &primary_ref_map); - - void traverse_assembly (Deployment::ComponentAssemblyDescription &assembly, - Deployment::DeploymentPlan &plan, - REF_MAP &ref_map, REF_MAP &primary_ref_map); - - void traverse_interface (Deployment::SubcomponentInstantiationDescription - &instance, - Deployment::PlanSubcomponentPortEndpoint - &pspe); - - void traverse_assembly_connection (Deployment::ComponentAssemblyDescription - &assembly, - Deployment::AssemblyConnectionDescription - &assembly_connection, - Deployment::DeploymentPlan &plan); - - void traverse_package (Deployment::PackageConfiguration* &pc, - Deployment::DeploymentPlan &plan, - REF_MAP &ref_map, REF_MAP &primary_ref_map); - - void update_artifacts (Deployment::MonolithicImplementationDescription &mid, - Deployment::DeploymentPlan &plan, - Deployment::InstanceDeploymentDescription &instance, - REF_MAP &ref_map, REF_MAP &primary_ref_map, - ART_REF_MAP &art_ref_map, - Deployment::MonolithicDeploymentDescription &mdd); - - void update_artifact_location (Deployment::ImplementationArtifactDescription - &pack_iad, - Deployment::ArtifactDeploymentDescription - &plan_artifact); - - void update_artifact_property (Deployment::ImplementationArtifactDescription - &pack_iad, - Deployment::ArtifactDeploymentDescription - &plan_artifact); - - void update_impl_art_ref (Deployment::MonolithicDeploymentDescription - &mid, int art_len); - - void update_impl_config_property (Deployment:: - PackagedComponentImplementation &impl, - Deployment:: - MonolithicDeploymentDescription &mid, - Deployment:: - InstanceDeploymentDescription - &instance); - - void update_common_artifact_and_art_ref (Deployment:: - ImplementationArtifactDescription &pack_iad, - REF_MAP &primary_ref_map, - REF_MAP &ref_map, - ART_REF_MAP &art_ref_map, - Deployment::MonolithicDeploymentDescription - &mid, - Deployment::DeploymentPlan &plan, - Deployment:: - InstanceDeploymentDescription - &instance); -} +class Null_Dom_Document { }; +// exception thrown when we have a null dom document. + +typedef ACE_Hash_Map_Manager<ACE_TString, int, ACE_Null_Mutex> REF_MAP; +typedef ACE_Hash_Map_Manager<int, int, ACE_Null_Mutex> ART_REF_MAP; + +void traverse_assembly_instance (Deployment:: + SubcomponentInstantiationDescription + &instance, + Deployment::DeploymentPlan &plan, int l, + REF_MAP &ref_map, REF_MAP &primary_ref_map); + +void traverse_assembly (Deployment::ComponentAssemblyDescription &assembly, + Deployment::DeploymentPlan &plan, + REF_MAP &ref_map, REF_MAP &primary_ref_map); + +void traverse_interface (Deployment::SubcomponentInstantiationDescription + &instance, + Deployment::PlanSubcomponentPortEndpoint + &pspe); + +void traverse_assembly_connection (Deployment::ComponentAssemblyDescription + &assembly, + Deployment::AssemblyConnectionDescription + &assembly_connection, + Deployment::DeploymentPlan &plan); + +void traverse_package (Deployment::PackageConfiguration* &pc, + Deployment::DeploymentPlan &plan, + REF_MAP &ref_map, REF_MAP &primary_ref_map); + +void update_artifacts (Deployment::MonolithicImplementationDescription &mid, + Deployment::DeploymentPlan &plan, + Deployment::InstanceDeploymentDescription &instance, + REF_MAP &ref_map, REF_MAP &primary_ref_map, + ART_REF_MAP &art_ref_map, + Deployment::MonolithicDeploymentDescription &mdd); + +void update_artifact_location (Deployment::ImplementationArtifactDescription + &pack_iad, + Deployment::ArtifactDeploymentDescription + &plan_artifact); + +void update_artifact_property (Deployment::ImplementationArtifactDescription + &pack_iad, + Deployment::ArtifactDeploymentDescription + &plan_artifact); + +void update_impl_art_ref (Deployment::MonolithicDeploymentDescription + &mid, int art_len); + +void update_impl_config_property (Deployment:: + PackagedComponentImplementation &impl, + Deployment:: + MonolithicDeploymentDescription &mid, + Deployment:: + InstanceDeploymentDescription + &instance); + +void update_common_artifact_and_art_ref (Deployment:: + ImplementationArtifactDescription &pack_iad, + REF_MAP &primary_ref_map, + REF_MAP &ref_map, + ART_REF_MAP &art_ref_map, + Deployment::MonolithicDeploymentDescription + &mid, + Deployment::DeploymentPlan &plan, + Deployment:: + InstanceDeploymentDescription + &instance); #include /**/ "ace/post.h" -#endif /* CIAO_REPOSITORY_MANAGER_UPDATE_PLAN_H*/ +#endif /* UPDATE_PLAN_H */ diff --git a/TAO/CIAO/DAnCE/ciao/CCM_Container.idl b/TAO/CIAO/DAnCE/ciao/CCM_Container.idl index 220a09ea261..0b7d23562fc 100644 --- a/TAO/CIAO/DAnCE/ciao/CCM_Container.idl +++ b/TAO/CIAO/DAnCE/ciao/CCM_Container.idl @@ -17,7 +17,7 @@ #define CCM_CONTAINER_IDL #include "CCM_Component.idl" -#include "orbsvcs/SecurityLevel2.idl" +#include "orbsvcs/orbsvcs/SecurityLevel2.idl" #include "CCM_Transaction.idl" // *************** Basic Container interfaces *************** diff --git a/TAO/CIAO/DAnCE/ciao/CCM_Core.mpc b/TAO/CIAO/DAnCE/ciao/CCM_Core.mpc index 8384d770c0a..b8a0c253087 100644 --- a/TAO/CIAO/DAnCE/ciao/CCM_Core.mpc +++ b/TAO/CIAO/DAnCE/ciao/CCM_Core.mpc @@ -31,7 +31,7 @@ project (CIAO_DnC_Client) : taolib_with_idl, valuetype, ifr_client { } } -project (CIAO_DnC_Container) : orbsvcslib, portableserver, security, valuetype, ifr_client { +project (CIAO_DnC_Container) : orbsvcslib, portableserver, security, iorinterceptor, objreftemplate, valuetype, ifr_client { after += CIAO_DnC_Client sharedname = CIAO_DnC_Container libs += CIAO_DnC_Client @@ -62,7 +62,7 @@ project (CIAO_DnC_Container) : orbsvcslib, portableserver, security, valuetype, // Valuetype library must be linked for this project. // Please don't remove. project(Deployment_stub) : taolib_with_idl, valuetype, ifr_client { - sharedname = CIAO_Deployment_stub + sharedname = Deployment_stub after += CIAO_DnC_Client idlflags += -Wb,stub_export_macro=Deployment_stub_Export @@ -91,11 +91,11 @@ project(Deployment_stub) : taolib_with_idl, valuetype, ifr_client { // CIAO_DnC_Client library must be linked for this project. // Please don't remove. -project(Deployment_svnt) : taolib_with_idl, portableserver, valuetype,ifr_client { +project(Deployment_svnt) : taolib_with_idl, portableserver, ifr_client { after += Deployment_stub - sharedname = CIAO_Deployment_svnt + sharedname = Deployment_svnt dynamicflags = DEPLOYMENT_SVNT_BUILD_DLL - libs += CIAO_Deployment_stub CIAO_DnC_Client + libs += Deployment_stub CIAO_DnC_Client idlflags += -Wb,stub_export_macro=Deployment_stub_Export idlflags += -Wb,stub_export_include=Deployment_stub_export.h idlflags += -Wb,skel_export_macro=Deployment_svnt_Export @@ -115,11 +115,10 @@ project(Deployment_svnt) : taolib_with_idl, portableserver, valuetype,ifr_client } -project (CIAO_DnC_Server) : orbsvcslib, portableserver, valuetype, ifr_client, utils, security { +project (CIAO_DnC_Server) : orbsvcslib, portableserver, iorinterceptor, objreftemplate, valuetype, ifr_client, security { after += CIAO_DnC_Container Deployment_svnt - includes += $(CIAO_ROOT)/DAnCE sharedname = CIAO_DnC_Server - libs += CIAO_DnC_Client CIAO_DnC_Container CIAO_Deployment_svnt CIAO_Deployment_stub + libs += CIAO_DnC_Client CIAO_DnC_Container Deployment_svnt Deployment_stub idlflags += -Wb,export_include=CIAO_Server_Export.h -Wb,export_macro=CIAO_SERVER_Export dynamicflags = CIAO_SERVER_BUILD_DLL @@ -130,13 +129,8 @@ project (CIAO_DnC_Server) : orbsvcslib, portableserver, valuetype, ifr_client, u Source_Files { Container_Base.cpp NodeApplication_Impl.cpp - Context_Impl_Base.cpp - Home_Servant_Impl_Base.cpp - Servant_Impl_Base.cpp Server_init.cpp - Servant_Activator.cpp - Port_Activator.cpp - StandardConfigurator_Impl.cpp + Servant_Impl_Base.cpp } Header_Files { @@ -145,10 +139,7 @@ project (CIAO_DnC_Server) : orbsvcslib, portableserver, valuetype, ifr_client, u } Template_Files { - Context_Impl_T.cpp - Home_Servant_Impl_T.cpp Servant_Impl_T.cpp - Servant_Activator_T.cpp } } diff --git a/TAO/CIAO/DAnCE/ciao/ComponentsC.h b/TAO/CIAO/DAnCE/ciao/ComponentsC.h index 4ef065c4e8d..32e5a755e83 100644 --- a/TAO/CIAO/DAnCE/ciao/ComponentsC.h +++ b/TAO/CIAO/DAnCE/ciao/ComponentsC.h @@ -72,7 +72,7 @@ // Traits specializations. namespace TAO { -} +}; // TAO_IDL - Generated from // be/be_visitor_root/cdr_op.cpp:48 diff --git a/TAO/CIAO/DAnCE/ciao/Container_Base.cpp b/TAO/CIAO/DAnCE/ciao/Container_Base.cpp index f1fce5ec95f..794e3927437 100644 --- a/TAO/CIAO/DAnCE/ciao/Container_Base.cpp +++ b/TAO/CIAO/DAnCE/ciao/Container_Base.cpp @@ -2,429 +2,300 @@ #include "Container_Base.h" #include "ace/DLL.h" -#include "tao/Utils/PolicyList_Destroyer.h" #include "ace/OS_NS_stdio.h" -#include "Servant_Activator.h" #if !defined (__ACE_INLINE__) # include "Container_Base.inl" #endif /* __ACE_INLINE__ */ -namespace CIAO +//////////////////////////////////////////////////////////////// + +CIAO::Container::Container (CORBA::ORB_ptr o) + : orb_ (CORBA::ORB::_duplicate (o)) { +} -//////////////////////////////////////////////////////////////// - Container::Container (CORBA::ORB_ptr o) - : orb_ (CORBA::ORB::_duplicate (o)) - { - } - - Container::~Container () - { - } - - PortableServer::POA_ptr - Container::the_POA (void) const - { - return this->component_poa_.in (); - } - - CORBA::ORB_ptr - Container::the_ORB (void) const - { - return this->orb_.in (); - } - - /////////////////////////////////////////////////////////////// - - ACE_Atomic_Op <ACE_SYNCH_MUTEX, long> - Session_Container::serial_number_ (0); - - Session_Container::Session_Container (CORBA::ORB_ptr o, - bool static_config_flag, - const Static_Config_EntryPoints_Maps* maps) +CIAO::Container::~Container () +{ +} + +PortableServer::POA_ptr +CIAO::Container::_ciao_the_POA (void) +{ + return this->poa_.in (); +} + +CORBA::ORB_ptr +CIAO::Container::_ciao_the_ORB () +{ + return this->orb_.in (); +} + +/////////////////////////////////////////////////////////////// + +ACE_Atomic_Op <ACE_SYNCH_MUTEX, long> +CIAO::Session_Container::serial_number_ (0); + +CIAO::Session_Container::Session_Container (CORBA::ORB_ptr o, + int static_config_flag, + const Static_Config_EntryPoints_Maps* maps + ) : Container (o), number_ (0), static_config_flag_ (static_config_flag), - static_entrypts_maps_ (maps), - sa_ (0) - { - } - - Session_Container::~Session_Container () - { - } - - int - Session_Container::init (const char *name, - const CORBA::PolicyList *more_policies - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - char buffer[MAXPATHLEN]; - - if (name == 0) - { - this->number_ = ++Session_Container::serial_number_; - ACE_OS::sprintf (buffer, "CIAO::Session_Container-%ld", - this->number_); - name = buffer; - } - - CORBA::Object_var poa_object = - this->orb_->resolve_initial_references("RootPOA" - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - if (CORBA::is_nil (poa_object.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n"), - -1); - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (poa_object.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - this->create_component_POA (name, - more_policies, - root_poa.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - this->create_facet_consumer_POA (root_poa.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - return 0; - } - - void - Session_Container::create_component_POA (const char *name, - const CORBA::PolicyList *p, - PortableServer::POA_ptr root - ACE_ENV_ARG_DECL) - { - // Set up proper poa policies here. Default policies seems to be - // fine for session container. If you add some other default - // policies here, then you need to "add" more_policies below - // instead of simply assigning more_policies to the init policy - // list. - CORBA::PolicyList policies (0); - - if (p != 0) - policies = *p; - - PortableServer::POAManager_var poa_manager = - root->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - this->component_poa_ = - root->create_POA (name, - poa_manager.in (), - policies - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - void - Session_Container::create_facet_consumer_POA ( - PortableServer::POA_ptr root - ACE_ENV_ARG_DECL) - { - PortableServer::POAManager_var poa_manager = - root->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - TAO::Utils::PolicyList_Destroyer policies (3); - policies.length (3); - - policies[0] = - root->create_id_assignment_policy (PortableServer::USER_ID - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - policies[1] = - root->create_request_processing_policy (PortableServer::USE_SERVANT_MANAGER - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // Servant Retention Policy - policies[2] = - root->create_servant_retention_policy (PortableServer::RETAIN - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - this->facet_cons_poa_ = - root->create_POA ("facet_consumer_poa", - poa_manager.in (), - policies - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - ACE_NEW_THROW_EX (this->sa_, - Servant_Activator (this->orb_.in ()), - CORBA::NO_MEMORY ()); - - this->facet_cons_poa_->set_servant_manager ( - this->sa_ - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - CORBA::Object_ptr - Session_Container::install_servant (PortableServer::Servant p, - Container::OA_Type t - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - PortableServer::POA_ptr tmp = 0; - - if (t == Container::Component) - tmp = this->component_poa_.in (); - else - tmp = this->facet_cons_poa_.in (); - - PortableServer::ObjectId_var oid - = tmp->activate_object (p - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - CORBA::Object_var objref - = tmp->id_to_reference (oid.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - return objref._retn (); - } - - CORBA::Object_ptr - Session_Container::install_component (PortableServer::Servant p, - PortableServer::ObjectId_out oid - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - PortableServer::ObjectId_var id = - this->component_poa_->activate_object (p - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - CORBA::Object_var objref - = this->component_poa_->id_to_reference (id.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - oid = id._retn (); - - return objref._retn (); - } - - - //@@ Apparently we need to be cautious when handling the exception - // thrown here. We should make sure that new DnC interfaces - // NodeApplication/NodeApplicationManager etc will cache the new - // exceptions--> rethrow of new exceptions is needed. - // --Tao - Components::CCMHome_ptr - Session_Container::ciao_install_home (const char *exe_dll_name, - const char *exe_entrypt, - const char *sv_dll_name, - const char *sv_entrypt - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Deployment::UnknownImplId, - Deployment::ImplEntryPointNotFound, - Deployment::InstallationFailure)) - { - - HomeFactory hcreator = 0; - ServantFactory screator = 0; - - if (this->static_config_flag_ == 0) - { - ACE_DLL executor_dll, servant_dll; - - if (exe_dll_name == 0 || sv_dll_name == 0) - ACE_THROW_RETURN (Deployment::UnknownImplId (), - Components::CCMHome::_nil ()); - - if (executor_dll.open (exe_dll_name, - ACE_DEFAULT_SHLIB_MODE, - 0) != 0 - || servant_dll.open (sv_dll_name, - ACE_DEFAULT_SHLIB_MODE, - 0) != 0) - { - ACE_THROW_RETURN (Deployment::UnknownImplId (), - Components::CCMHome::_nil ()); - } - - if (exe_entrypt == 0 || sv_entrypt == 0) - ACE_THROW_RETURN (Deployment::ImplEntryPointNotFound (), - Components::CCMHome::_nil ()); - - // @@ (OO) Please use a static_cast<> here instead of a C-style - // cast. ANSI C++ casts are the preferred (and modern) - // way of casting in ACE/TAO/CIAO. - hcreator = (HomeFactory) executor_dll.symbol (exe_entrypt); - screator = (ServantFactory) servant_dll.symbol (sv_entrypt); + static_entrypts_maps_ (maps) +{ +} + +CIAO::Session_Container::~Session_Container () +{ +} + +int +CIAO::Session_Container::init (const char *name, + const CORBA::PolicyList *more_policies + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + char buffer[MAXPATHLEN]; + + if (name == 0) + { + this->number_ = ++CIAO::Session_Container::serial_number_; + ACE_OS::sprintf (buffer, "CIAO::Session_Container-%ld", + this->number_); + name = buffer; } - else - { - if (static_entrypts_maps_ == 0 || - static_entrypts_maps_->home_creator_funcptr_map_ == 0 || - static_entrypts_maps_->home_servant_creator_funcptr_map_ == 0) - ACE_THROW_RETURN (Deployment::ImplEntryPointNotFound (), - Components::CCMHome::_nil ()); - - ACE_CString exe_entrypt_str (exe_entrypt); - static_entrypts_maps_->home_creator_funcptr_map_-> - find (exe_entrypt_str, hcreator); - - ACE_CString sv_entrypt_str (sv_entrypt); - static_entrypts_maps_->home_servant_creator_funcptr_map_-> - find (sv_entrypt_str, screator); - } - - if (hcreator == 0 || screator == 0) - ACE_THROW_RETURN (Deployment::ImplEntryPointNotFound (), - Components::CCMHome::_nil ()); - - Components::HomeExecutorBase_var home_executor = hcreator (); - if (CORBA::is_nil (home_executor.in ())) - ACE_THROW_RETURN (Deployment::InstallationFailure (), - Components::CCMHome::_nil ()); - - PortableServer::Servant home_servant = screator (home_executor.in (), - this - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (Components::CCMHome::_nil ()); - - if (home_servant == 0) - ACE_THROW_RETURN (Deployment::InstallationFailure (), - Components::CCMHome::_nil ()); - - PortableServer::ServantBase_var safe (home_servant); - - CORBA::Object_var objref = - this->install_servant (home_servant, - Container::Component - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (Components::CCMHome::_nil ()); - - Components::CCMHome_var homeref = - Components::CCMHome::_narrow (objref.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - return homeref._retn (); - - } - - void - Session_Container::ciao_uninstall_home (Components::CCMHome_ptr homeref + + CORBA::Object_var poa_object = + this->orb_->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (-1); + + if (CORBA::is_nil (poa_object.in ())) + ACE_ERROR_RETURN ((LM_ERROR, + " (%P|%t) Unable to initialize the POA.\n"), + -1); + + PortableServer::POA_var root_poa = + PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (-1); + + // Set up proper poa policies here. Default policies seems to be + // fine for session container. If you add some other default + // policies here, then you need to "add" more_policies below + // instead of simply assigning more_policies to the init policy + // list. + CORBA::PolicyList policies (0); + + if (more_policies != 0) + policies = *more_policies; + + this->poa_ = root_poa->create_POA (name, + PortableServer::POAManager::_nil (), + policies + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (-1); + + PortableServer::POAManager_var poa_manager = + this->poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (-1); + + poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (-1); + + return 0; +} + +CORBA::Object_ptr +CIAO::Session_Container::install_servant (PortableServer::Servant p ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - this->uninstall (homeref, - Container::Component - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - void - Session_Container::uninstall (CORBA::Object_ptr objref, - Container::OA_Type t - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - PortableServer::POA_ptr tmp = 0; - - if (t == Container::Component) - tmp = this->component_poa_.in (); - else - tmp = this->facet_cons_poa_.in (); - - PortableServer::ObjectId_var oid = - tmp->reference_to_id (objref - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - tmp->deactivate_object (oid.in () - ACE_ENV_ARG_PARAMETER); - } - - void - Session_Container::uninstall (PortableServer::Servant svt, - Container::OA_Type t - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - PortableServer::POA_ptr tmp = 0; - - if (t == Container::Component) - tmp = this->component_poa_.in (); - else - tmp = this->facet_cons_poa_.in (); - - PortableServer::ObjectId_var oid - = tmp->servant_to_id (svt + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + PortableServer::ObjectId_var oid + = this->poa_->activate_object (p + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + CORBA::Object_var objref + = this->poa_->id_to_reference (oid.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + return objref._retn (); +} + +CORBA::Object_ptr +CIAO::Session_Container::install_component (PortableServer::Servant p, + PortableServer::ObjectId_out oid + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + PortableServer::ObjectId_var id + = this->poa_->activate_object (p + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + CORBA::Object_var objref + = this->poa_->id_to_reference (id.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + oid = id._retn (); + + return objref._retn (); +} + + +//@@ Apparently we need to be cautious when handling the exception +// thrown here. We should make sure that new DnC interfaces +// NodeApplication/NodeApplicationManager etc will cache the new +// exceptions--> rethrow of new exceptions is needed. +// --Tao +Components::CCMHome_ptr +CIAO::Session_Container::ciao_install_home (const char *exe_dll_name, + const char *exe_entrypt, + const char *sv_dll_name, + const char *sv_entrypt + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Deployment::UnknownImplId, + Deployment::ImplEntryPointNotFound, + Deployment::InstallationFailure)) +{ + + HomeFactory hcreator = 0; + ServantFactory screator = 0; + + if (this->static_config_flag_ == 0) + { + ACE_DLL executor_dll, servant_dll; + + if (exe_dll_name == 0 || sv_dll_name == 0) + ACE_THROW_RETURN (Deployment::UnknownImplId (), + Components::CCMHome::_nil ()); + + if (executor_dll.open (exe_dll_name, + ACE_DEFAULT_SHLIB_MODE, + 0) != 0 + || servant_dll.open (sv_dll_name, + ACE_DEFAULT_SHLIB_MODE, + 0) != 0) + { + ACE_THROW_RETURN (Deployment::UnknownImplId (), + Components::CCMHome::_nil ()); + } + + if (exe_entrypt == 0 || sv_entrypt == 0) + ACE_THROW_RETURN (Deployment::ImplEntryPointNotFound (), + Components::CCMHome::_nil ()); + + // @@ (OO) Please use a static_cast<> here instead of a C-style + // cast. ANSI C++ casts are the preferred (and modern) + // way of casting in ACE/TAO/CIAO. + hcreator = (HomeFactory) executor_dll.symbol (exe_entrypt); + screator = (ServantFactory) servant_dll.symbol (sv_entrypt); + } + else + { + if (static_entrypts_maps_ == 0 || + static_entrypts_maps_->home_creator_funcptr_map_ == 0 || + static_entrypts_maps_->home_servant_creator_funcptr_map_ == 0) + ACE_THROW_RETURN (Deployment::ImplEntryPointNotFound (), + Components::CCMHome::_nil ()); + + ACE_CString exe_entrypt_str (exe_entrypt); + static_entrypts_maps_->home_creator_funcptr_map_-> + find (exe_entrypt_str, hcreator); + + ACE_CString sv_entrypt_str (sv_entrypt); + static_entrypts_maps_->home_servant_creator_funcptr_map_-> + find (sv_entrypt_str, screator); + } + + if (hcreator == 0 || screator == 0) + ACE_THROW_RETURN (Deployment::ImplEntryPointNotFound (), + Components::CCMHome::_nil ()); + + Components::HomeExecutorBase_var home_executor = hcreator (); + if (CORBA::is_nil (home_executor.in ())) + ACE_THROW_RETURN (Deployment::InstallationFailure (), + Components::CCMHome::_nil ()); + + PortableServer::Servant home_servant = screator (home_executor.in (), + this + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (Components::CCMHome::_nil ()); + + if (home_servant == 0) + ACE_THROW_RETURN (Deployment::InstallationFailure (), + Components::CCMHome::_nil ()); + + PortableServer::ServantBase_var safe (home_servant); + + CORBA::Object_var objref = this->install_servant (home_servant + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (Components::CCMHome::_nil ()); + + Components::CCMHome_var homeref = + Components::CCMHome::_narrow (objref.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + return homeref._retn (); + +} + +void +CIAO::Session_Container::ciao_uninstall_home (Components::CCMHome_ptr homeref + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + this->uninstall (homeref + ACE_ENV_ARG_PARAMETER); +} + +void +CIAO::Session_Container::uninstall (CORBA::Object_ptr objref + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + PortableServer::ObjectId_var oid + = this->poa_->reference_to_id (objref + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + this->poa_->deactivate_object (oid.in () + ACE_ENV_ARG_PARAMETER); +} + +void +CIAO::Session_Container::uninstall (PortableServer::Servant svt + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + PortableServer::ObjectId_var oid + = this->poa_->servant_to_id (svt ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + ACE_CHECK; - tmp->deactivate_object (oid.in () - ACE_ENV_ARG_PARAMETER); - } + this->poa_->deactivate_object (oid.in () + ACE_ENV_ARG_PARAMETER); +} - void - Session_Container::uninstall_component (Components::CCMObject_ptr objref, - PortableServer::ObjectId_out oid - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - - PortableServer::ObjectId_var id = - this->component_poa_->reference_to_id (objref - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - this->component_poa_->deactivate_object (id.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - oid = id._retn (); - } - - CORBA::Object_ptr - Session_Container::generate_reference (const char *obj_id, - const char *repo_id, - Container::OA_Type t - ACE_ENV_ARG_DECL) - { - PortableServer::POA_ptr tmp = 0; - - if (t == Container::Component) - tmp = this->component_poa_.in (); - else - tmp = this->facet_cons_poa_.in (); - - PortableServer::ObjectId_var oid = - PortableServer::string_to_ObjectId (obj_id); - - CORBA::Object_var objref = - tmp->create_reference_with_id (oid.in (), - repo_id - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (CORBA::Object::_nil ()); - - return objref._retn (); - } +void +CIAO::Session_Container::uninstall_component (Components::CCMObject_ptr objref, + PortableServer::ObjectId_out oid + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + PortableServer::ObjectId_var id + = this->poa_->reference_to_id (objref + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + this->poa_->deactivate_object (id.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + oid = id._retn (); } diff --git a/TAO/CIAO/DAnCE/ciao/Container_Base.h b/TAO/CIAO/DAnCE/ciao/Container_Base.h index b76cf9da544..2a618114c7d 100644 --- a/TAO/CIAO/DAnCE/ciao/Container_Base.h +++ b/TAO/CIAO/DAnCE/ciao/Container_Base.h @@ -20,9 +20,9 @@ #include "tao/ORB.h" #include "tao/PortableServer/PortableServer.h" #include "tao/PortableServer/Servant_Base.h" -#include "ciao/CCM_ContainerC.h" -#include "ciao/Deployment_CoreC.h" -#include "ciao/CIAO_Server_Export.h" +#include "CCM_ContainerC.h" +#include "Deployment_CoreC.h" +#include "CIAO_Server_Export.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -30,8 +30,6 @@ namespace CIAO { - class Servant_Activator; - /** * @class Container * @@ -43,25 +41,16 @@ namespace CIAO class CIAO_SERVER_Export Container { public: - enum OA_Type - { - Component, - Facet_Consumer - }; - Container (CORBA::ORB_ptr o); virtual ~Container (void) = 0; - /// Get component's POA. - /** - * This operation does *NOT* increase the reference count of the - * POA. Look at the const qualifier in the method. - */ - PortableServer::POA_ptr the_POA (void) const; + /// Get the containing POA. This operation does *NOT* + /// increase the reference count of the POA. + virtual PortableServer::POA_ptr _ciao_the_POA (void); /// Get a reference to the underlying ORB. - CORBA::ORB_ptr the_ORB (void) const; + virtual CORBA::ORB_ptr _ciao_the_ORB (void); /// Initialize the container with a name. virtual int init (const char *name = 0, @@ -88,25 +77,14 @@ namespace CIAO // Uninstall a servant for component. virtual void uninstall_component (::Components::CCMObject_ptr objref, - PortableServer::ObjectId_out oid - ACE_ENV_ARG_DECL_WITH_DEFAULTS) + PortableServer::ObjectId_out oid + ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)) = 0; - protected: CORBA::ORB_var orb_; - /// POA within which all the components in this container will be - /// activated. - PortableServer::POA_var component_poa_; - - /// POA within which all the facets and receptacles will be - /// activated. - /** - * Having two POA's allows us to associate different policies that - * are distinct from the component. - */ - PortableServer::POA_var facet_cons_poa_; + PortableServer::POA_var poa_; }; class Session_Container; @@ -115,10 +93,7 @@ namespace CIAO typedef ::PortableServer::Servant (*ServantFactory) (::Components::HomeExecutorBase_ptr p, ::CIAO::Session_Container *c -#if !defined (TAO_HAS_EXCEPTIONS) || defined (ACE_ENV_BKWD_COMPAT) - , CORBA::Environment & -#endif - ); + ACE_ENV_ARG_DECL_WITH_DEFAULTS); typedef ACE_Hash_Map_Manager_Ex<ACE_CString, HomeFactory, @@ -149,8 +124,9 @@ namespace CIAO // It appears to be a boolean value. Please use bool // instead. Session_Container (CORBA::ORB_ptr o, - bool static_config_flag = false, - const Static_Config_EntryPoints_Maps* static_entrypts_maps =0); + int static_config_flag =0, + const Static_Config_EntryPoints_Maps* static_entrypts_maps =0 + ); virtual ~Session_Container (void); @@ -158,7 +134,6 @@ namespace CIAO virtual int init (const char *name = 0, const CORBA::PolicyList *more_policies = 0 ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); /** @@ -190,13 +165,12 @@ namespace CIAO // Uninstall a servant for component. virtual void uninstall_component (::Components::CCMObject_ptr objref, - PortableServer::ObjectId_out oid - ACE_ENV_ARG_DECL_WITH_DEFAULTS) + PortableServer::ObjectId_out oid + ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); // Install a servant for component or home. - CORBA::Object_ptr install_servant (PortableServer::Servant p, - Container::OA_Type t + CORBA::Object_ptr install_servant (PortableServer::Servant p ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); @@ -212,44 +186,15 @@ namespace CIAO ACE_THROW_SPEC ((CORBA::SystemException)); // Uninstall a servant for component or home. - void uninstall (CORBA::Object_ptr objref, - Container::OA_Type t + void uninstall (CORBA::Object_ptr objref ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); // Uninstall a servant for component or home. - void uninstall (PortableServer::Servant svt, - Container::OA_Type t + void uninstall (PortableServer::Servant svt ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); - // Analog of the POA method that creates an object reference from - // an object id string. - CORBA::Object_ptr generate_reference (const char *obj_id, - const char *repo_id, - Container::OA_Type t - ACE_ENV_ARG_DECL); - - /// Return the servant activator factory that activates the - /// servants for facets and consumers. - Servant_Activator *ports_servant_activator (void) const; - - private: - - /// Create POA for the component. - /** - * This is the POA that is returned to the component applications - * if they need one. - */ - void create_component_POA (const char *name, - const CORBA::PolicyList *p, - PortableServer::POA_ptr root - ACE_ENV_ARG_DECL); - - /// Create POA for the facets and consumers alone. - void create_facet_consumer_POA (PortableServer::POA_ptr root - ACE_ENV_ARG_DECL); - protected: long number_; @@ -259,12 +204,8 @@ namespace CIAO // boolean value. Please use bool instead. // // It looks like it can also be declared const, as well. - bool static_config_flag_; + int static_config_flag_; const Static_Config_EntryPoints_Maps* static_entrypts_maps_; - - /// The servant activator factory used to activate facets and - /// consumer servants. - Servant_Activator *sa_; }; } @@ -277,7 +218,7 @@ namespace CIAO { \ CORBA::ValueFactory factory = new FACTORY; \ CORBA::ORB_ptr orb = \ - this->context_->_ciao_the_Container ()->the_ORB (); \ + this->context_->_ciao_the_Container ()->_ciao_the_ORB (); \ CORBA::ValueFactory prev_factory = \ orb->register_value_factory ( \ VALUETYPE::_tao_obv_static_repository_id (), \ diff --git a/TAO/CIAO/DAnCE/ciao/Container_Base.inl b/TAO/CIAO/DAnCE/ciao/Container_Base.inl index 0d6aeef9bcc..5435a481075 100644 --- a/TAO/CIAO/DAnCE/ciao/Container_Base.inl +++ b/TAO/CIAO/DAnCE/ciao/Container_Base.inl @@ -5,12 +5,6 @@ CIAO::Session_Container::get_objref (PortableServer::Servant p ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { - return this->the_POA ()->servant_to_reference (p - ACE_ENV_ARG_PARAMETER); -} - -ACE_INLINE CIAO::Servant_Activator * -CIAO::Session_Container::ports_servant_activator (void) const -{ - return this->sa_; + return this->_ciao_the_POA ()->servant_to_reference (p + ACE_ENV_ARG_PARAMETER); } diff --git a/TAO/CIAO/DAnCE/ciao/Servant_Impl_Base.cpp b/TAO/CIAO/DAnCE/ciao/Servant_Impl_Base.cpp index fccbf855572..16bfc99c407 100644 --- a/TAO/CIAO/DAnCE/ciao/Servant_Impl_Base.cpp +++ b/TAO/CIAO/DAnCE/ciao/Servant_Impl_Base.cpp @@ -1,8 +1,6 @@ // $Id$ #include "Servant_Impl_Base.h" -#include "StandardConfigurator_Impl.h" -#include "Container_Base.h" namespace CIAO { @@ -15,347 +13,6 @@ namespace CIAO { } - // Operations for CCMObject interface. - - ::Components::PrimaryKeyBase * - Servant_Impl_Base::get_primary_key ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - ::Components::NoKeyAvailable)) - { - ACE_THROW_RETURN (::Components::NoKeyAvailable (), 0); - - return 0; - } - - CORBA::IRObject_ptr - Servant_Impl_Base::get_component_def ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), - CORBA::IRObject::_nil ()); - } - - void - Servant_Impl_Base::configuration_complete ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidConfiguration)) - { - // CIAO to-do - } - - void - Servant_Impl_Base::remove ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::RemoveFailure)) - { - // CIAO to-do - } - - ::Components::ConnectionDescriptions * - Servant_Impl_Base::get_connections ( - const char * /* name */ - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)) - { - ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); - } - - ::Components::ComponentPortDescription * - Servant_Impl_Base::get_all_ports ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - OBV_Components::ComponentPortDescription *cps = 0; - ACE_NEW_RETURN (cps, - OBV_Components::ComponentPortDescription, - 0); - ::Components::ComponentPortDescription_var retv = cps; - - ::Components::FacetDescriptions_var facets_desc = - this->get_all_facets (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - ::Components::ReceptacleDescriptions_var receptacle_desc = - this->get_all_receptacles (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - ::Components::ConsumerDescriptions_var consumer_desc = - this->get_all_consumers (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - ::Components::EmitterDescriptions_var emitter_desc = - this->get_all_emitters (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - ::Components::PublisherDescriptions_var publisher_desc = - this->get_all_publishers (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - retv->facets (facets_desc.in ()); - retv->receptacles (receptacle_desc.in ()); - retv->consumers (consumer_desc.in ()); - retv->emitters (emitter_desc.in ()); - retv->publishers (publisher_desc.in ()); - - return retv._retn (); - } - - CORBA::Object_ptr - Servant_Impl_Base::provide_facet ( - const char *name - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)) - { - if (name == 0) - { - ACE_THROW_RETURN (Components::InvalidName (), - CORBA::Object::_nil ()); - } - - CORBA::Object_ptr retval = this->lookup_facet (name); - - if (CORBA::is_nil (retval)) - { - ACE_THROW_RETURN (Components::InvalidName (), - CORBA::Object::_nil ()); - } - - return retval; - } - - Components::FacetDescriptions * - Servant_Impl_Base::get_named_facets ( - const ::Components::NameList & names - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)) - { - Components::FacetDescriptions *retval = 0; - ACE_NEW_RETURN (retval, - ::Components::FacetDescriptions, - 0); - Components::FacetDescriptions_var safe_retval = retval; - CORBA::ULong len = names.length (); - safe_retval->length (len); - ::Components::FacetDescription *tmp = 0; - - for (CORBA::ULong i = 0; i < len; ++i) - { - tmp = this->lookup_facet_description (names[i].in ()); - - if (tmp == 0) - { - ACE_THROW_RETURN (Components::InvalidName (), - 0); - } - - safe_retval[i] = tmp; - } - - return safe_retval._retn (); - } - - ::Components::FacetDescriptions * - Servant_Impl_Base::get_all_facets ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ::Components::FacetDescriptions *tmp = 0; - ACE_NEW_RETURN (tmp, - ::Components::FacetDescriptions, - 0); - - ::Components::FacetDescriptions_var retval = tmp; - - retval->length (this->facet_table_.current_size ()); - CORBA::ULong i = 0; - - for (FacetTable::iterator iter = this->facet_table_.begin (); - iter != this->facet_table_.end (); - ++iter, ++i) - { - FacetTable::ENTRY & entry = *iter; - retval[i] = entry.int_id_; - } - - return retval._retn (); - } - - ::Components::ConsumerDescriptions * - Servant_Impl_Base::get_all_consumers ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ::Components::ConsumerDescriptions *tmp = 0; - ACE_NEW_RETURN (tmp, - ::Components::ConsumerDescriptions, - 0); - - ::Components::ConsumerDescriptions_var retval = tmp; - - retval->length (this->consumer_table_.current_size ()); - CORBA::ULong i = 0; - - for (ConsumerTable::iterator iter = this->consumer_table_.begin (); - iter != this->consumer_table_.end (); - ++iter, ++i) - { - ConsumerTable::ENTRY & entry = *iter; - retval[i] = entry.int_id_; - } - - return retval._retn (); - } - - ::Components::EventConsumerBase_ptr - Servant_Impl_Base::get_consumer ( - const char *sink_name - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)) - { - if (sink_name == 0) - { - ACE_THROW_RETURN (Components::InvalidName (), - Components::EventConsumerBase::_nil ()); - } - - Components::EventConsumerBase_ptr retval = - this->lookup_consumer (sink_name); - - if (CORBA::is_nil (retval)) - { - ACE_THROW_RETURN (Components::InvalidName (), - Components::EventConsumerBase::_nil ()); - } - - return retval; - } - - ::Components::EventConsumerBase_ptr - Servant_Impl_Base::disconnect_consumer ( - const char * /* source_name */ - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName, - Components::NoConnection)) - { - ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); - } - - ::Components::ConsumerDescriptions * - Servant_Impl_Base::get_named_consumers ( - const ::Components::NameList & names - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)) - { - Components::ConsumerDescriptions *retval = 0; - ACE_NEW_RETURN (retval, - ::Components::ConsumerDescriptions, - 0); - Components::ConsumerDescriptions_var safe_retval = retval; - CORBA::ULong len = names.length (); - safe_retval->length (len); - ::Components::ConsumerDescription *tmp = 0; - - for (CORBA::ULong i = 0; i < len; ++i) - { - tmp = this->lookup_consumer_description (names[i].in ()); - - if (tmp == 0) - { - ACE_THROW_RETURN (Components::InvalidName (), - 0); - } - - safe_retval[i] = tmp; - } - - return safe_retval._retn (); - } - - ::Components::EmitterDescriptions * - Servant_Impl_Base::get_all_emitters ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); - } - - ::Components::EmitterDescriptions * - Servant_Impl_Base::get_named_emitters ( - const ::Components::NameList & /* names */ - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)) - { - ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); - } - - ::Components::ReceptacleDescriptions * - Servant_Impl_Base::get_all_receptacles ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); - } - - ::Components::ReceptacleDescriptions * - Servant_Impl_Base::get_named_receptacles ( - const ::Components::NameList & /* names */ - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)) - { - ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); - } - - ::Components::PublisherDescriptions * - Servant_Impl_Base::get_all_publishers ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); - } - - ::Components::PublisherDescriptions * - Servant_Impl_Base::get_named_publishers ( - const ::Components::NameList & /* names */ - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)) - { - ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); - } - - /// Protected operations. - void Servant_Impl_Base::add_facet (const char *port_name, CORBA::Object_ptr port_ref) @@ -374,32 +31,6 @@ namespace CIAO safe._retn (); } } - - CORBA::Object_ptr - Servant_Impl_Base::lookup_facet (const char *port_name) - { - ::Components::FacetDescription_var fd; - - if (this->facet_table_.find (port_name, fd) != 0) - { - return CORBA::Object::_nil (); - } - - return CORBA::Object::_duplicate (fd.in ()->facet_ref ()); - } - - ::Components::FacetDescription * - Servant_Impl_Base::lookup_facet_description (const char *port_name) - { - ::Components::FacetDescription_var fd; - - if (this->facet_table_.find (port_name, fd) != 0) - { - return 0; - } - - return fd._retn (); - } void Servant_Impl_Base::add_consumer ( @@ -421,60 +52,4 @@ namespace CIAO safe._retn (); } } - - ::Components::EventConsumerBase_ptr - Servant_Impl_Base::lookup_consumer (const char *port_name) - { - ::Components::ConsumerDescription_var cd; - - if (this->consumer_table_.find (port_name, cd) != 0) - { - return ::Components::EventConsumerBase::_nil (); - } - - return - ::Components::EventConsumerBase::_duplicate (cd.in ()->consumer ()); - } - - ::Components::ConsumerDescription * - Servant_Impl_Base::lookup_consumer_description ( - const char *port_name - ) - { - ::Components::ConsumerDescription_var cd; - - if (this->consumer_table_.find (port_name, cd) != 0) - { - return 0; - } - - return cd._retn (); - } - - Components::StandardConfigurator* - Servant_Impl_Base::get_standard_configurator ( - ACE_ENV_SINGLE_ARG_DECL) - { - // Create the configurator servant. - StandardConfigurator_Impl *config_impl = 0; - - ACE_NEW_THROW_EX (config_impl, - StandardConfigurator_Impl (this), - CORBA::NO_MEMORY ()); - - - Components::StandardConfigurator_var configurator = - config_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (Components::StandardConfigurator::_nil ()); - - return configurator._retn (); - } - - PortableServer::POA_ptr - Servant_Impl_Base::_default_POA ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - { - return - PortableServer::POA::_duplicate (container_->the_POA ()); - } } diff --git a/TAO/CIAO/DAnCE/ciao/Servant_Impl_Base.h b/TAO/CIAO/DAnCE/ciao/Servant_Impl_Base.h index 272fa8f3d5a..ea854dbde26 100644 --- a/TAO/CIAO/DAnCE/ciao/Servant_Impl_Base.h +++ b/TAO/CIAO/DAnCE/ciao/Servant_Impl_Base.h @@ -27,7 +27,6 @@ #include "CCM_EventC.h" #include "CIAO_Server_Export.h" -#include "CCM_ComponentS.h" namespace CIAO { @@ -42,150 +41,19 @@ namespace CIAO * Servant_Impl. */ class CIAO_SERVER_Export Servant_Impl_Base - : public virtual POA_Components::CCMObject { public: Servant_Impl_Base (Session_Container * c); virtual ~Servant_Impl_Base (void); - /// Operations for CCMObject interface. - - virtual ::Components::PrimaryKeyBase * - get_primary_key (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::NoKeyAvailable)); - - virtual CORBA::IRObject_ptr - get_component_def (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void - configuration_complete (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidConfiguration)); - - virtual void - remove (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::RemoveFailure)); - - virtual ::Components::ConnectionDescriptions * - get_connections (const char *name - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)); - - virtual ::Components::ComponentPortDescription * - get_all_ports (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual CORBA::Object_ptr - provide_facet (const char *name - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)); - - virtual ::Components::FacetDescriptions * - get_named_facets (const ::Components::NameList & names - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)); - - virtual ::Components::FacetDescriptions * - get_all_facets (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual ::Components::ConsumerDescriptions * - get_all_consumers (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual ::Components::EventConsumerBase_ptr - get_consumer (const char *sink_name - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)); - - virtual ::Components::EventConsumerBase_ptr - disconnect_consumer (const char *source_name - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName, - Components::NoConnection)); - - virtual ::Components::ConsumerDescriptions * - get_named_consumers (const ::Components::NameList & names - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)); - - virtual ::Components::EmitterDescriptions * - get_all_emitters (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual ::Components::EmitterDescriptions * - get_named_emitters (const ::Components::NameList & /* names */ - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)); - - virtual ::Components::ReceptacleDescriptions * - get_all_receptacles (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual ::Components::ReceptacleDescriptions * - get_named_receptacles (const ::Components::NameList & /* names */ - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)); - - virtual ::Components::PublisherDescriptions * - get_all_publishers (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual ::Components::PublisherDescriptions * - get_named_publishers (const ::Components::NameList & names - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)); - - /// Operation to set attributes on the component. - virtual void set_attributes (const Components::ConfigValues &descr - ACE_ENV_ARG_DECL) = 0; - - // Creates and returns the StandardConfigurator for the component. - virtual Components::StandardConfigurator *get_standard_configurator ( - ACE_ENV_SINGLE_ARG_DECL - ); - - /// Override that returns the (passed-in) default POA of our member - /// component's container, to ensure that we get registered - /// to that POA when _this() is called. - virtual PortableServer::POA_ptr _default_POA ( - ACE_ENV_SINGLE_ARG_DECL - ); - protected: void add_facet (const char *port_name, CORBA::Object_ptr port_ref); - CORBA::Object_ptr lookup_facet (const char *port_name); - - ::Components::FacetDescription *lookup_facet_description ( - const char *port_name - ); - void add_consumer (const char *port_name, ::Components::EventConsumerBase_ptr port_ref); - - ::Components::EventConsumerBase_ptr lookup_consumer ( - const char *port_name - ); - - ::Components::ConsumerDescription *lookup_consumer_description ( - const char *port_name - ); - + protected: typedef ACE_Hash_Map_Manager_Ex<const char *, ::Components::FacetDescription_var, diff --git a/TAO/CIAO/DAnCE/ciao/Servant_Impl_T.cpp b/TAO/CIAO/DAnCE/ciao/Servant_Impl_T.cpp index 4e39010461f..443aab29064 100644 --- a/TAO/CIAO/DAnCE/ciao/Servant_Impl_T.cpp +++ b/TAO/CIAO/DAnCE/ciao/Servant_Impl_T.cpp @@ -26,200 +26,68 @@ namespace CIAO typename CONTEXT> Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, CONTEXT>::~Servant_Impl (void) { - ACE_TRY_NEW_ENV - { - ::Components::SessionComponent_var scom = - ::Components::SessionComponent::_narrow ( - this->executor_.in () - ACE_ENV_ARG_PARAMETER - ); - ACE_TRY_CHECK; - - if (! ::CORBA::is_nil (scom.in ())) - { - scom->ccm_remove (ACE_ENV_SINGLE_ARG_PARAMETER); - } - } - ACE_CATCHANY - { - } - ACE_ENDTRY; - - this->context_->_remove_ref (); - } - - // Operations for CCMObject interface. - - template <typename BASE_SKEL, - typename EXEC, - typename EXEC_VAR, - typename CONTEXT> - CORBA::Boolean - Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, CONTEXT>::same_component ( - CORBA::Object_ptr object_ref - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - if (::CORBA::is_nil (object_ref)) - { - ACE_THROW_RETURN (::CORBA::BAD_PARAM (), 0); - } - - ::CORBA::Object_var the_other = - object_ref->_get_component (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - ::CORBA::Object_var me = - this->context_->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - return me->_is_equivalent (the_other.in () - ACE_ENV_ARG_PARAMETER); } template <typename BASE_SKEL, typename EXEC, typename EXEC_VAR, typename CONTEXT> - ::Components::CCMHome_ptr - Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, CONTEXT>::get_ccm_home ( - ACE_ENV_SINGLE_ARG_DECL + ::Components::FacetDescriptions * + Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, CONTEXT>::get_all_facets ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED ) ACE_THROW_SPEC ((CORBA::SystemException)) { - return this->context_->get_CCM_home (ACE_ENV_SINGLE_ARG_PARAMETER); - } + ::Components::FacetDescriptions *tmp = 0; + ACE_NEW_RETURN (tmp, + ::Components::FacetDescriptions, + 0); - template <typename BASE_SKEL, - typename EXEC, - typename EXEC_VAR, - typename CONTEXT> - CORBA::Object_ptr - Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, CONTEXT>::_get_component ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ::Components::SessionContext_var sc = - ::Components::SessionContext::_narrow ( - this->context_ - ACE_ENV_ARG_PARAMETER - ); - ACE_CHECK_RETURN (::CORBA::Object::_nil ()); + ::Components::FacetDescriptions_var retval = tmp; - if (! ::CORBA::is_nil (sc.in ())) - { - return sc->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); - } + retval->length (this->facet_table_.current_size ()); + CORBA::ULong i = 0; - ::Components::EntityContext_var ec = - ::Components::EntityContext::_narrow ( - this->context_ - ACE_ENV_ARG_PARAMETER - ); - ACE_CHECK_RETURN (::CORBA::Object::_nil ()); - - if (! ::CORBA::is_nil (ec.in ())) + for (FacetTable::iterator iter = this->facet_table_.begin (); + iter != this->facet_table_.end (); + ++iter, ++i) { - return ec->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); + FacetTable::ENTRY & entry = *iter; + retval[i] = entry.int_id_; } - ACE_THROW_RETURN (CORBA::INTERNAL (), - ::CORBA::Object::_nil ()); + return retval._retn (); } - // CIAO-specific operations. - template <typename BASE_SKEL, typename EXEC, typename EXEC_VAR, typename CONTEXT> - void - Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, CONTEXT>::ciao_preactivate ( - ACE_ENV_SINGLE_ARG_DECL + ::Components::ConsumerDescriptions * + Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, CONTEXT>::get_all_consumers ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED ) ACE_THROW_SPEC ((CORBA::SystemException)) { - ::Components::SessionComponent_var temp = - ::Components::SessionComponent::_narrow ( - this->executor_.in () - ACE_ENV_ARG_PARAMETER - ); - ACE_CHECK; + ::Components::ConsumerDescriptions *tmp = 0; + ACE_NEW_RETURN (tmp, + ::Components::ConsumerDescriptions, + 0); - if (! ::CORBA::is_nil (temp.in ())) - { - temp->ciao_preactivate (ACE_ENV_SINGLE_ARG_PARAMETER); - } - } + ::Components::ConsumerDescriptions_var retval = tmp; - template <typename BASE_SKEL, - typename EXEC, - typename EXEC_VAR, - typename CONTEXT> - void - Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, CONTEXT>::ciao_activate ( - ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ::Components::SessionComponent_var temp = - ::Components::SessionComponent::_narrow ( - this->executor_.in () - ACE_ENV_ARG_PARAMETER - ); - ACE_CHECK; + retval->length (this->consumer_table_.current_size ()); + CORBA::ULong i = 0; - if (! ::CORBA::is_nil (temp.in ())) + for (ConsumerTable::iterator iter = this->consumer_table_.begin (); + iter != this->consumer_table_.end (); + ++iter, ++i) { - temp->ccm_activate (ACE_ENV_SINGLE_ARG_PARAMETER); + ConsumerTable::ENTRY & entry = *iter; + retval[i] = entry.int_id_; } - } - template <typename BASE_SKEL, - typename EXEC, - typename EXEC_VAR, - typename CONTEXT> - void - Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, CONTEXT>::ciao_postactivate ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ::Components::SessionComponent_var temp = - ::Components::SessionComponent::_narrow ( - this->executor_.in () - ACE_ENV_ARG_PARAMETER - ); - ACE_CHECK; - - if (! ::CORBA::is_nil (temp.in ())) - { - temp->ciao_postactivate (ACE_ENV_SINGLE_ARG_PARAMETER); - } - } - - template <typename BASE_SKEL, - typename EXEC, - typename EXEC_VAR, - typename CONTEXT> - void - Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, CONTEXT>::_ciao_passivate ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ::Components::SessionComponent_var temp = - ::Components::SessionComponent::_narrow ( - this->executor_.in () - ACE_ENV_ARG_PARAMETER - ); - ACE_CHECK; - - if (! ::CORBA::is_nil (temp.in ())) - { - temp->ccm_passivate (ACE_ENV_SINGLE_ARG_PARAMETER); - } + return retval._retn (); } } diff --git a/TAO/CIAO/DAnCE/ciao/Servant_Impl_T.h b/TAO/CIAO/DAnCE/ciao/Servant_Impl_T.h index 45f223f57b5..af8f19a0eb2 100644 --- a/TAO/CIAO/DAnCE/ciao/Servant_Impl_T.h +++ b/TAO/CIAO/DAnCE/ciao/Servant_Impl_T.h @@ -43,48 +43,21 @@ namespace CIAO typename EXEC_VAR, typename CONTEXT> class Servant_Impl : public virtual BASE_SKEL, - public virtual Servant_Impl_Base + public Servant_Impl_Base { public: - Servant_Impl (EXEC * exe, + Servant_Impl (EXEC * exe, Session_Container * c); - virtual ~Servant_Impl (void); - // Operations for CCMObject interface. - - virtual CORBA::Boolean - same_component (CORBA::Object_ptr object_ref - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual ::Components::CCMHome_ptr - get_ccm_home (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual CORBA::Object_ptr - _get_component (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - // CIAO-specific operations. - - void - ciao_preactivate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void - ciao_activate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + virtual ::Components::FacetDescriptions * + get_all_facets (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); - - void - ciao_postactivate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + + virtual ::Components::ConsumerDescriptions * + get_all_consumers (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); - - /// @@NOTE: The busted operation. - void - _ciao_passivate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - + protected: EXEC_VAR executor_; diff --git a/TAO/CIAO/DAnCE/tests/Config_Handlers/Handler_Test.cpp b/TAO/CIAO/DAnCE/tests/Config_Handlers/Handler_Test.cpp index 6b117839019..a00a939f113 100644 --- a/TAO/CIAO/DAnCE/tests/Config_Handlers/Handler_Test.cpp +++ b/TAO/CIAO/DAnCE/tests/Config_Handlers/Handler_Test.cpp @@ -1,204 +1,17 @@ // $Id$ -#ifndef HANDLER_TEST_CPP -#define HANDLER_TEST_CPP #include "Handler_Test.h" -#include "ace/Get_Opt.h" -#include "ace/Auto_Ptr.h" -#include "ace/Log_Msg.h" -#include "ace/OS_main.h" -#include "ace/Auto_Ptr.h" -#include "tao/Exception.h" -#include "Config_Handlers/XercesString.h" -#include <xercesc/util/XMLUniDefs.hpp> -#include "Config_Handlers/Config_Handler_export.h" -#include "Config_Handlers/DnC_Dump.h" -#include "Config_Handlers/Config_Error_Handler.h" +#ifdef ACE_HAS_BROKEN_NESTED_TEMPLATES -using Config_Handler::XStr; -using xercesc::XMLUni; -using xercesc::XMLString; -using xercesc::XMLException; -using xercesc::DOMException; -using xercesc::DOMBuilder; -using xercesc::DOMImplementationRegistry; -using xercesc::DOMImplementationLS; -using xercesc::DOMImplementation; -using xercesc::DOMAttr; -using xercesc::DOMNamedNodeMap; -using xercesc::DOMLocator; -using xercesc::DOMError; -using xercesc::DOMNodeList; -using xercesc::DOMDocument; -using xercesc::DOMDocumentTraversal; -using xercesc::DOMNodeIterator; -using xercesc::DOMNode; -using xercesc::DOMNodeFilter; - -void -usage (const ACE_TCHAR* program) +int +ACE_TMAIN (int argc, ACE_TCHAR *argv[]) { ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Usage: %s -u <URI>\n") - ACE_TEXT (" <URI>: URI identifying the resource\n"), - program)); -} - -template <typename HANDLER, typename DATA> -int run_test (int argc, ACE_TCHAR *argv[], void (HANDLER::*func) (DATA&)) -{ - ACE_TCHAR* url = 0; - - ACE_Get_Opt get_opt (argc, argv, ACE_TEXT ("u:")); - int c; - - while ((c = get_opt ()) != EOF) - { - switch (c) - { - case 'u': - url = get_opt.opt_arg(); - break; - default: - usage(argv[0]); - return -1; - } - } - - if (url == 0) { - usage (argv[0]); - return -1; - } - - // Initialize the ORB so that CORBA::Any will work - // - CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, ""); - - // Initialize the Xerces run-time - try - { - xercesc::XMLPlatformUtils::Initialize(); - } - - catch (const XMLException& e) - { - char* message = XMLString::transcode (e.getMessage()); - ACE_Auto_Basic_Array_Ptr<char> cleanup_message (message); - ACE_DEBUG ((LM_DEBUG, "Error during initialization : %s\n", message)); - return 1; - } - - try - { - - // Instantiate the DOM parser. - static const XMLCh gLS[] = { xercesc::chLatin_L, - xercesc::chLatin_S, - xercesc::chNull }; - - // Get an implementation of the Load-Store (LS) interface - DOMImplementation* impl - = DOMImplementationRegistry::getDOMImplementation(gLS); - - auto_ptr<DOMImplementation> cleanup_impl (impl); - - // Create a DOMBuilder - DOMBuilder* parser = - ((DOMImplementationLS*)impl)->createDOMBuilder(DOMImplementationLS::MODE_SYNCHRONOUS, 0); - - auto_ptr<DOMBuilder> cleanup_builder (parser); - - // Discard comment nodes in the document - parser->setFeature (XMLUni::fgDOMComments, false); - - // Disable datatype normalization. The XML 1.0 attribute value - // normalization always occurs though. - parser->setFeature (XMLUni::fgDOMDatatypeNormalization, true); - - // Do not create EntityReference nodes in the DOM tree. No - // EntityReference nodes will be created, only the nodes - // corresponding to their fully expanded sustitution text will be - // created. - parser->setFeature (XMLUni::fgDOMEntities, false); - - // Perform Namespace processing. - parser->setFeature (XMLUni::fgDOMNamespaces, true); - - // Perform Validation - parser->setFeature (XMLUni::fgDOMValidation, true); - - // Do not include ignorable whitespace in the DOM tree. - parser->setFeature (XMLUni::fgDOMWhitespaceInElementContent, false); - - // Enable the parser schema support. - parser->setFeature (XMLUni::fgXercesSchema, true); - - // Enable full schema constraint checking, including checking which - // may be time-consuming or memory intensive. Currently, particle - // unique attribution constraint checking and particle derivation - // restriction checking are controlled by this option. - parser->setFeature (XMLUni::fgXercesSchemaFullChecking, true); - - // The parser will treat validation error as fatal and will exit. - parser->setFeature (XMLUni::fgXercesValidationErrorAsFatal, true); - - CIAO::Config_Handler::Config_Error_Handler handler; - parser->setErrorHandler(&handler); - - DOMDocument* doc = parser->parseURI(url); - auto_ptr<DOMDocument> cleanup_doc (doc); - - if (handler.getErrors()) - { - return 1; - } - HANDLER obj (doc, DOMNodeFilter::SHOW_ELEMENT | - DOMNodeFilter::SHOW_TEXT); - - DATA data; - (obj.*func)(data); - Deployment::DnC_Dump::dump (data); - //domain_handler.dump(domain); - - // parser->release (); - } - catch (const DOMException& e) - { - const unsigned int maxChars = 2047; - XMLCh errText[maxChars + 1]; - - ACE_ERROR ((LM_ERROR, "\nException occured while parsing %s: \n", url)); - ACE_ERROR ((LM_ERROR, "DOMException code: %d\n ", e.code)); - if (DOMImplementation::loadDOMExceptionMsg(e.code, errText, maxChars)) - { - char* message = XMLString::transcode (errText); - ACE_Auto_Basic_Array_Ptr<char> cleanup_message (message); - ACE_ERROR ((LM_ERROR, "Message is: %s\n", message)); - } - return 1; - } - catch (const XMLException& e) - { - char* message = XMLString::transcode (e.getMessage()); - ACE_Auto_Basic_Array_Ptr<char> cleanup_message (message); - ACE_ERROR ((LM_ERROR, "\nException occured: %s\n ", message)); - return 1; - } - catch (CORBA::Exception& ex) - { - ACE_PRINT_EXCEPTION (ex, "Caught CORBA Exception: "); - return 1; - } - catch (...) - { - ACE_ERROR ((LM_ERROR, "Caught unknown exception\n")); - return 1; - } - - xercesc::XMLPlatformUtils::Terminate(); - return 0; + ACE_TEXT ("DaNCe internal testing doesn't work with compilers ") + ACE_TEXT ("not supporting nested templates (like VC6).\n"))); + return -1; } +#endif // ACE_HAS_BROKEN_NESTED_TEMPLATES -#endif /*HANDLER_TEST_CPP*/ diff --git a/TAO/CIAO/DAnCE/tests/Config_Handlers/Handler_Test.h b/TAO/CIAO/DAnCE/tests/Config_Handlers/Handler_Test.h index b51a6e4c00b..a5598e8a55c 100644 --- a/TAO/CIAO/DAnCE/tests/Config_Handlers/Handler_Test.h +++ b/TAO/CIAO/DAnCE/tests/Config_Handlers/Handler_Test.h @@ -6,6 +6,8 @@ #include "ace/Log_Msg.h" #include "ace/OS_main.h" +#ifndef ACE_HAS_BROKEN_NESTED_TEMPLATES + #include "ace/Get_Opt.h" #include "ace/Auto_Ptr.h" #include "tao/Exception.h" @@ -40,13 +42,9 @@ using xercesc::DOMNodeFilter; template <typename HANDLER, typename DATA> int run_test (int argc, ACE_TCHAR *argv[], void (HANDLER::*func) (DATA&)); +#include "Handler_Test.i" -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "Handler_Test.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Handler_Test.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ +#endif // ACE_HAS_BROKEN_NESTED_TEMPLATES #endif // HANDLER_TEST_H + diff --git a/TAO/CIAO/DAnCE/tests/Config_Handlers/Handler_Test.i b/TAO/CIAO/DAnCE/tests/Config_Handlers/Handler_Test.i index cfa1da318d3..eb6041b83d0 100644 --- a/TAO/CIAO/DAnCE/tests/Config_Handlers/Handler_Test.i +++ b/TAO/CIAO/DAnCE/tests/Config_Handlers/Handler_Test.i @@ -1 +1,197 @@ // $Id$ + +#include "ace/Get_Opt.h" +#include "ace/Auto_Ptr.h" +#include "ace/Log_Msg.h" +#include "ace/OS_main.h" +#include "ace/Auto_Ptr.h" +#include "tao/Exception.h" +#include "Config_Handlers/XercesString.h" +#include <xercesc/util/XMLUniDefs.hpp> +#include "Config_Handlers/Config_Handler_export.h" +#include "Config_Handlers/DnC_Dump.h" +#include "Config_Handlers/Config_Error_Handler.h" + +using Config_Handler::XStr; +using xercesc::XMLUni; +using xercesc::XMLString; +using xercesc::XMLException; +using xercesc::DOMException; +using xercesc::DOMBuilder; +using xercesc::DOMImplementationRegistry; +using xercesc::DOMImplementationLS; +using xercesc::DOMImplementation; +using xercesc::DOMAttr; +using xercesc::DOMNamedNodeMap; +using xercesc::DOMLocator; +using xercesc::DOMError; +using xercesc::DOMNodeList; +using xercesc::DOMDocument; +using xercesc::DOMDocumentTraversal; +using xercesc::DOMNodeIterator; +using xercesc::DOMNode; +using xercesc::DOMNodeFilter; + +inline void +usage (const ACE_TCHAR* program) +{ + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("Usage: %s -u <URI>\n") + ACE_TEXT (" <URI>: URI identifying the resource\n"), + program)); +} + +template <typename HANDLER, typename DATA> +int run_test (int argc, ACE_TCHAR *argv[], void (HANDLER::*func) (DATA&)) +{ + ACE_TCHAR* url = 0; + + ACE_Get_Opt get_opt (argc, argv, ACE_TEXT ("u:")); + int c; + + while ((c = get_opt ()) != EOF) + { + switch (c) + { + case 'u': + url = get_opt.opt_arg(); + break; + default: + usage(argv[0]); + return -1; + } + } + + if (url == 0) { + usage(argv[0]); + return -1; + } + + // Initialize the ORB so that CORBA::Any will work + // + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, ""); + + // Initialize the Xerces run-time + try + { + xercesc::XMLPlatformUtils::Initialize(); + } + + catch (const XMLException& e) + { + char* message = XMLString::transcode (e.getMessage()); + ACE_Auto_Basic_Array_Ptr<char> cleanup_message (message); + ACE_DEBUG ((LM_DEBUG, "Error during initialization : %s\n", message)); + return 1; + } + + try + { + + // Instantiate the DOM parser. + static const XMLCh gLS[] = { xercesc::chLatin_L, + xercesc::chLatin_S, + xercesc::chNull }; + + // Get an implementation of the Load-Store (LS) interface + DOMImplementation* impl + = DOMImplementationRegistry::getDOMImplementation(gLS); + + auto_ptr<DOMImplementation> cleanup_impl (impl); + + // Create a DOMBuilder + DOMBuilder* parser = + ((DOMImplementationLS*)impl)->createDOMBuilder(DOMImplementationLS::MODE_SYNCHRONOUS, 0); + + auto_ptr<DOMBuilder> cleanup_builder (parser); + + // Discard comment nodes in the document + parser->setFeature (XMLUni::fgDOMComments, false); + + // Disable datatype normalization. The XML 1.0 attribute value + // normalization always occurs though. + parser->setFeature (XMLUni::fgDOMDatatypeNormalization, true); + + // Do not create EntityReference nodes in the DOM tree. No + // EntityReference nodes will be created, only the nodes + // corresponding to their fully expanded sustitution text will be + // created. + parser->setFeature (XMLUni::fgDOMEntities, false); + + // Perform Namespace processing. + parser->setFeature (XMLUni::fgDOMNamespaces, true); + + // Perform Validation + parser->setFeature (XMLUni::fgDOMValidation, true); + + // Do not include ignorable whitespace in the DOM tree. + parser->setFeature (XMLUni::fgDOMWhitespaceInElementContent, false); + + // Enable the parser schema support. + parser->setFeature (XMLUni::fgXercesSchema, true); + + // Enable full schema constraint checking, including checking which + // may be time-consuming or memory intensive. Currently, particle + // unique attribution constraint checking and particle derivation + // restriction checking are controlled by this option. + parser->setFeature (XMLUni::fgXercesSchemaFullChecking, true); + + // The parser will treat validation error as fatal and will exit. + parser->setFeature (XMLUni::fgXercesValidationErrorAsFatal, true); + + CIAO::Config_Handler::Config_Error_Handler handler; + parser->setErrorHandler(&handler); + + DOMDocument* doc = parser->parseURI(url); + auto_ptr<DOMDocument> cleanup_doc (doc); + + if (handler.getErrors()) + { + return 1; + } + HANDLER obj (doc, DOMNodeFilter::SHOW_ELEMENT | + DOMNodeFilter::SHOW_TEXT); + + DATA data; + (obj.*func)(data); + Deployment::DnC_Dump::dump (data); + //domain_handler.dump(domain); + + // parser->release (); + } + catch (const DOMException& e) + { + const unsigned int maxChars = 2047; + XMLCh errText[maxChars + 1]; + + ACE_ERROR ((LM_ERROR, "\nException occured while parsing %s: \n", url)); + ACE_ERROR ((LM_ERROR, "DOMException code: %d\n ", e.code)); + if (DOMImplementation::loadDOMExceptionMsg(e.code, errText, maxChars)) + { + char* message = XMLString::transcode (errText); + ACE_Auto_Basic_Array_Ptr<char> cleanup_message (message); + ACE_ERROR ((LM_ERROR, "Message is: %s\n", message)); + } + return 1; + } + catch (const XMLException& e) + { + char* message = XMLString::transcode (e.getMessage()); + ACE_Auto_Basic_Array_Ptr<char> cleanup_message (message); + ACE_ERROR ((LM_ERROR, "\nException occured: %s\n ", message)); + return 1; + } + catch (CORBA::Exception& ex) + { + ACE_PRINT_EXCEPTION (ex, "Caught CORBA Exception: "); + return 1; + } + catch (...) + { + ACE_ERROR ((LM_ERROR, "Caught unknown exception\n")); + return 1; + } + + xercesc::XMLPlatformUtils::Terminate(); + return 0; +} diff --git a/TAO/CIAO/DAnCE/tests/Config_Handlers/handler_test.mpb b/TAO/CIAO/DAnCE/tests/Config_Handlers/handler_test.mpb index 07bec27c7a4..fae3de02b21 100644 --- a/TAO/CIAO/DAnCE/tests/Config_Handlers/handler_test.mpb +++ b/TAO/CIAO/DAnCE/tests/Config_Handlers/handler_test.mpb @@ -1,16 +1,15 @@ //$Id$ -project : taoexe, ciao_server_dnc, ciao_deployment_stub { +project : taoexe, ciao_client_dnc, ciao_deployment_stub { // , portableserver, typecodefactory { dynamicflags = CONFIG_HANDLER_BUILD_DLL macros += XML_USE_PTHREADS requires += exceptions - includes += $(XERCESCROOT)/include $(ACE_ROOT)/TAO/CIAO/DAnCE - libpaths += $(XERCESCROOT)/lib + includes += $(XERCESCROOT)/include /usr/include $(ACE_ROOT)/TAO/CIAO/DAnCE + libpaths += $(XERCESCROOT)/lib /usr/lib // $(ACE_ROOT)/lib libs += xerces-c Config_Handlers // Deployment_stub Deployment_svnt -// libs += CIAO_DnC_Server CIAO_DnC_Container after += Config_Handlers - Template_Files { + Source_Files { Handler_Test.cpp } } diff --git a/TAO/CIAO/DAnCE/tests/NodeApplicationTest/NodeAppTest.mpc b/TAO/CIAO/DAnCE/tests/NodeApplicationTest/NodeAppTest.mpc index d9048326040..23507cdc58c 100644 --- a/TAO/CIAO/DAnCE/tests/NodeApplicationTest/NodeAppTest.mpc +++ b/TAO/CIAO/DAnCE/tests/NodeApplicationTest/NodeAppTest.mpc @@ -17,7 +17,6 @@ project(NodeAppTest_RoundTrip_stub): ciao_client_dnc { project(NodeAppTest_RoundTrip_svnt) : ciao_servant_dnc { after += NodeAppTest_RoundTrip_stub - requires += cidl sharedname = NodeAppTest_RoundTrip_svnt libs += NodeAppTest_RoundTrip_stub @@ -55,10 +54,10 @@ project(NodeAppTest_RoundTrip_exec) : ciao_component_dnc { } } -project (NodeAppTest_client_simple) : ciao_server_dnc, ciao_deployment_svnt { +project (NodeAppTest_client_simple) : ciao_server_dnc, ciao_deployment_stub { after += NodeAppTest_RoundTrip_exec - libs += NodeAppTest_RoundTrip_stub + libs += NodeAppTest_RoundTrip_stub exename += client_simple IDL_Files { @@ -69,7 +68,7 @@ project (NodeAppTest_client_simple) : ciao_server_dnc, ciao_deployment_svnt { } } -project (NodeAppTest_client) : ciao_server_dnc, ciao_deployment_svnt { +project (NodeAppTest_client) : ciao_server_dnc, ciao_deployment_stub { after += NodeAppTest_RoundTrip_exec libs += NodeAppTest_RoundTrip_stub exename += client @@ -83,9 +82,9 @@ project (NodeAppTest_client) : ciao_server_dnc, ciao_deployment_svnt { } } -project (NodeAppTest_client_ex) : ciao_server_dnc, ciao_deployment_svnt { +project (NodeAppTest_client_ex) : ciao_server_dnc, ciao_deployment_stub { after += NodeAppTest_RoundTrip_exec - libs += NodeAppTest_RoundTrip_stub + libs += NodeAppTest_RoundTrip_stub exename += client_ex IDL_Files { diff --git a/TAO/CIAO/DAnCE/tests/NodeApplicationTest/RoundTrip_exec.cpp b/TAO/CIAO/DAnCE/tests/NodeApplicationTest/RoundTrip_exec.cpp index 4563835a2a0..48c585202d9 100644 --- a/TAO/CIAO/DAnCE/tests/NodeApplicationTest/RoundTrip_exec.cpp +++ b/TAO/CIAO/DAnCE/tests/NodeApplicationTest/RoundTrip_exec.cpp @@ -119,8 +119,7 @@ RoundTrip_Impl::RoundTripHome_exec_i::create (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) // Implementation for the probided inferface. CORBA::Long -RoundTrip_Impl::LatencyTest_Impl::cube_long (CORBA::Long data - ACE_ENV_ARG_DECL_NOT_USED) +RoundTrip_Impl::LatencyTest_Impl::cube_long (CORBA::Long data) ACE_THROW_SPEC ((CORBA::SystemException)) { return data*data*data; diff --git a/TAO/CIAO/DAnCE/tests/NodeApplicationTest/RoundTrip_exec.h b/TAO/CIAO/DAnCE/tests/NodeApplicationTest/RoundTrip_exec.h index ce25a707580..132d52a2e30 100644 --- a/TAO/CIAO/DAnCE/tests/NodeApplicationTest/RoundTrip_exec.h +++ b/TAO/CIAO/DAnCE/tests/NodeApplicationTest/RoundTrip_exec.h @@ -109,8 +109,7 @@ namespace RoundTrip_Impl { } - virtual CORBA::Long cube_long (CORBA::Long data - ACE_ENV_ARG_DECL) + virtual CORBA::Long cube_long (CORBA::Long data) ACE_THROW_SPEC ((CORBA::SystemException)); }; diff --git a/TAO/CIAO/DAnCE/tests/NodeApplicationTest/run_test.pl b/TAO/CIAO/DAnCE/tests/NodeApplicationTest/run_test.pl index dc8afc09a22..66bd2b1120f 100755 --- a/TAO/CIAO/DAnCE/tests/NodeApplicationTest/run_test.pl +++ b/TAO/CIAO/DAnCE/tests/NodeApplicationTest/run_test.pl @@ -25,7 +25,7 @@ for ($iter = 0; $iter <= $#ARGV; $iter++) { unlink $iorfile; $CIAO_ROOT=$ENV{'CIAO_ROOT'}; -$SV = new PerlACE::Process ("$CIAO_ROOT/DAnCE/NodeApplication/NodeApplication", +$SV = new PerlACE::Process ("$CIAO_ROOT/DnC/NodeApplication/NodeApplication", "-n -o $iorfile"); $CL = new PerlACE::Process ("client", diff --git a/TAO/CIAO/DAnCE/tests/NodeApplicationTest/run_test_ex.pl b/TAO/CIAO/DAnCE/tests/NodeApplicationTest/run_test_ex.pl index ccb27eab392..1840175abde 100755 --- a/TAO/CIAO/DAnCE/tests/NodeApplicationTest/run_test_ex.pl +++ b/TAO/CIAO/DAnCE/tests/NodeApplicationTest/run_test_ex.pl @@ -25,7 +25,7 @@ for ($iter = 0; $iter <= $#ARGV; $iter++) { unlink $iorfile; $CIAO_ROOT=$ENV{'CIAO_ROOT'}; -$SV = new PerlACE::Process ("$CIAO_ROOT/DAnCE/NodeApplication/NodeApplication", +$SV = new PerlACE::Process ("$CIAO_ROOT/DnC/NodeApplication/NodeApplication", "-n -o $iorfile"); $CL = new PerlACE::Process ("client_ex", diff --git a/TAO/CIAO/DAnCE/tests/NodeApplicationTest/run_test_simple.pl b/TAO/CIAO/DAnCE/tests/NodeApplicationTest/run_test_simple.pl index 0d0253e2b5d..26b7edf2c14 100755 --- a/TAO/CIAO/DAnCE/tests/NodeApplicationTest/run_test_simple.pl +++ b/TAO/CIAO/DAnCE/tests/NodeApplicationTest/run_test_simple.pl @@ -25,7 +25,7 @@ for ($iter = 0; $iter <= $#ARGV; $iter++) { unlink $iorfile; $CIAO_ROOT=$ENV{'CIAO_ROOT'}; -$SV = new PerlACE::Process ("$CIAO_ROOT/DAnCE/NodeApplication/NodeApplication", +$SV = new PerlACE::Process ("$CIAO_ROOT/DnC/NodeApplication/NodeApplication", "-n -o $iorfile"); $CL = new PerlACE::Process ("client_simple", |