From 2997c37454f4ebccc6bbcdd864437b1576a88e55 Mon Sep 17 00:00:00 2001 From: jai Date: Thu, 1 Jul 2004 21:05:45 +0000 Subject: Thu Jul 1 16:01:12 2004 Jaiganesh B --- TAO/CIAO/ChangeLog | 39 + TAO/CIAO/DAnCE/Config_Handlers/Any_Handler.cpp | 230 +++++ TAO/CIAO/DAnCE/Config_Handlers/Any_Handler.h | 59 ++ TAO/CIAO/DAnCE/Config_Handlers/Basic_Handler.cpp | 40 + TAO/CIAO/DAnCE/Config_Handlers/Basic_Handler.h | 93 ++ TAO/CIAO/DAnCE/Config_Handlers/CAD_Handler.cpp | 310 ++++++ TAO/CIAO/DAnCE/Config_Handlers/CAD_Handler.h | 130 +++ TAO/CIAO/DAnCE/Config_Handlers/CEPE_Handler.cpp | 30 + TAO/CIAO/DAnCE/Config_Handlers/CEPE_Handler.h | 62 ++ TAO/CIAO/DAnCE/Config_Handlers/CPK_Handler.cpp | 75 ++ TAO/CIAO/DAnCE/Config_Handlers/CPK_Handler.h | 57 ++ TAO/CIAO/DAnCE/Config_Handlers/CPR_Handler.cpp | 40 + TAO/CIAO/DAnCE/Config_Handlers/CPR_Handler.h | 87 ++ TAO/CIAO/DAnCE/Config_Handlers/Cap_Handler.cpp | 57 ++ TAO/CIAO/DAnCE/Config_Handlers/Cap_Handler.h | 97 ++ .../DAnCE/Config_Handlers/CompImplDesc_Handler.cpp | 98 ++ .../DAnCE/Config_Handlers/CompImplDesc_Handler.h | 87 ++ .../DAnCE/Config_Handlers/CompIntrDesc_Handler.cpp | 164 +++ .../DAnCE/Config_Handlers/CompIntrDesc_Handler.h | 89 ++ .../DAnCE/Config_Handlers/CompPkgDesc_Handler.cpp | 75 ++ .../DAnCE/Config_Handlers/CompPkgDesc_Handler.h | 88 ++ .../DAnCE/Config_Handlers/Config_Error_Handler.cpp | 63 ++ .../DAnCE/Config_Handlers/Config_Error_Handler.h | 50 + .../DAnCE/Config_Handlers/Config_Handler_export.h | 58 ++ TAO/CIAO/DAnCE/Config_Handlers/Config_Handlers.mpc | 47 + TAO/CIAO/DAnCE/Config_Handlers/DT_Handler.cpp | 103 ++ TAO/CIAO/DAnCE/Config_Handlers/DT_Handler.h | 68 ++ TAO/CIAO/DAnCE/Config_Handlers/Deployment.h | 17 + TAO/CIAO/DAnCE/Config_Handlers/DnC_Dump.cpp | 1049 ++++++++++++++++++++ TAO/CIAO/DAnCE/Config_Handlers/DnC_Dump.h | 176 ++++ TAO/CIAO/DAnCE/Deployment.mwc | 4 + TAO/CIAO/DAnCE/Deployment.xsd | 776 +++++++++++++++ TAO/CIAO/DAnCE/Deployment.xsd.orig | 897 +++++++++++++++++ TAO/CIAO/DAnCE/XMI.xsd | 35 + TAO/CIAO/DAnCE/XMI.xsd.orig | 35 + 35 files changed, 5385 insertions(+) create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/Any_Handler.cpp create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/Any_Handler.h create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/Basic_Handler.cpp create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/Basic_Handler.h create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/CAD_Handler.cpp create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/CAD_Handler.h create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/CEPE_Handler.cpp create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/CEPE_Handler.h create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/CPK_Handler.cpp create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/CPK_Handler.h create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/CPR_Handler.cpp create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/CPR_Handler.h create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/Cap_Handler.cpp create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/Cap_Handler.h create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/CompImplDesc_Handler.cpp create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/CompImplDesc_Handler.h create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/CompIntrDesc_Handler.cpp create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/CompIntrDesc_Handler.h create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/CompPkgDesc_Handler.cpp create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/CompPkgDesc_Handler.h create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/Config_Error_Handler.cpp create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/Config_Error_Handler.h create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/Config_Handler_export.h create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/Config_Handlers.mpc create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/DT_Handler.cpp create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/DT_Handler.h create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/Deployment.h create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/DnC_Dump.cpp create mode 100644 TAO/CIAO/DAnCE/Config_Handlers/DnC_Dump.h create mode 100644 TAO/CIAO/DAnCE/Deployment.mwc create mode 100644 TAO/CIAO/DAnCE/Deployment.xsd create mode 100644 TAO/CIAO/DAnCE/Deployment.xsd.orig create mode 100644 TAO/CIAO/DAnCE/XMI.xsd create mode 100644 TAO/CIAO/DAnCE/XMI.xsd.orig diff --git a/TAO/CIAO/ChangeLog b/TAO/CIAO/ChangeLog index ffcb2d4a6f1..bfd6b249c91 100644 --- a/TAO/CIAO/ChangeLog +++ b/TAO/CIAO/ChangeLog @@ -1,3 +1,42 @@ +Thu Jul 1 16:01:12 2004 Jaiganesh B + + * DADAnCE/Deployment.xsd + * DAnCE/Deployment.mwc: + * DAnCE/Deployment.xsd.orig: + * DAnCE/XMI.xsd: + * DAnCE/XMI.xsd.orig: + * DAnCE/Config_Handlers/Any_Handler.cpp: + * DAnCE/Config_Handlers/Any_Handler.h: + * DAnCE/Config_Handlers/Basic_Handler.cpp: + * DAnCE/Config_Handlers/Basic_Handler.h: + * DAnCE/Config_Handlers/CAD_Handler.cpp: + * DAnCE/Config_Handlers/CAD_Handler.h: + * DAnCE/Config_Handlers/CEPE_Handler.h + * DAnCE/Config_Handlers/CEPE_Handler.cpp: + * DAnCE/Config_Handlers/CPK_Handler.cpp: + * DAnCE/Config_Handlers/CPK_Handler.h: + * DAnCE/Config_Handlers/CPR_Handler.cpp: + * DAnCE/Config_Handlers/CPR_Handler.h: + * DAnCE/Config_Handlers/Cap_Handler.cpp: + * DAnCE/Config_Handlers/Cap_Handler.h: + * DAnCE/Config_Handlers/CompImplDesc_Handler.cpp: + * DAnCE/Config_Handlers/CompImplDesc_Handler.h: + * DAnCE/Config_Handlers/CompIntrDesc_Handler.cpp: + * DAnCE/Config_Handlers/CompIntrDesc_Handler.h: + * DAnCE/Config_Handlers/CompPkgDesc_Handler.cpp: + * DAnCE/Config_Handlers/CompPkgDesc_Handler.h: + * DAnCE/Config_Handlers/Config_Error_Handler.cpp: + * DAnCE/Config_Handlers/Config_Error_Handler.h: + * DAnCE/Config_Handlers/Config_Handler_export.h: + * DAnCE/Config_Handlers/Config_Handlers.mpc: + * DAnCE/Config_Handlers/DT_Handler.cpp: + * DAnCE/Config_Handlers/DT_Handler.h: + * DAnCE/Config_Handlers/Deployment.h: + * DAnCE/Config_Handlers/DnC_Dump.cpp: + * DAnCE/Config_Handlers/DnC_Dump.h: + + Checked in all the XML handlers needed by DAnCE. + Thu Jul 1 15:54:15 2004 Jaiganesh B * DAnCE/Config_Handlers/Domain_Handler.cpp: diff --git a/TAO/CIAO/DAnCE/Config_Handlers/Any_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/Any_Handler.cpp new file mode 100644 index 00000000000..49ba1e531d1 --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/Any_Handler.cpp @@ -0,0 +1,230 @@ +//$Id$ + +#include "Any_Handler.h" +#include "DT_Handler.h" +#include "tao/Exception.h" +#include "Utils.h" + +void +CIAO::Config_Handler::Any_Handler::validate_ValueNode (DOMNodeIterator * iter, + const char * name) +{ + DOMNode * node = iter->nextNode (); + XStr temp_name (node->getNodeName ()); + if (temp_name != XStr (ACE_TEXT (name))) + { + ACE_DEBUG ((LM_DEBUG, "CIAO::Config_Handler::Any_Handler::validate\ + valueNode (), element mismatch expected \ + <%s> \n", name)); + ACE_THROW (CORBA::INTERNAL ()); + } +} + +void +CIAO::Config_Handler::Any_Handler::process_Any (DOMNodeIterator * iter, + ::CORBA::Any &any_obj) +{ + // Process the name value definitions within the Any + DOMNode * node = iter->nextNode (); + + // Get name of the current element + XStr name (node->getNodeName ()); + + // Initialize the ORB so that CORBA::Any will work + int argc = 0; + char ** argv = 0; + CORBA::ORB_ptr orb = CORBA::ORB_init (argc, argv, ""); + + if (name == XStr (ACE_TEXT ("type"))) + { + // Process DataType + ::CORBA::TypeCode_var type; + DT_Handler::process_DataType (iter, type.out (), orb); + + //Switch on the type of the BasicType + switch (type->kind ()) + { + case CORBA::tk_short: + // Check if next node is a node + CIAO::Config_Handler::Any_Handler::validate_ValueNode (iter, + "value"); + // Check if the next node is a node + CIAO::Config_Handler::Any_Handler::validate_ValueNode (iter, + "short"); + // Process the short value + any_obj <<= ACE_static_cast(CORBA::Short, + Utils::parse_long (iter)); + break; + + case CORBA::tk_ushort: + + // Check if next node is a node + CIAO::Config_Handler::Any_Handler::validate_ValueNode (iter, + "value"); + // Check if the next node is a node + CIAO::Config_Handler::Any_Handler::validate_ValueNode (iter, + "ushort"); + // Process the ushort value + any_obj <<= ACE_static_cast (CORBA::UShort, + Utils::parse_ulong (iter)); + break; + + case CORBA::tk_long: + + // Check if next node is a node + CIAO::Config_Handler::Any_Handler::validate_ValueNode (iter, + "value"); + // Check if the next node is a node + CIAO::Config_Handler::Any_Handler::validate_ValueNode (iter, + "long"); + // Process the long value + any_obj <<= ACE_static_cast (CORBA::Long, + Utils::parse_long (iter)); + break; + + case CORBA::tk_ulong: + // Check if next node is a node + CIAO::Config_Handler::Any_Handler::validate_ValueNode (iter, + "value"); + // Check if the next node is a node + CIAO::Config_Handler::Any_Handler::validate_ValueNode (iter, + "ulong"); + // Process the ulong value + any_obj <<= ACE_static_cast (CORBA::ULong, + Utils::parse_long (iter)); + break; + + case CORBA::tk_float: + // Check if next node is a node + CIAO::Config_Handler::Any_Handler::validate_ValueNode (iter, + "value"); + // Check if the next node is a node + CIAO::Config_Handler::Any_Handler::validate_ValueNode (iter, + "float"); + // Process the float value + any_obj <<= ACE_static_cast (CORBA::Float, + Utils::parse_float (iter)); + break; + + case CORBA::tk_double: + // Check if next node is a node + CIAO::Config_Handler::Any_Handler::validate_ValueNode (iter, + "value"); + // Check if the next node is a node + CIAO::Config_Handler::Any_Handler::validate_ValueNode (iter, + "double"); + // Process the double value + any_obj <<= ACE_static_cast (CORBA::Double, + Utils::parse_double (iter)); + break; + + case CORBA::tk_boolean: + // Check if next node is a node + CIAO::Config_Handler::Any_Handler::validate_ValueNode (iter, + "value"); + // Check if the next node is a node + CIAO::Config_Handler::Any_Handler::validate_ValueNode (iter, + "bool"); + // Process the bool value + any_obj <<= CORBA::Any::from_boolean (Utils::parse_bool (iter)); + break; + + case CORBA::tk_char: + // Check if next node is a node + CIAO::Config_Handler::Any_Handler::validate_ValueNode (iter, + "value"); + // Check if the next node is a node + CIAO::Config_Handler::Any_Handler::validate_ValueNode (iter, + "char"); + // Process the char value + any_obj <<= CORBA::Any::from_char (Utils::parse_char (iter)); + break; + + case CORBA::tk_octet: + // Check if next node is a node + CIAO::Config_Handler::Any_Handler::validate_ValueNode (iter, + "value"); + // Check if the next node is a node + CIAO::Config_Handler::Any_Handler::validate_ValueNode (iter, + "octet"); + // Process the octet value + any_obj <<= CORBA::Any::from_octet (Utils::parse_octet (iter)); + break; + + case CORBA::tk_string: + // Check if next node is a node + CIAO::Config_Handler::Any_Handler::validate_ValueNode (iter, + "value"); + // Check if the next node is a node + CIAO::Config_Handler::Any_Handler::validate_ValueNode (iter, + "string"); + // Process the string value + { + char * temp = Utils::parse_string (iter); + any_obj <<= temp; + XMLString::release (&temp); + } + break; + + case CORBA::tk_longlong: + // Check if next node is a node + CIAO::Config_Handler::Any_Handler::validate_ValueNode (iter, + "value"); + // Check if the next node is a node + CIAO::Config_Handler::Any_Handler::validate_ValueNode (iter, + "longlong"); + // Process the longlong value + any_obj <<= ACE_static_cast (CORBA::LongLong, + Utils::parse_long (iter)); + break; + + case CORBA::tk_ulonglong: + // Check if next node is a node + CIAO::Config_Handler::Any_Handler::validate_ValueNode (iter, + "value"); + // Check if the next node is a node + CIAO::Config_Handler::Any_Handler::validate_ValueNode (iter, + "ulonglong"); + // Process the longlong value + any_obj <<= ACE_static_cast (CORBA::ULongLong, + Utils::parse_ulong (iter)); + break; + + case CORBA::tk_longdouble: + // Check if next node is a node + CIAO::Config_Handler::Any_Handler::validate_ValueNode (iter, + "value"); + // Check if the next node is a node + CIAO::Config_Handler::Any_Handler::validate_ValueNode (iter, + "longdouble"); + // Process the longlong value -- Create a scope to define the + // lifetime for the ret_val object created within the case statement. + { +#if ACE_SIZEOF_LONG_DOUBLE == 16 + CORBA::LongDouble ret_str = Utils::parse_double (iter); +#else + CORBA::LongDouble ret_str; + char * ret_val = Utils::parse_string (iter); + ACE_OS::memcpy (&ret_str.ld, ret_val, 16); + XMLString::release (&ret_val); +#endif + any_obj <<= ret_str; + } + break; + + default: + ACE_DEBUG ((LM_DEBUG, "Currently the DnC handlers support only \ + basic types, complex and recusive type \ + support will be added\n")); + } + } + else + { + ACE_DEBUG ((LM_DEBUG, "Config_Handlers::Any_Handler::process_ \ + Any element mismatch expected ")); + ACE_THROW (CORBA::INTERNAL ()); + } + + // Release ORB resource + CORBA::release (orb); +} diff --git a/TAO/CIAO/DAnCE/Config_Handlers/Any_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/Any_Handler.h new file mode 100644 index 00000000000..be6dbcd591f --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/Any_Handler.h @@ -0,0 +1,59 @@ +//================================================================== +/** + * @file Any_Handler.h + * + * $Id$ + * + * @author Arvind S. Krishna + */ +//===================================================================== + +#ifndef ANY_HANDLER_H +#define ANY_HANDLER_H +#include /**/ "ace/pre.h" + +#include "ciao/DeploymentC.h" +#include "Config_Handler_export.h" + +#include +#include +#include "XercesString.h" + +using Config_Handler::XStr; +using xercesc::XMLString; +using xercesc::DOMText; +using xercesc::DOMNodeIterator; +using xercesc::DOMNode; + +namespace CIAO +{ + namespace Config_Handler + { + /** + * @class Any_Handler + * + * @brief Handler class for type + * + * This class defines handler methods to parse Implementation + * Dependency types in the descriptor files. The corresponding + * CORBA IDL type for the schema element is returned. + * + */ + class Config_Handler_Export Any_Handler + { + public: + static void process_Any (DOMNodeIterator * iter, + ::CORBA::Any &any_obj); + // process elements of type Deployment:Any in the descriptor files + + private: + static void validate_ValueNode (DOMNodeIterator * iter, + const char * name); + // validate .. node present in the XML schema + }; + } +} + +#include /**/ "ace/post.h" + +#endif /* ID_HANDLER_H */ diff --git a/TAO/CIAO/DAnCE/Config_Handlers/Basic_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/Basic_Handler.cpp new file mode 100644 index 00000000000..205ad62a83a --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/Basic_Handler.cpp @@ -0,0 +1,40 @@ +// $Id$ + +#include "Basic_Handler.h" + +BEGIN_DEPLOYMENT_NAMESPACE + +Basic_Handler::Basic_Handler (DOMDocument* doc, unsigned long filter) + : traverse_ (doc), + doc_ (doc), + root_ (doc->getDocumentElement()), + filter_ (filter), + iter_ (traverse_->createNodeIterator (this->root_, + this->filter_, + 0, + true)), + release_ (true), + index_ (0) +{ +} + +Basic_Handler::Basic_Handler (DOMNodeIterator* iter, bool release) + : traverse_ (0), doc_ (0), root_ (0), filter_ (0), iter_ (iter), + release_ (release) +{ +} + +Basic_Handler::Basic_Handler (DOMDocument* doc, DOMNodeIterator* iter, + bool release) + : traverse_ (0), doc_ (doc), root_ (0), filter_ (0), iter_ (iter), + release_ (release) +{ +} + +Basic_Handler::~Basic_Handler() +{ + if (this->release_) + this->iter_->release(); +} + +END_DEPLOYMENT_NAMESPACE diff --git a/TAO/CIAO/DAnCE/Config_Handlers/Basic_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/Basic_Handler.h new file mode 100644 index 00000000000..6c7089915b6 --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/Basic_Handler.h @@ -0,0 +1,93 @@ +//================================================================== +/** + * @file Basic_Handler.h + * + * $Id$ + * + * @author Emre Turkay + */ +//===================================================================== + +#ifndef BASIC_HANDLER_H +#define BASIC_HANDLER_H + +#include "Deployment.h" + +#include "ace/SString.h" +#include "ace/Null_Mutex.h" +#include "ace/Hash_Map_Manager.h" +#include "Config_Handler_export.h" + +#include + +using xercesc::DOMDocument; +using xercesc::DOMNodeIterator; +using xercesc::DOMDocumentTraversal; +using xercesc::DOMNode; + +BEGIN_DEPLOYMENT_NAMESPACE + +/** + * @class Basic_Handler + * + * @brief The base class for all the Handler classes + * + * This class provides the functionalities common to all handler classes. + * Keeps variables for basic XML document handling, + * initialization/uninitialization, + * and required get/set methods. + */ + +class Config_Handler_Export Basic_Handler { +public: + typedef ACE_Hash_Map_Manager REF_MAP; + typedef ACE_Hash_Map_Iterator REF_ITER; + typedef ACE_Hash_Map_Manager IDREF_MAP; + + Basic_Handler (DOMDocument* doc, unsigned long filter_); + + Basic_Handler (DOMNodeIterator* iter, bool release = false); + + Basic_Handler (DOMDocument* doc, DOMNodeIterator* iter, + bool release = false); + + ~Basic_Handler (void); + + REF_MAP& id_map() + { + return this->id_map_; + } + + void set_iter (DOMNodeIterator* iter) + { + iter_ = iter; + } + + void set_doc (DOMDocument* doc) + { + doc_ = doc; + } + +protected: + DOMDocumentTraversal* traverse_; + + DOMDocument* doc_; + + DOMNode* root_; + + unsigned long filter_; + + DOMNodeIterator* iter_; + + bool release_; + + int index_; + + REF_MAP id_map_; + + IDREF_MAP idref_map_; +}; + +END_DEPLOYMENT_NAMESPACE + +#endif // BASIC_HANDLER_H diff --git a/TAO/CIAO/DAnCE/Config_Handlers/CAD_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/CAD_Handler.cpp new file mode 100644 index 00000000000..1f6464e6102 --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/CAD_Handler.cpp @@ -0,0 +1,310 @@ +// $Id$ + +#include "tao/Exception.h" +#include "ace/Auto_Ptr.h" +#include "ace/Log_Msg.h" +#include "ERE_Handler.h" +#include "CEPE_Handler.h" +#include "CPR_Handler.h" +#include "CAD_Handler.h" +#include "Property_Handler.h" +#include "Requirement_Handler.h" +#include "CompPkgDesc_Handler.h" +#include "Utils.h" +#include "Process_Element.h" +#include + +BEGIN_DEPLOYMENT_NAMESPACE + +/// handle the connection resource deployment description and populate it +void CAD_Handler::process_ComponentAssemblyDescription + (::Deployment::ComponentAssemblyDescription& cad) +{ + for (DOMNode* node = this->iter_->nextNode(); + node != 0; + node = this->iter_->nextNode()) + { + XStr node_name (node->getNodeName()); + + if (node_name == XStr + (ACE_TEXT ("Deployment:ComponentAssemblyDescription"))) + { + } + else if + (process_sequence_local + + (this->doc_, this->iter_, node, + node_name, "instance", cad.instance, + this, &CAD_Handler::process_instance)); + else if + (process_sequence_local + (this->doc_, this->iter_, node, + node_name, "connection", cad.connection, + this, &CAD_Handler::process_connection)); + else if + (process_sequence_local + (this->doc_, this->iter_, node, + node_name, "externalProperty", cad.externalProperty, + this, &CAD_Handler::process_property)); + else + { + this->iter_->previousNode (); + return; + } + } + + this->update_spe_refs (cad); + this->update_spr_refs (cad); + + return; +} + +void CAD_Handler::update_spe_refs (Deployment:: + ComponentAssemblyDescription& cad) +{ + CORBA::ULong x; + CORBA::ULong y; + int ref_value; + int value; + ACE_TString ref_name; + + for (x = 0; x < cad.connection.length (); ++x) + { + for (y = 0; y < cad.connection[x].internalEndpoint.length (); ++y) + { + ref_value = cad.connection[x].internalEndpoint[y].instanceRef; + if (idref_map_.find (ref_value, ref_name) == 0) + { + if (id_map_.find (ref_name, value) == 0) + { + cad.connection[x].internalEndpoint[y].instanceRef= value; + } + } + } + } +} + +void CAD_Handler::update_spr_refs (Deployment:: + ComponentAssemblyDescription& cad) +{ + CORBA::ULong x; + CORBA::ULong y; + int ref_value; + int value; + ACE_TString ref_name; + + for (x = 0; x < cad.externalProperty.length (); ++x) + { + for (y = 0; y < cad.externalProperty[x].delegatesTo.length (); ++y) + { + ref_value = cad.externalProperty[x].delegatesTo[y].instanceRef; + if (idref_map_.find (ref_value, ref_name) == 0) + { + if (id_map_.find (ref_name, value) == 0) + { + cad.externalProperty[x].delegatesTo[y].instanceRef = value; + } + } + } + } +} + +void CAD_Handler::process_instance (DOMNodeIterator* iter, + Deployment:: + SubcomponentInstantiationDescription& sid) +{ + char* root_node_name_ch = XMLString::transcode + (this->doc_->getDocumentElement ()->getNodeName ()); + ACE_TString root_node_name (root_node_name_ch); + + XMLString::release (&root_node_name_ch); + + for (DOMNode* node = iter->nextNode(); + node != 0; + node = iter->nextNode ()) + { + XStr node_name (node->getNodeName()); + + if (node_name == XStr + (ACE_TEXT ("Deployment:SubcomponentInstantiationDescription"))) + { + } + else if + (CIAO::Config_Handler::Utils::process_string + (iter, node_name, "name", sid.name)); + else if + (process_sequence_remote + (this->doc_, this->iter_, node, + node_name, "package", sid.package, + &CompPkgDesc_Handler::process_ComponentPackageDescription, + this->id_map_)); + else if + (process_sequence_common + (this->doc_, this->iter_, node, + node_name, "configProperty", sid.configProperty, + &Property_Handler::process_Property, + this->id_map_)); + else if + (process_sequence_common + (this->doc_, this->iter_, node, + node_name, "selectRequirement", sid.selectRequirement, + &Requirement_Handler::process_Requirement, + this->id_map_)); + else if + (process_sequence_remote + (this->doc_, this->iter_, node, + node_name, "reference", sid.reference, + &CPR_Handler::process_ComponentPackageReference, this->id_map_)); + else + { + iter->previousNode(); + return; + } + } +} + +void CAD_Handler::process_connection (DOMNodeIterator* iter, + Deployment:: + AssemblyConnectionDescription& acd) +{ + for (DOMNode* node = iter->nextNode(); + node != 0; + node = iter->nextNode ()) + { + XStr node_name (node->getNodeName()); + + if (node_name == XStr + (ACE_TEXT ("Deployment:AssemblyConnectionDescription"))) + { + } + else if + (CIAO::Config_Handler::Utils::process_string + (iter, node_name, "name", acd.name)); + else if + (process_sequence_common + (node->getOwnerDocument(), iter, node, + node_name, "deployRequirement", acd.deployRequirement, + &Requirement_Handler::process_Requirement, + this->id_map_)); + else if + (process_sequence_common + (node->getOwnerDocument(), iter, node, + node_name, "externalEndpoint", acd.externalEndpoint, + &CEPE_Handler::process_ComponentExternalPortEndpoint, + this->id_map_)); + else if + (process_sequence_local + (node->getOwnerDocument(), iter, node, + node_name, "internalEndpoint", acd.internalEndpoint, + this, &CAD_Handler::process_spe)); + else if + (process_sequence_common + (node->getOwnerDocument(), iter, node, + node_name, "externalReference", acd.externalReference, + &ERE_Handler::process_ExternalReferenceEndpoint, + this->id_map_)); + else + { + iter->previousNode(); + return; + } + } +} + +void CAD_Handler::process_spe (DOMNodeIterator* iter, + Deployment::SubcomponentPortEndpoint& spe) +{ + for (DOMNode* node = iter->nextNode(); + node != 0; + node = iter->nextNode ()) + { + XStr node_name (node->getNodeName()); + + if (node_name == XStr + (ACE_TEXT ("Deployment:SubcomponentPortEndpoint"))) + { + } + else if + (CIAO::Config_Handler::Utils::process_string + (iter, node_name, "portName", spe.portName)); + else if + (process_reference(node, node_name, "instance", + spe.instanceRef, + this->index_, this->idref_map_)) + { + this->index_ = this->index_ + 1; + } + else + { + iter->previousNode(); + return; + } + } +} + +void CAD_Handler::process_spr (DOMNodeIterator* iter, + Deployment::SubcomponentPropertyReference& spr) +{ + for (DOMNode* node = iter->nextNode(); + node != 0; + node = iter->nextNode ()) + { + XStr node_name (node->getNodeName()); + + if (node_name == XStr + (ACE_TEXT ("Deployment:SubcomponentPropertyReference"))) + { + } + else if + (CIAO::Config_Handler::Utils::process_string + (iter, node_name, "propertyName", spr.propertyName)); + else if + (process_reference(node, node_name, "instance", + spr.instanceRef, + this->index_, this->idref_map_)) + { + this->index_ = this->index_ + 1; + } + else + { + iter->previousNode(); + return; + } + } +} + +void CAD_Handler::process_property(DOMNodeIterator* iter, + Deployment::AssemblyPropertyMapping& apm) +{ + for (DOMNode* node = iter->nextNode(); + node != 0; + node = iter->nextNode ()) + { + XStr node_name (node->getNodeName()); + + if (node_name == XStr + (ACE_TEXT ("Deployment:AssemblyPropertyMapping"))) + { + } + else if + (CIAO::Config_Handler::Utils::process_string + (iter, node_name, "name", apm.name)); + else if + (CIAO::Config_Handler::Utils::process_string + (iter, node_name, "externalName", apm.externalName)); + else if + (process_sequence_local + (node->getOwnerDocument(), iter, node, + node_name, "delegatesTo", apm.delegatesTo, + this, &CAD_Handler::process_spr)); + else + { + iter->previousNode(); + return; + } + } +} + +END_DEPLOYMENT_NAMESPACE diff --git a/TAO/CIAO/DAnCE/Config_Handlers/CAD_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/CAD_Handler.h new file mode 100644 index 00000000000..1e867628279 --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/CAD_Handler.h @@ -0,0 +1,130 @@ +//================================================================== +/** + * @file CAD_Handler.h + * + * $Id$ + * + * @author Aniruddha S. Gokhale + */ +//===================================================================== +#ifndef CAD_HANDLER_H +#define CAD_HANDLER_H +#include /**/ "ace/pre.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 "ace/Auto_Ptr.h" +#include "ace/Log_Msg.h" +#include "ace/OS_main.h" +#include "tao/Exception.h" +#include "XercesString.h" +#include +#include +#include +#include +#include + +using Config_Handler::XStr; +using xercesc::XMLUni; +using xercesc::XMLUri; +using xercesc::XMLURL; +using xercesc::XMLString; +using xercesc::XMLException; +using xercesc::DOMException; +using xercesc::DOMBuilder; +using xercesc::DOMImplementationRegistry; +using xercesc::DOMImplementationLS; +using xercesc::DOMImplementation; +using xercesc::DOMInputSource; +using xercesc::DOMText; +using xercesc::DOMNamedNodeMap; +using xercesc::DOMLocator; +using xercesc::DOMError; +using xercesc::DOMDocument; +using xercesc::DOMDocumentTraversal; +using xercesc::DOMNodeIterator; +using xercesc::DOMNode; +using xercesc::DOMNodeFilter; +using xercesc::DOMNamedNodeMap; + +BEGIN_DEPLOYMENT_NAMESPACE + +/** + * @class CAD_Handler + * + * @brief Handler class for type + * + * This class is within the Component Data Model subpackage of the + * Deployment & Configuration package. + * + * This class defines handler methods to parse the aforementioned type + * in the descriptor files. The corresponding CORBA IDL type for this + * element is returned. + */ + +class Config_Handler_Export CAD_Handler: public Basic_Handler +{ +public: + + /// constructor + CAD_Handler (DOMDocument* doc, unsigned long filter_) + : Basic_Handler (doc, filter_) { } + + /// constructor + CAD_Handler (DOMNodeIterator* iter, bool release = false) + : Basic_Handler (iter, release) { } + + /// constructor + CAD_Handler (DOMDocument* doc, DOMNodeIterator* iter, bool release = false) + : Basic_Handler (doc, iter, release) { } + + /// Process the component assembly description + void process_ComponentAssemblyDescription (::Deployment::ComponentAssemblyDescription &cad); + + /// process instance + void process_instance (DOMNodeIterator* iter, + Deployment::SubcomponentInstantiationDescription& sid); + + /// process connection element + void process_connection (DOMNodeIterator* iter, + Deployment::AssemblyConnectionDescription& acd); + + /// process property element + void process_property (DOMNodeIterator* iter, + Deployment::AssemblyPropertyMapping& acd); + + /// process spe element + void process_spe (DOMNodeIterator* iter, + Deployment::SubcomponentPortEndpoint& spe); + + /// process spr element + void process_spr (DOMNodeIterator* iter, + Deployment::SubcomponentPropertyReference& spr); + + /// process CPD + void process_package (DOMNodeIterator* iter, + Deployment::ComponentPackageDescription& sid_package); + + /// update spe refs + void update_spe_refs (Deployment::ComponentAssemblyDescription& cad); + + /// update spr refs + void update_spr_refs (Deployment::ComponentAssemblyDescription& cad); + +}; + +END_DEPLOYMENT_NAMESPACE + +#include /**/ "ace/post.h" + +#endif /* CAD_HANDLER_H */ diff --git a/TAO/CIAO/DAnCE/Config_Handlers/CEPE_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/CEPE_Handler.cpp new file mode 100644 index 00000000000..27152ba8c1d --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/CEPE_Handler.cpp @@ -0,0 +1,30 @@ +//$Id$ + +#include "CEPE_Handler.h" +#include "tao/Exception.h" +#include "Utils.h" + +using CIAO::Config_Handler::Utils; + +void +CIAO::Config_Handler::CEPE_Handler:: +process_ComponentExternalPortEndpoint (DOMNodeIterator * iter, + Deployment::ComponentExternalPortEndpoint + &ret_struct) +{ + //Check if the Schema IDs for both the elements match + DOMNode * node = iter->nextNode (); + XStr name (node->getNodeName ()); + + if (name != XStr (ACE_TEXT ("portName"))) + { + ACE_DEBUG ((LM_DEBUG, + "Config_Handlers:: \ + CEPE_Handler::process_ComponentExtPortEndPoint \ + element mismatch expected ")); + ACE_THROW (CORBA::INTERNAL ()); + } + + // Populate the structure + ret_struct.portName = Utils::parse_string (iter); +} diff --git a/TAO/CIAO/DAnCE/Config_Handlers/CEPE_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/CEPE_Handler.h new file mode 100644 index 00000000000..3d1fb12b00b --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/CEPE_Handler.h @@ -0,0 +1,62 @@ +//================================================================== +/** + * @file CEPE_Handler.h + * + * $Id$ + * + * @author Arvind S. Krishna + */ +//===================================================================== +#ifndef CEPE_HANDLER_H +#define CEPE_HANDLER_H +#include /**/ "ace/pre.h" + +#include "DeploymentC.h" +#include "Config_Handler_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +#pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include +#include +#include "XercesString.h" + +using Config_Handler::XStr; +using xercesc::XMLString; +using xercesc::DOMImplementation; +using xercesc::DOMText; +using xercesc::DOMNodeIterator; +using xercesc::DOMNode; + +namespace CIAO +{ + namespace Config_Handler + { + /** + * @class ID_Handler + * + * @brief Handler class for type + * + * This class defines handler methods to parse the aforementioned type + * in the descriptor files. The corresponding CORBA IDL type for this + * element is returned. + */ + + class Config_Handler_Export CEPE_Handler + { + public: + static void + process_ComponentExternalPortEndpoint (DOMNodeIterator * iter, + Deployment::ComponentExternalPortEndpoint &ret_struct); + // process definitions in the descriptor + // files + + }; + } + +} + +#include /**/ "ace/post.h" + +#endif /* CEPE_HANDLER_H */ diff --git a/TAO/CIAO/DAnCE/Config_Handlers/CPK_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/CPK_Handler.cpp new file mode 100644 index 00000000000..d2fee81d7ce --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/CPK_Handler.cpp @@ -0,0 +1,75 @@ +//$Id$ + +#include "CPK_Handler.h" +#include "tao/Exception.h" +#include "Utils.h" + +using CIAO::Config_Handler::Utils; + +void +CIAO::Config_Handler::CPK_Handler:: +process_CCMComponentPortKind (DOMNodeIterator * iter, + Deployment::CCMComponentPortKind &kind) +{ + char* facet = XMLString::transcode (XStr ("Facet")); + char* simplex_receptacle = XMLString::transcode (XStr ("SimplexReceptacle")); + char* multiplex_receptacle = XMLString::transcode + (XStr ("MultiplexReceptacle")); + char* event_emitter = XMLString::transcode (XStr ("EventEmitter")); + char* event_publisher = XMLString::transcode (XStr ("EventPublisher")); + char* event_consumer = XMLString::transcode (XStr ("EventConsumer")); + char * temp = Utils::parse_string (iter); + XStr kind_str = XStr (temp); + XMLString::release (&temp); + + char* kind_str_tr = XMLString::transcode (kind_str); + + if ((ACE_OS::strcmp (kind_str_tr, facet)) == 0) + { + kind = Deployment::Facet; + } + else if ((ACE_OS::strcmp (kind_str_tr, simplex_receptacle)) == 0) + { + kind = Deployment::SimplexReceptacle; + } + else if ((ACE_OS::strcmp (kind_str_tr, multiplex_receptacle)) == 0) + { + kind = Deployment::MultiplexReceptacle; + } + else if ((ACE_OS::strcmp (kind_str_tr, event_emitter)) == 0) + { + kind = Deployment::EventEmitter; + } + else if ((ACE_OS::strcmp (kind_str_tr, event_publisher)) == 0) + { + kind = Deployment::EventPublisher; + } + else if ((ACE_OS::strcmp (kind_str_tr, event_consumer)) == 0) + { + kind = Deployment::EventConsumer; + } + else + { + // Something wrong here.. Throw exception + XMLString::release (&kind_str_tr); + XMLString::release (&facet); + XMLString::release (&simplex_receptacle); + XMLString::release (&multiplex_receptacle); + XMLString::release (&event_emitter); + XMLString::release (&event_publisher); + XMLString::release (&event_consumer); + + ACE_DEBUG ((LM_DEBUG, + "Config_Handler::CPK_Handler::process_CCMComponentPortKing \ + illegal value found \n")); + ACE_THROW (CORBA::INTERNAL ()); + } + + XMLString::release (&kind_str_tr); + XMLString::release (&facet); + XMLString::release (&simplex_receptacle); + XMLString::release (&multiplex_receptacle); + XMLString::release (&event_emitter); + XMLString::release (&event_publisher); + XMLString::release (&event_consumer); +} diff --git a/TAO/CIAO/DAnCE/Config_Handlers/CPK_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/CPK_Handler.h new file mode 100644 index 00000000000..2eaa7b6a216 --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/CPK_Handler.h @@ -0,0 +1,57 @@ +//================================================================== +/** + * @file CPK_Handler.h + * + * $Id$ + * + * @author Emre Turkay + */ +//===================================================================== + +#ifndef CPK_HANDLER_H +#define CPK_HANDLER_H +#include /**/ "ace/pre.h" + +#include "DeploymentC.h" +#include "Config_Handler_export.h" + +#include +#include +#include "XercesString.h" + +using Config_Handler::XStr; +using xercesc::XMLString; +using xercesc::DOMText; +using xercesc::DOMNodeIterator; +using xercesc::DOMNode; + +namespace CIAO +{ + namespace Config_Handler + { + /** + * @class CPK_Handler + * + * @brief Handler class for type + * + * This class defines handler methods to parse Implementation + * Dependency types in the descriptor files. The corresponding + * CORBA IDL type for the schema element is returned. + * + */ + class Config_Handler_Export CPK_Handler + { + public: + static void process_CCMComponentPortKind (DOMNodeIterator * iter, + Deployment::CCMComponentPortKind &kind); + // process elements of type CCMComponentPortKind definitions in + // the descriptor files + + }; + } + +} + +#include /**/ "ace/post.h" + +#endif /* CPK_HANDLER_H */ diff --git a/TAO/CIAO/DAnCE/Config_Handlers/CPR_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/CPR_Handler.cpp new file mode 100644 index 00000000000..424e6246e28 --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/CPR_Handler.cpp @@ -0,0 +1,40 @@ +// $Id$ + +#include "tao/Exception.h" +#include "ace/Auto_Ptr.h" +#include "ace/Log_Msg.h" +#include "CPR_Handler.h" +#include "Utils.h" + +BEGIN_DEPLOYMENT_NAMESPACE + +/// handle the connection resource deployment description and populate it +void CPR_Handler::process_ComponentPackageReference +(::Deployment::ComponentPackageReference &cpr) +{ + for (DOMNode* node = this->iter_->nextNode(); + node != 0; + node = this->iter_->nextNode()) + { + XStr node_name (node->getNodeName()); + + if (false); + else if + (CIAO::Config_Handler::Utils::process_string + (this->iter_, node_name, "requiredUUID", + cpr.requiredUUID)); + else if + (CIAO::Config_Handler::Utils::process_string + (this->iter_, node_name, "requiredName", cpr.requiredName)); + else if + (CIAO::Config_Handler::Utils::process_string + (this->iter_, node_name, "requiredType", cpr.requiredType)); + else + { + this->iter_->previousNode (); + return; + } + } +} + +END_DEPLOYMENT_NAMESPACE diff --git a/TAO/CIAO/DAnCE/Config_Handlers/CPR_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/CPR_Handler.h new file mode 100644 index 00000000000..4d56f71a3ca --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/CPR_Handler.h @@ -0,0 +1,87 @@ +//================================================================== +/** + * @file CPR_Handler.h + * + * $Id$ + * + * @author Aniruddha S. Gokhale + */ +//===================================================================== +#ifndef CPR_HANDLER_H +#define CPR_HANDLER_H +#include /**/ "ace/pre.h" + +#include "DeploymentC.h" +#include "Config_Handler_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +#pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/SString.h" +#include +#include +#include "XercesString.h" + +#include "Basic_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::DOMText; +using xercesc::DOMNamedNodeMap; +using xercesc::DOMLocator; +using xercesc::DOMError; +using xercesc::DOMDocument; +using xercesc::DOMDocumentTraversal; +using xercesc::DOMNodeIterator; +using xercesc::DOMNode; +using xercesc::DOMNodeFilter; + +BEGIN_DEPLOYMENT_NAMESPACE + +/** + * @class CPR_Handler + * + * @brief Handler class for type + * + * This class is within the Execution Data Model subpackage of the + * Deployment & Configuration package. + * + * This class defines handler methods to parse the aforementioned type + * in the descriptor files. The corresponding CORBA IDL type for this + * element is returned. + */ + +class Config_Handler_Export CPR_Handler: public Basic_Handler +{ +public: + + /// constructor + CPR_Handler (DOMDocument* doc, unsigned long filter_) + : Basic_Handler (doc, filter_) { } + + /// constructor + CPR_Handler (DOMNodeIterator* iter, bool release = false) + : Basic_Handler (iter, release) { } + + /// constructor + CPR_Handler (DOMDocument* doc, DOMNodeIterator* iter, bool release = false) + : Basic_Handler (doc, iter, release) { } + + /// Process the component package reference + void process_ComponentPackageReference (::Deployment::ComponentPackageReference &cpr); + +}; + +END_DEPLOYMENT_NAMESPACE + +#include /**/ "ace/post.h" + +#endif /* CPR_HANDLER_H */ diff --git a/TAO/CIAO/DAnCE/Config_Handlers/Cap_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/Cap_Handler.cpp new file mode 100644 index 00000000000..d357bc03ec8 --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/Cap_Handler.cpp @@ -0,0 +1,57 @@ +//================================================================== +/** + * @file Cap_Handler.cpp + * + * $Id$ + * + * @author Emre Turkay + */ +//================================================================== + +#include "Cap_Handler.h" +#include "SP_Handler.h" +#include "tao/Exception.h" +#include "Utils.h" +#include +#include "string.h" +#include "Utils.h" +#include "Process_Element.h" + +BEGIN_DEPLOYMENT_NAMESPACE + +void +CAP_Handler::process_Capability (Deployment::Capability &cap) +{ + //Check if the Schema IDs for both the elements match + for (DOMNode* node = this->iter_->nextNode(); + node != 0; + node = this->iter_->nextNode()) + { + XStr node_name (node->getNodeName ()); + + if (node_name == XStr + (ACE_TEXT ("Deployment:Capability"))) + { + } + else if + (CIAO::Config_Handler::Utils::process_string + (this->iter_, node_name, "name", cap.name)); + else if + (CIAO::Config_Handler::Utils::process_string_seq + (this->iter_, node_name, "resourceType", + cap.resourceType)); + else if + (process_sequence_common + (this->doc_, this->iter_, node, + node_name, "property", cap.property, + &SP_Handler::process_SatisfierProperty, + this->id_map_)); + else + { + this->iter_->previousNode (); + break; + } + } +} + +END_DEPLOYMENT_NAMESPACE diff --git a/TAO/CIAO/DAnCE/Config_Handlers/Cap_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/Cap_Handler.h new file mode 100644 index 00000000000..2abfcf09deb --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/Cap_Handler.h @@ -0,0 +1,97 @@ +//================================================================== +/** + * @file Cap_Handler.h + * + * $Id$ + * + * @author Emre Turkay + */ +//================================================================== + +#ifndef CAP_HANDLER_H +#define CAP_HANDLER_H +#include /**/ "ace/pre.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 "ace/Auto_Ptr.h" +#include "ace/Log_Msg.h" +#include "ace/OS_main.h" +#include "tao/Exception.h" +#include "XercesString.h" +#include +#include +#include +#include +#include + +using Config_Handler::XStr; +using xercesc::XMLUni; +using xercesc::XMLUri; +using xercesc::XMLURL; +using xercesc::XMLString; +using xercesc::XMLException; +using xercesc::DOMException; +using xercesc::DOMBuilder; +using xercesc::DOMImplementationRegistry; +using xercesc::DOMImplementationLS; +using xercesc::DOMImplementation; +using xercesc::DOMInputSource; +using xercesc::DOMText; +using xercesc::DOMNamedNodeMap; +using xercesc::DOMLocator; +using xercesc::DOMError; +using xercesc::DOMDocument; +using xercesc::DOMDocumentTraversal; +using xercesc::DOMNodeIterator; +using xercesc::DOMNode; +using xercesc::DOMNodeFilter; +using xercesc::DOMNamedNodeMap; + +BEGIN_DEPLOYMENT_NAMESPACE + +/** + * @class CAP_Handler + * + * @brief Handler class for type + * + * This class defines handler methods to parse Capability + * types in the descriptor files. The corresponding + * CORBA IDL type for the schema element is returned. + * + */ +class Config_Handler_Export CAP_Handler: public Basic_Handler +{ +public: + + /// constructor + CAP_Handler (DOMDocument* doc, unsigned long filter_) + : Basic_Handler (doc, filter_) { } + + /// constructor + CAP_Handler (DOMNodeIterator* iter, bool release = false) + : Basic_Handler (iter, release) { } + + /// constructor + CAP_Handler (DOMDocument* doc, DOMNodeIterator* iter, bool release = false) + : Basic_Handler (doc, iter, release) { } + + void process_Capability (Deployment::Capability &ret_struct); + // process elements of type Capability definitions in + // the descriptor files +}; + +END_DEPLOYMENT_NAMESPACE + +#include /**/ "ace/post.h" + +#endif /* ID_HANDLER_H */ diff --git a/TAO/CIAO/DAnCE/Config_Handlers/CompImplDesc_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/CompImplDesc_Handler.cpp new file mode 100644 index 00000000000..afccc0c5f0b --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/CompImplDesc_Handler.cpp @@ -0,0 +1,98 @@ +// $Id$ + +#include "tao/Exception.h" +#include "ace/Auto_Ptr.h" +#include "ace/Log_Msg.h" +#include "Property_Handler.h" +#include "Requirement_Handler.h" +#include "CAD_Handler.h" +#include "MID_Handler.h" +#include "ID_Handler.h" +#include "Cap_Handler.h" +#include "CompIntrDesc_Handler.h" +#include "CompImplDesc_Handler.h" +#include "Utils.h" +#include "Process_Element.h" +#include + +BEGIN_DEPLOYMENT_NAMESPACE + +/// handle the component implementation description and populate it +void CompImplDesc_Handler::process_ComponentImplementationDescription + (::Deployment::ComponentImplementationDescription &cid) +{ + char* root_node_name_ch = XMLString::transcode + (this->doc_->getDocumentElement ()->getNodeName ()); + ACE_TString root_node_name (root_node_name_ch); + XMLString::release (&root_node_name_ch); + + for (DOMNode* node = this->iter_->nextNode(); + node != 0; + node = this->iter_->nextNode()) + { + XStr node_name (node->getNodeName()); + if (node_name == XStr + (ACE_TEXT ("Deployment:ComponentImplementationDescription"))) + { + } + else if + (CIAO::Config_Handler::Utils::process_string + (this->iter_, node_name, "label", cid.label)); + else if + (CIAO::Config_Handler::Utils::process_string + (this->iter_, node_name, "UUID", cid.UUID)); + else if + (process_element_remote + (this->doc_, this->iter_, node, + node_name, "implements", cid.implements, + &CompIntrDesc_Handler::process_ComponentInterfaceDescription, + this->id_map_)); + else if + (process_sequence_remote + (this->doc_, this->iter_, node, + node_name, "assemblyImpl", cid.assemblyImpl, + &CAD_Handler::process_ComponentAssemblyDescription, + this->id_map_)); + else if + (process_sequence_remote + (this->doc_, this->iter_, node, + node_name, "monolithicImpl", cid.monolithicImpl, + &MID_Handler::process_MonolithicImplementationDescription, + this->id_map_)); + else if + (process_sequence_common + (this->doc_, this->iter_, node, + node_name, "configProperty", cid.configProperty, + &Property_Handler::process_Property, + this->id_map_)); + else if + (process_sequence_remote + (this->doc_, this->iter_, node, + node_name, "capability", cid.capability, + &CAP_Handler::process_Capability, this->id_map_)); + else if + (process_sequence_common + (this->doc_, this->iter_, node, + node_name, "dependsOn", cid.dependsOn, + &ID_Handler::process_ImplementationDependency, + this->id_map_)); + else if + (process_sequence_common + (this->doc_, this->iter_, node, + node_name, "infoProperty", cid.infoProperty, + &Property_Handler::process_Property, + this->id_map_)); + else + { + this->iter_->previousNode (); + return; + } + } + return; +} + +END_DEPLOYMENT_NAMESPACE diff --git a/TAO/CIAO/DAnCE/Config_Handlers/CompImplDesc_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/CompImplDesc_Handler.h new file mode 100644 index 00000000000..c7918732628 --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/CompImplDesc_Handler.h @@ -0,0 +1,87 @@ +//================================================================== +/** + * @file CompImplDesc_Handler.h + * + * $Id$ + * + * @author Aniruddha S. Gokhale + */ +//===================================================================== +#ifndef CompImplDesc_HANDLER_H +#define CompImplDesc_HANDLER_H +#include /**/ "ace/pre.h" + +#include "ciao/DeploymentC.h" +#include "Config_Handler_export.h" +#include "Basic_Handler.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +#pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/SString.h" +#include +#include +#include "XercesString.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::DOMText; +using xercesc::DOMNamedNodeMap; +using xercesc::DOMLocator; +using xercesc::DOMError; +using xercesc::DOMDocument; +using xercesc::DOMDocumentTraversal; +using xercesc::DOMNodeIterator; +using xercesc::DOMNode; +using xercesc::DOMNodeFilter; + +BEGIN_DEPLOYMENT_NAMESPACE + +/** + * @class CompImplDesc_Handler + * + * @brief Handler class for type + * + * This class is within the Execution Data Model subpackage of the + * Deployment & Configuration package. + * + * This class defines handler methods to parse the aforementioned type + * in the description files. The corresponding CORBA IDL type for this + * element is returned. + */ + +class Config_Handler_Export CompImplDesc_Handler: public Basic_Handler +{ + public: + + /// constructor + CompImplDesc_Handler (DOMDocument* doc, unsigned long filter_) + : Basic_Handler (doc, filter_) { } + + /// constructor + CompImplDesc_Handler (DOMNodeIterator* iter, bool release = false) + : Basic_Handler (iter, release) { } + + /// constructor + CompImplDesc_Handler (DOMDocument* doc, + DOMNodeIterator* iter, bool release = false) + : Basic_Handler (doc, iter, release) { } + + /// Process the monolithic deployment description + void process_ComponentImplementationDescription (::Deployment::ComponentImplementationDescription &cid); + +}; + +END_DEPLOYMENT_NAMESPACE + +#include /**/ "ace/post.h" + +#endif /* CompImplDesc_HANDLER_H */ diff --git a/TAO/CIAO/DAnCE/Config_Handlers/CompIntrDesc_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/CompIntrDesc_Handler.cpp new file mode 100644 index 00000000000..25ca99733fc --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/CompIntrDesc_Handler.cpp @@ -0,0 +1,164 @@ +//$Id$ + +#ifndef CompIntrDesc_HANDLER_C +#define CompIntrDesc_HANDLER_C + +#include "tao/Exception.h" +#include "ace/Auto_Ptr.h" +#include "ace/Log_Msg.h" +#include "Utils.h" +#include "Process_Element.h" +#include "Property_Handler.h" +#include "CompIntrDesc_Handler.h" +#include "DT_Handler.h" +#include "CPK_Handler.h" +#include + +BEGIN_DEPLOYMENT_NAMESPACE + +/// handle the package configuration and populate it +void CompIntrDesc_Handler::process_ComponentInterfaceDescription +(::Deployment::ComponentInterfaceDescription &ccd) +{ + for (DOMNode* node = this->iter_->nextNode(); + node != 0; + node = this->iter_->nextNode()) + { + XStr node_name (node->getNodeName()); + + if (node_name == XStr + (ACE_TEXT ("Deployment:ComponentInterfaceDescription"))) + { + } + else if + (CIAO::Config_Handler::Utils::process_string + (this->iter_, node_name, "label", ccd.label)); + else if + (CIAO::Config_Handler::Utils::process_string + (this->iter_, node_name, "UUID", ccd.UUID)); + else if + (CIAO::Config_Handler::Utils::process_string + (this->iter_, node_name, "specificType", + ccd.specificType)); + else if + (CIAO::Config_Handler::Utils::process_string_seq + (this->iter_, node_name, "supportedType", + ccd.supportedType)); + else if + (CIAO::Config_Handler::Utils::process_string_seq + (this->iter_, node_name, "idlFile", ccd.idlFile)); + else if + (process_sequence_common + (this->doc_, this->iter_, node, + node_name, "configProperty", ccd.configProperty, + &Property_Handler::process_Property, + this->id_map_)); + else if + (process_sequence_local + (this->doc_, this->iter_, node, + node_name, "port", ccd.port, + this, &CompIntrDesc_Handler::process_port)); + else if + (process_sequence_local + (this->doc_, this->iter_, node, + node_name, "property", ccd.property, + this, &CompIntrDesc_Handler::process_comp_property)); + else if + (process_sequence_common + (this->doc_, this->iter_, node, + node_name, "infoProperty", ccd.infoProperty, + &Property_Handler::process_Property, + this->id_map_)); + else + { + this->iter_->previousNode (); + return; + } + } + return; +} + +/// process component property element +void CompIntrDesc_Handler::process_comp_property (DOMNodeIterator* iter, + Deployment:: + ComponentPropertyDescription& + property) +{ + for (DOMNode* node = iter->nextNode(); + node != 0; + node = iter->nextNode ()) + { + XStr node_name (node->getNodeName()); + + if (node_name == XStr + (ACE_TEXT ("Deployment:ComponentPropertyDescription"))) + { + } + else if (CIAO::Config_Handler::Utils::process_string + (iter, node_name, "name", property.name)); + else if (node_name == XStr (ACE_TEXT ("type"))) + { + int argc = 0; + char ** argv = 0; + CORBA::ORB_ptr orb = CORBA::ORB_init (argc, argv, ""); + DT_Handler::process_DataType (iter, property.type.out (), orb); + } + else + { + iter->previousNode(); + return; + } + } +} + +/// process port element +void CompIntrDesc_Handler::process_port (DOMNodeIterator* iter, + Deployment:: + ComponentPortDescription& port) +{ + for (DOMNode* node = iter->nextNode(); + node != 0; + node = iter->nextNode ()) + { + XStr node_name (node->getNodeName()); + + if (node_name == XStr + (ACE_TEXT ("Deployment:ComponentPortDescription"))) + { + } + else if (CIAO::Config_Handler::Utils::process_string + (iter, node_name, "name", port.name)); + else if + (CIAO::Config_Handler::Utils::process_string + (iter, node_name, "specificType", port.specificType)); + else if + (CIAO::Config_Handler::Utils::process_string_seq + (iter, node_name, "supportedType", port.supportedType)); + else if + (CIAO::Config_Handler::Utils::process_boolean + (iter, node_name, "provider", port.provider)); + else if + (CIAO::Config_Handler::Utils::process_boolean + (iter, node_name, "exclusiveProvider", + port.exclusiveProvider)); + else if + (CIAO::Config_Handler::Utils::process_boolean + (iter, node_name, "exclusiveUser", port.exclusiveUser)); + else if + (CIAO::Config_Handler::Utils::process_boolean + (iter, node_name, "optional", port.optional)); + else if (node_name == XStr(ACE_TEXT("kind"))) + { + CPK_Handler::process_CCMComponentPortKind (iter, port.kind); + } + else + { + iter->previousNode(); + return; + } + } +} + +END_DEPLOYMENT_NAMESPACE + +#endif /* CompIntrDesc_HANDLER_C */ diff --git a/TAO/CIAO/DAnCE/Config_Handlers/CompIntrDesc_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/CompIntrDesc_Handler.h new file mode 100644 index 00000000000..7932ebd4b30 --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/CompIntrDesc_Handler.h @@ -0,0 +1,89 @@ +//$Id$ + +#ifndef COMPINTRDESC_HANDLER_H +#define COMPINTRDESC_HANDLER_H +#include /**/ "ace/pre.h" + +#include "DeploymentC.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" +#include "tao/Exception.h" +#include "XercesString.h" +#include +#include +#include +#include +#include + +#include "Basic_Handler.h" + +using Config_Handler::XStr; +using xercesc::XMLUni; +using xercesc::XMLUri; +using xercesc::XMLURL; +using xercesc::XMLString; +using xercesc::XMLException; +using xercesc::DOMException; +using xercesc::DOMBuilder; +using xercesc::DOMImplementationRegistry; +using xercesc::DOMImplementationLS; +using xercesc::DOMImplementation; +using xercesc::DOMInputSource; +using xercesc::DOMText; +using xercesc::DOMNamedNodeMap; +using xercesc::DOMLocator; +using xercesc::DOMError; +using xercesc::DOMDocument; +using xercesc::DOMDocumentTraversal; +using xercesc::DOMNodeIterator; +using xercesc::DOMNode; +using xercesc::DOMNodeFilter; +using xercesc::DOMNamedNodeMap; + +BEGIN_DEPLOYMENT_NAMESPACE + +class Config_Handler_Export CompIntrDesc_Handler: public Basic_Handler +{ +public: + + /// constructor + CompIntrDesc_Handler (DOMDocument* doc, unsigned long filter_) + : Basic_Handler (doc, filter_) { } + + /// constructor + CompIntrDesc_Handler (DOMNodeIterator* iter, bool release = false) + : Basic_Handler (iter, release) { }; + + /// constructor + CompIntrDesc_Handler (DOMDocument* doc, + DOMNodeIterator* iter, bool release = false) + : Basic_Handler (doc, iter, release) { }; + + /// Process the component package description + void process_ComponentInterfaceDescription (::Deployment::ComponentInterfaceDescription &CompIntrDesc); + +protected: + /// process port element + void process_port (DOMNodeIterator* iter, + Deployment::ComponentPortDescription& port); + + /// process component property element + void process_comp_property (DOMNodeIterator* iter, + Deployment::ComponentPropertyDescription& property); +}; + +END_DEPLOYMENT_NAMESPACE + +#include /**/ "ace/post.h" + +#endif // COMPINTRDESC_HANDLER_H diff --git a/TAO/CIAO/DAnCE/Config_Handlers/CompPkgDesc_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/CompPkgDesc_Handler.cpp new file mode 100644 index 00000000000..c60201535cb --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/CompPkgDesc_Handler.cpp @@ -0,0 +1,75 @@ +// $Id$ + +#ifndef COMPPKGDESC_HANDLER_C +#define COMPPKGDESC_HANDLER_C + +#include "tao/Exception.h" +#include "ace/Auto_Ptr.h" +#include "ace/Log_Msg.h" +#include "Utils.h" +#include "CompPkgDesc_Handler.h" +#include "Property_Handler.h" +#include "PCI_Handler.h" +#include "CompIntrDesc_Handler.h" +#include "Process_Element.h" +#include + +BEGIN_DEPLOYMENT_NAMESPACE + +/// handle the package configuration and populate it +void CompPkgDesc_Handler::process_ComponentPackageDescription +(::Deployment::ComponentPackageDescription &comppkgdesc) +{ + for (DOMNode* node = this->iter_->nextNode(); + node != 0; + node = this->iter_->nextNode()) + { + XStr node_name (node->getNodeName()); + + if (node_name == XStr + (ACE_TEXT ("Deployment:ComponentPackageDescription"))) + { + } + else if + (CIAO::Config_Handler::Utils::process_string + (this->iter_, node_name, "label", comppkgdesc.label)); + else if + (CIAO::Config_Handler::Utils::process_string + (this->iter_, node_name, "UUID", comppkgdesc.UUID)); + else if + (process_element_remote + (this->doc_, this->iter_, node, + node_name, "realizes", comppkgdesc.realizes, + &CompIntrDesc_Handler::process_ComponentInterfaceDescription, + this->id_map_)); + else if + (process_sequence_common + (this->doc_, this->iter_, node, + node_name, "configProperty", comppkgdesc.configProperty, + &Property_Handler::process_Property, + this->id_map_)); + else if + (process_sequence_remote + (this->doc_, this->iter_, node, + node_name, "implementation", comppkgdesc.implementation, + &PCI_Handler::process_PackagedComponentImplementation, + this->id_map_)); + else if + (process_sequence_common + (this->doc_, this->iter_, node, + node_name, "infoProperty", comppkgdesc.infoProperty, + &Property_Handler::process_Property, + this->id_map_)); + else + { + this->iter_->previousNode (); + return; + } + } +} + +END_DEPLOYMENT_NAMESPACE + +#endif /* COMPPKGDESC_HANDLER_C */ diff --git a/TAO/CIAO/DAnCE/Config_Handlers/CompPkgDesc_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/CompPkgDesc_Handler.h new file mode 100644 index 00000000000..202afca9b2c --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/CompPkgDesc_Handler.h @@ -0,0 +1,88 @@ +//================================================================== +/** + * @file CompPkgDesc_Handler.h + * + * $Id$ + * + * @author George Edwards + */ +//===================================================================== + +#ifndef COMPPKGDESC_HANDLER_H +#define COMPPKGDESC_HANDLER_H +#include /**/ "ace/pre.h" + +#include "DeploymentC.h" +#include "Config_Handler_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +#pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/SString.h" +#include +#include +#include "XercesString.h" +#include "Basic_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::DOMText; +using xercesc::DOMNamedNodeMap; +using xercesc::DOMLocator; +using xercesc::DOMError; +using xercesc::DOMDocument; +using xercesc::DOMDocumentTraversal; +using xercesc::DOMNodeIterator; +using xercesc::DOMNode; +using xercesc::DOMNodeFilter; + +BEGIN_DEPLOYMENT_NAMESPACE + +/** + * @class CompPkgDesc_Handler + * + * @brief Handler class for type + * + * This class is within the Component Data Model subpackage of the + * Deployment & Configuration package. + * + * This class defines handler methods to parse the aforementioned type + * in the description files. The corresponding CORBA IDL type for this + * element is returned. + */ + +class Config_Handler_Export CompPkgDesc_Handler: public Basic_Handler +{ +public: + + /// constructor + CompPkgDesc_Handler (DOMDocument* doc, unsigned long filter_) + : Basic_Handler (doc, filter_) { } + + /// constructor + CompPkgDesc_Handler (DOMNodeIterator* iter, bool release = false) + : Basic_Handler (iter, release) { } + + /// constructor + CompPkgDesc_Handler (DOMDocument* doc, + DOMNodeIterator* iter, bool release = false) + : Basic_Handler (doc, iter, release) { } + + /// Process the component package description + void process_ComponentPackageDescription (::Deployment::ComponentPackageDescription &comppkgdesc); + +}; + +END_DEPLOYMENT_NAMESPACE + +#include /**/ "ace/post.h" + +#endif /* COMPPKGDESC_HANDLER_H */ diff --git a/TAO/CIAO/DAnCE/Config_Handlers/Config_Error_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/Config_Error_Handler.cpp new file mode 100644 index 00000000000..de938a2ce0e --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/Config_Error_Handler.cpp @@ -0,0 +1,63 @@ +// $Id$ + +#include "ace/Log_Msg.h" +#include "ace/Auto_Ptr.h" +#include +#include +#include "Config_Error_Handler.h" +#include "XercesString.h" + +using xercesc::XMLString; + +namespace CIAO +{ + namespace Config_Handler + { + Config_Error_Handler::Config_Error_Handler() + : errors_ (false) + {} + + Config_Error_Handler::~Config_Error_Handler() + {} + + + bool Config_Error_Handler::handleError (const DOMError& domError) + { + this->errors_ = true; + if (domError.getSeverity() == DOMError::DOM_SEVERITY_WARNING) + { + ACE_ERROR ((LM_ERROR, "Warning ")); + } + else if (domError.getSeverity() == DOMError::DOM_SEVERITY_ERROR) + { + ACE_ERROR ((LM_ERROR, "Error ")); + } + else + { + ACE_ERROR ((LM_ERROR, "FatalError ")); + } + + char *msg = XMLString::transcode(domError.getMessage()); + char *url = XMLString::transcode (domError.getLocation()->getURI()); + ACE_Auto_Basic_Array_Ptr cleanup_msg (msg); + ACE_ERROR ((LM_ERROR, "while processing resource '%s', " + "Line %d, Position %d : %s\n", + url, + domError.getLocation()->getLineNumber(), + domError.getLocation()->getColumnNumber(), + msg)); + return true; + } + + void Config_Error_Handler::resetErrors() + { + this->errors_ = false; + } + + bool Config_Error_Handler::getErrors() const + { + return this->errors_; + } + } + +} diff --git a/TAO/CIAO/DAnCE/Config_Handlers/Config_Error_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/Config_Error_Handler.h new file mode 100644 index 00000000000..4c039938d90 --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/Config_Error_Handler.h @@ -0,0 +1,50 @@ +// $Id$ + +#ifndef CONFIG_ERROR_HANDLER_H +#define CONFIG_ERROR_HANDLER_H + +#include /**/ "ace/pre.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +#pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include +#include "Config_Handler_export.h" + +using xercesc::DOMErrorHandler; +using xercesc::DOMError; + +namespace CIAO +{ + namespace Config_Handler + { + class Config_Handler_Export Config_Error_Handler : public DOMErrorHandler + { + public: + + Config_Error_Handler (); + + ~Config_Error_Handler (); + + bool handleError (const DOMError& domError); + + void resetErrors (); + + bool getErrors() const; + + private : + // Disallow copying + Config_Error_Handler (const Config_Error_Handler&); + Config_Error_Handler& operator= (const Config_Error_Handler&); + + bool errors_; + + }; + + }; +} + +#include /**/ "ace/post.h" + +#endif /* CONFIG_ERROR_HANDLER_H */ diff --git a/TAO/CIAO/DAnCE/Config_Handlers/Config_Handler_export.h b/TAO/CIAO/DAnCE/Config_Handlers/Config_Handler_export.h new file mode 100644 index 00000000000..0c9beba35b9 --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/Config_Handler_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl -s Config_Handler +// ------------------------------ +#ifndef CONFIG_HANDLER_EXPORT_H +#define CONFIG_HANDLER_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (CONFIG_HANDLER_HAS_DLL) +# define CONFIG_HANDLER_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && CONFIG_HANDLER_HAS_DLL */ + +#if !defined (CONFIG_HANDLER_HAS_DLL) +# define CONFIG_HANDLER_HAS_DLL 1 +#endif /* ! CONFIG_HANDLER_HAS_DLL */ + +#if defined (CONFIG_HANDLER_HAS_DLL) && (CONFIG_HANDLER_HAS_DLL == 1) +# if defined (CONFIG_HANDLER_BUILD_DLL) +# define Config_Handler_Export ACE_Proper_Export_Flag +# define CONFIG_HANDLER_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define CONFIG_HANDLER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* CONFIG_HANDLER_BUILD_DLL */ +# define Config_Handler_Export ACE_Proper_Import_Flag +# define CONFIG_HANDLER_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define CONFIG_HANDLER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* CONFIG_HANDLER_BUILD_DLL */ +#else /* CONFIG_HANDLER_HAS_DLL == 1 */ +# define Config_Handler_Export +# define CONFIG_HANDLER_SINGLETON_DECLARATION(T) +# define CONFIG_HANDLER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* CONFIG_HANDLER_HAS_DLL == 1 */ + +// Set CONFIG_HANDLER_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (CONFIG_HANDLER_NTRACE) +# if (ACE_NTRACE == 1) +# define CONFIG_HANDLER_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define CONFIG_HANDLER_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !CONFIG_HANDLER_NTRACE */ + +#if (CONFIG_HANDLER_NTRACE == 1) +# define CONFIG_HANDLER_TRACE(X) +#else /* (CONFIG_HANDLER_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define CONFIG_HANDLER_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (CONFIG_HANDLER_NTRACE == 1) */ + +#endif /* CONFIG_HANDLER_EXPORT_H */ + +// End of auto generated file. diff --git a/TAO/CIAO/DAnCE/Config_Handlers/Config_Handlers.mpc b/TAO/CIAO/DAnCE/Config_Handlers/Config_Handlers.mpc new file mode 100644 index 00000000000..54c692644b8 --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/Config_Handlers.mpc @@ -0,0 +1,47 @@ +//$Id$ + +project (Config_Handlers) : ciao_deployment_stub { + + sharedname = Config_Handlers + dynamicflags = CONFIG_HANDLER_BUILD_DLL + macros += XML_USE_PTHREADS + includes += /usr/include $(XERCESCROOT)/include + libpaths += /usr/lib $(XERCESCROOT)/lib + libs += xerces-c CIAO_DnC_Server TAO_IFR_Client + + Source_Files { + Utils.cpp + Any_Handler.cpp + Basic_Handler.cpp + CAD_Handler.cpp + Cap_Handler.cpp + CEPE_Handler.cpp + CompImplDesc_Handler.cpp + CompIntrDesc_Handler.cpp + CompPkgDesc_Handler.cpp + Config_Error_Handler.cpp + CPK_Handler.cpp + CPR_Handler.cpp + DnC_Dump.cpp + Domain_Handler.cpp + DT_Handler.cpp + ERE_Handler.cpp + IAD_Handler.cpp + ID_Handler.cpp + IR_Handler.cpp + MID_Handler.cpp + NIA_Handler.cpp + PC_Handler.cpp + PCI_Handler.cpp + Plan_Handler.cpp + Process_Element.cpp + Property_Handler.cpp + Requirement_Handler.cpp + RS_Handler.cpp + RUK_Handler.cpp + SP_Handler.cpp + SPK_Handler.cpp + TPD_Handler.cpp + XercesString.cpp + } +} diff --git a/TAO/CIAO/DAnCE/Config_Handlers/DT_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/DT_Handler.cpp new file mode 100644 index 00000000000..7840e86caa2 --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/DT_Handler.cpp @@ -0,0 +1,103 @@ +//$Id$ + +#include "DT_Handler.h" +#include "tao/Typecode.h" +#include "ace/Auto_Ptr.h" +#include "Utils.h" + +void +CIAO::Config_Handler::DT_Handler::process_basic_tc (DOMNodeIterator * iter, + ::CORBA::TypeCode_ptr &type) +{ + + // For all types defined return the appropriate typecode + char * code_value = Utils::parse_string (iter); + auto_ptr cleanup_char (code_value); + + // For this piece of code to work, it is necessary that ORB_init + // be called by the top level handler which calls the + // process_DataType common handler. + if (ACE_OS::strcmp (code_value, + "tk_null") == 0) + type = CORBA::TypeCode::_duplicate (CORBA::_tc_null); + else if (ACE_OS::strcmp (code_value, + "tk_short") == 0) + type = CORBA::TypeCode::_duplicate (CORBA::_tc_short); + else if (ACE_OS::strcmp (code_value, + "tk_long") == 0) + type = CORBA::TypeCode::_duplicate (CORBA::_tc_long); + else if (ACE_OS::strcmp (code_value, + "tk_ushort") == 0) + type = CORBA::TypeCode::_duplicate (CORBA::_tc_ushort); + else if (ACE_OS::strcmp (code_value, + "tk_ulong") == 0) + type = CORBA::TypeCode::_duplicate (CORBA::_tc_ulong); + else if (ACE_OS::strcmp (code_value, + "tk_float") == 0) + type = CORBA::TypeCode::_duplicate (CORBA::_tc_float); + else if (ACE_OS::strcmp (code_value, + "tk_double") == 0) + type = CORBA::TypeCode::_duplicate (CORBA::_tc_double); + else if (ACE_OS::strcmp (code_value, + "tk_boolean") == 0) + type = CORBA::TypeCode::_duplicate (CORBA::_tc_boolean); + else if (ACE_OS::strcmp (code_value, + "tk_char") == 0) + type = CORBA::TypeCode::_duplicate (CORBA::_tc_char); + else if (ACE_OS::strcmp (code_value, + "tk_octet") == 0) + type = CORBA::TypeCode::_duplicate (CORBA::_tc_octet); + else if (ACE_OS::strcmp (code_value, + "tk_string") == 0) + type = CORBA::TypeCode::_duplicate (CORBA::_tc_string); + else if (ACE_OS::strcmp (code_value, + "tk_longlong") == 0) + type = CORBA::TypeCode::_duplicate (CORBA::_tc_longlong); + else if (ACE_OS::strcmp (code_value, + "tk_ulonglong") == 0) + type = CORBA::TypeCode::_duplicate (CORBA::_tc_ulonglong); + else if (ACE_OS::strcmp (code_value, + "tk_longdouble") == 0) + type = CORBA::TypeCode::_duplicate (CORBA::_tc_longdouble); + else if (ACE_OS::strcmp (code_value, + "tk_wchar") == 0) + type = CORBA::TypeCode::_duplicate (CORBA::_tc_wchar); + else if (ACE_OS::strcmp (code_value, + "tk_wstring") == 0) + type = CORBA::TypeCode::_duplicate (CORBA::_tc_wstring); + else if (ACE_OS::strcmp (code_value, + "tk_any") == 0) + type = CORBA::TypeCode::_duplicate (CORBA::_tc_any); + else if (ACE_OS::strcmp (code_value, + "tk_TypeCode") == 0) + type = CORBA::TypeCode::_duplicate (CORBA::_tc_TypeCode); + else if (ACE_OS::strcmp (code_value, + "tk_Object") == 0) + type = CORBA::TypeCode::_duplicate (CORBA::_tc_Object); + else + { + ACE_DEBUG ((LM_DEBUG, "Config_Handlers::DT_Handler::process_Datatype \ + unsupported TCkind value %s encountered \ + abortingi\n", type)); + ACE_THROW (CORBA::INTERNAL ()); + } +} + +void +CIAO::Config_Handler::DT_Handler::process_DataType (DOMNodeIterator * iter, + ::CORBA::TypeCode_ptr &type, + ::CORBA::ORB_ptr ) +{ + DOMNode * node = iter->nextNode (); + XStr name (node->getNodeName ()); + if (name == XStr (ACE_TEXT ("kind"))) + DT_Handler::process_basic_tc (iter, type); + else + { + ACE_DEBUG ((LM_DEBUG, "Config_Handlers::Property_Handler::process_ \ + DataType supports only TCKind types\ + support for recursive types will be added later\n")); + ACE_THROW (CORBA::INTERNAL ()); + + } +} diff --git a/TAO/CIAO/DAnCE/Config_Handlers/DT_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/DT_Handler.h new file mode 100644 index 00000000000..faac487e828 --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/DT_Handler.h @@ -0,0 +1,68 @@ +//================================================================== +/** + * @file DT_Handler.h + * + * $Id$ + * + * @author Arvind S. Krishna + */ +//===================================================================== + +#ifndef DT_HANDLER_H +#define DT_HANDLER_H +#include /**/ "ace/pre.h" + +#include "DeploymentC.h" +#include "Config_Handler_export.h" +#include "tao/ORB.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +#pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include +#include +#include "XercesString.h" + +using Config_Handler::XStr; +using xercesc::XMLString; +using xercesc::DOMImplementation; +using xercesc::DOMText; +using xercesc::DOMNodeIterator; +using xercesc::DOMNode; + +namespace CIAO +{ + namespace Config_Handler + { + /** + * @class DT_Handler + * + * @brief Handler class for tag + * + * This class defines handler methods to parse the aforementioned type + * in the descriptor files. The corresponding CORBA IDL mapped type in this + * a CORBA::Typecode is created and returned. Dynamic creation of typecodes + * also requires operations defined on the ORB interface, hence the + * process_DataType requires an ORB_ptr as a formal parameter. + */ + + class Config_Handler_Export DT_Handler + { + public: + static void process_DataType (DOMNodeIterator * iter, + ::CORBA::TypeCode_ptr &type, + ::CORBA::ORB_ptr orb); + // process definitions in the descriptor files + private: + static void process_basic_tc (DOMNodeIterator * iter, + ::CORBA::TypeCode_ptr &type); + // process definitions in the descriptor + // files + }; + } +} + +#include /**/ "ace/post.h" + +#endif /* DT_HANDLER_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 + */ +//===================================================================== + +#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.cpp b/TAO/CIAO/DAnCE/Config_Handlers/DnC_Dump.cpp new file mode 100644 index 00000000000..e0f0fc87c36 --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/DnC_Dump.cpp @@ -0,0 +1,1049 @@ +// $Id$ + +#ifndef DNC_DUMP_C +#define DNC_DUMP_C + +#include "ace/Log_Msg.h" + +#include "DnC_Dump.h" +#include +#include +#include + +namespace Deployment +{ +#ifndef ACE_HAS_BROKEN_NESTED_TEMPLATES + /* + * Generic dump functions + */ + + /* + * class Dump_Obj handles the indentation and keeps a map of + structures for reference look-up. + */ + class Dump_Obj { + public: + // Exception thrown when there is a node with the same name in the map + class Node_Exist { }; + // Exception thrown when there is no node with the name given in the map + class Node_Not_Exist { }; + + // Constructor prints out the caption and increases indent + Dump_Obj(const char* caption) + : desc_() + { + ACE_DEBUG ((LM_DEBUG, "%s%s:\n", indent_.c_str(), caption)); + indent_.append(" "); + } + + // Constructor prints out the caption, increases indent and inserts + // the given desc into the map + template + Dump_Obj(const char* caption, DESC &desc) + : desc_(caption) + { + ACE_DEBUG ((LM_DEBUG, "%s%s:\n", indent_.c_str(), caption)); + indent_.append(" "); + + if (desc_map_.find(std::string(caption)) != desc_map_.end()) + { + ACE_DEBUG ((LM_DEBUG, "DnC_Dump.cpp:Dump_Obj - \ + The item with name %s is already in \ + the node map.\n", caption)); + throw Node_Exist(); + } + else + { + CORBA::Any val; + val <<= desc; + desc_map_[std::string(caption)] = val; + } + } + + // Destructor + ~Dump_Obj() + { + indent_.erase(indent_.size() - 2, 2); + if (desc_.size() != 0) + { + if (desc_map_.find(desc_) != desc_map_.end()) + { + desc_map_.erase(desc_map_.find(desc_)); + } + else + { + ACE_DEBUG ((LM_DEBUG, "DnC_Dump.cpp:Dump_Obj - \ + The item with name %s is not in the node map.\n", + desc_.c_str())); + throw Node_Not_Exist(); + } + } + } + + // return the indent string + static const char* indent() + { + return indent_.c_str(); + } + + // reference lookup within the map + template + static const DESC& desc(const char* caption) + { + static DESC* val; + desc_map_[caption] >>= val; + return *val; + } + + private: + // indent string + static std::string indent_; + // map for reference lookup + static std::map desc_map_; + // descriptor - used by destructor for deleting the + // correct descriptor from the map + std::string desc_; + }; + + // static member initialization + std::string Dump_Obj::indent_ = "-"; + std::map Dump_Obj::desc_map_; + + // Dumps a string sequence + void DnC_Dump::dump (const char* caption, const ::CORBA::StringSeq &str_seq) + { + CORBA::ULong size = str_seq.length (); + + if (size != 0) + { + Dump_Obj dump_obj (caption); + + for (CORBA::ULong i = 0; i < size; ++i) + { + ACE_DEBUG ((LM_DEBUG, "%s%s %d: \n", + Dump_Obj::indent(), caption, i)); + ACE_DEBUG ((LM_DEBUG, "%s %s: \n", + Dump_Obj::indent(), str_seq[i].in ())); + } + } + } + + // Dumps a sequence + template + void DnC_Dump::dump_sequence (const char* caption, const SEQUENCE &seq) + { + CORBA::ULong size = seq.length (); + + if (size != 0) + { + Dump_Obj dump_obj(caption); + + for (CORBA::ULong i = 0; i < size; ++i) + { + ACE_DEBUG ((LM_DEBUG, "%s%s %d: \n", Dump_Obj::indent(), + caption, i)); + DnC_Dump::dump (seq[i]); + } + } + } + + // Dumps a string + void DnC_Dump::dump (const char* caption, const TAO_String_Manager& str) + { + ACE_DEBUG ((LM_DEBUG, "%s%s: %s\n", Dump_Obj::indent(), + caption, str.in())); + } + + // Dumps a boolean + void DnC_Dump::dump (const char* caption, const CORBA::Boolean& val) + { + ACE_DEBUG ((LM_DEBUG, "%s%s: %s\n", Dump_Obj::indent(), + caption, val ? "true" : "false")); + } + + // Dumps a reference + template + void DnC_Dump::dump_ref (const char* caption, REFERENCE& ref, + const char* root, DATA_TYPE CLASS::*data) + { + ACE_DEBUG ((LM_DEBUG, "%s%s:\n", Dump_Obj::indent(), caption)); + const ROOT &root_obj = Dump_Obj::desc(root); + + int value = ref; + ACE_DEBUG ((LM_DEBUG, "%s%s.name: %s\n", + Dump_Obj::indent(), caption, + (root_obj.*data)[value].name.in())); + } + + // Dumps a reference sequence + template + void DnC_Dump::dump_ref_seq (const char* caption, SEQUENCE& seq, + const char* root, DATA_TYPE CLASS::*data) + { + ACE_DEBUG ((LM_DEBUG, "%s%s:\n", Dump_Obj::indent(), caption)); + for (size_t i = 0; i < seq.length(); ++i) + { + const ROOT &root_obj = Dump_Obj::desc(root); + + int value = seq[i]; + ACE_DEBUG ((LM_DEBUG, "%s%s[%d].name: %s\n", + Dump_Obj::indent(), caption, i, + (root_obj.*data)[value].name.in())); + } + } + + /* + * Object dump methods + */ + + // SatisfierProperty + void DnC_Dump::dump (const Deployment::SatisfierProperty& sp) + { + Dump_Obj dump_obj("SatisfierProperty"); + dump ("name", sp.name); + + ACE_DEBUG ((LM_DEBUG, "%skind: ", Dump_Obj::indent())); + switch (sp.kind) { + case Quantity: ACE_DEBUG ((LM_DEBUG, "Quantity\n")); break; + case Capacity: ACE_DEBUG ((LM_DEBUG, "Capacity\n")); break; + case Minimum: ACE_DEBUG ((LM_DEBUG, "Minimum\n")); break; + case Maximum: ACE_DEBUG ((LM_DEBUG, "Maximum\n")); break; + case Attribute: ACE_DEBUG ((LM_DEBUG, "Attribute\n")); break; + case Selection: ACE_DEBUG ((LM_DEBUG, "Selection\n")); break; + } + + ACE_DEBUG ((LM_DEBUG, "%svalue:\n", Dump_Obj::indent())); + dump (sp.value); + } + + // SharedResource + void DnC_Dump::dump (const Deployment::SharedResource& sr) + { + Dump_Obj dump_obj("SharedResource"); + dump ("name", sr.name); + dump ("resourceType", sr.resourceType); + dump_ref_seq ("nodeRef", sr.nodeRef, + "Domain", &Domain::node); + dump_sequence ("property", sr.property); + } + + // Resource + void DnC_Dump::dump (const Deployment::Resource& resource) + { + Dump_Obj dump_obj("Resource"); + dump ("name", resource.name); + dump ("resourceType", resource.resourceType); + dump_sequence ("property", resource.property); + } + + // Node + void DnC_Dump::dump (const Deployment::Node& node) + { + Dump_Obj dump_obj("Node"); + dump ("name", node.name); + dump ("label", node.label); + dump_ref_seq ("sharedResourceRef", + node.sharedResourceRef, "Domain", + &Domain::sharedResource); + dump_ref_seq ("connectionRef", node.connectionRef, + "Domain", &Domain::interconnect); + dump_sequence ("resource", node.resource); + } + + // Interconnect + void DnC_Dump::dump (const Deployment::Interconnect& conn) + { + Dump_Obj dump_obj("Interconnect"); + dump ("name", conn.name); + dump ("label", conn.label); + dump_ref_seq ("connectionRef", conn.connectionRef, + "Domain", &Domain::bridge); + dump_ref_seq ("connectRef", conn.connectRef, + "Domain", &Domain::node); + dump_sequence ("resource", conn.resource); + } + + // Bridge + void DnC_Dump::dump (const Deployment::Bridge& bridge) + { + Dump_Obj dump_obj("Bridge"); + dump ("name", bridge.name); + dump ("label", bridge.label); + dump_ref_seq ("connectRef", bridge.connectRef, + "Domain", &Domain::interconnect); + dump_sequence ("resource", bridge.resource); + } + + void DnC_Dump::dump (const ::Deployment::Domain &domain) + { + Dump_Obj dump_obj("Domain", domain); + dump ("UUID", domain.UUID); + dump ("label", domain.label); + + dump_sequence ("sharedResource", domain.sharedResource); + dump_sequence ("node", domain.node); + dump_sequence ("interconnect", domain.interconnect); + dump_sequence ("bridge", domain.bridge); + dump_sequence ("infoProperty", domain.infoProperty); + } + + // ComponentPortDescription + + void DnC_Dump::dump (const ::Deployment::ComponentPortDescription + &compportdesc) + { + Dump_Obj dump_obj("ComponentPortDescription"); + + dump ("name", compportdesc.name); + dump ("specificType", compportdesc.specificType); + dump ("supportedType", compportdesc.supportedType); + dump ("provider", compportdesc.provider); + dump ("exclusiveProvider", compportdesc.exclusiveProvider); + dump ("exclusiveUser", compportdesc.exclusiveUser); + dump ("optional", compportdesc.optional); + + ACE_DEBUG ((LM_DEBUG, "%skind: ", Dump_Obj::indent())); + switch (compportdesc.kind) { + case Facet: ACE_DEBUG ((LM_DEBUG, "Facet\n")); break; + case SimplexReceptacle: ACE_DEBUG ((LM_DEBUG, "SimplexReceptacle\n")); break; + case MultiplexReceptacle: ACE_DEBUG ((LM_DEBUG, "MultiplexReceptacle\n")); break; + case EventEmitter: ACE_DEBUG ((LM_DEBUG, "EventEmitter\n")); break; + case EventPublisher: ACE_DEBUG ((LM_DEBUG, "EventPublisher\n")); break; + case EventConsumer: ACE_DEBUG ((LM_DEBUG, "EventConsumer\n")); break; + } + } + + // ComponentPropertyDescription + + void DnC_Dump::dump (const ::Deployment::ComponentPropertyDescription &comppropdesc) + { + Dump_Obj dump_obj("ComponentPropertyDescription"); + + dump ("name", comppropdesc.name); + + ACE_DEBUG ((LM_DEBUG, "%stype: ", Dump_Obj::indent())); + switch (comppropdesc.type.in()->kind()) { + case ::CORBA::tk_null: ACE_DEBUG ((LM_DEBUG, "tk_null\n")); break; + case ::CORBA::tk_void: ACE_DEBUG ((LM_DEBUG, "tk_void\n")); break; + case ::CORBA::tk_short: ACE_DEBUG ((LM_DEBUG, "tk_short\n")); break; + case ::CORBA::tk_long: ACE_DEBUG ((LM_DEBUG, "tk_long\n")); break; + case ::CORBA::tk_ushort: ACE_DEBUG ((LM_DEBUG, "tk_ushort\n")); break; + case ::CORBA::tk_ulong: ACE_DEBUG ((LM_DEBUG, "tk_ulong\n")); break; + case ::CORBA::tk_float: ACE_DEBUG ((LM_DEBUG, "tk_float\n")); break; + case ::CORBA::tk_double: ACE_DEBUG ((LM_DEBUG, "tk_double\n")); break; + case ::CORBA::tk_boolean: ACE_DEBUG ((LM_DEBUG, "tk_boolean\n")); break; + case ::CORBA::tk_char: ACE_DEBUG ((LM_DEBUG, "tk_char\n")); break; + case ::CORBA::tk_octet: ACE_DEBUG ((LM_DEBUG, "tk_octet\n")); break; + case ::CORBA::tk_any: ACE_DEBUG ((LM_DEBUG, "tk_any\n")); break; + case ::CORBA::tk_TypeCode: ACE_DEBUG ((LM_DEBUG, "tk_TypeCode\n")); break; + case ::CORBA::tk_Principal: ACE_DEBUG ((LM_DEBUG, "tk_Principal\n")); break; + case ::CORBA::tk_objref: ACE_DEBUG ((LM_DEBUG, "tk_objref\n")); break; + case ::CORBA::tk_struct: ACE_DEBUG ((LM_DEBUG, "tk_struct\n")); break; + case ::CORBA::tk_union: ACE_DEBUG ((LM_DEBUG, "tk_union\n")); break; + case ::CORBA::tk_enum: ACE_DEBUG ((LM_DEBUG, "tk_enum\n")); break; + case ::CORBA::tk_string: ACE_DEBUG ((LM_DEBUG, "tk_string\n")); break; + case ::CORBA::tk_sequence: ACE_DEBUG ((LM_DEBUG, "tk_sequence\n")); break; + case ::CORBA::tk_array: ACE_DEBUG ((LM_DEBUG, "tk_array\n")); break; + case ::CORBA::tk_alias: ACE_DEBUG ((LM_DEBUG, "tk_alias\n")); break; + case ::CORBA::tk_except: ACE_DEBUG ((LM_DEBUG, "tk_except\n")); break; + case ::CORBA::tk_longlong: ACE_DEBUG ((LM_DEBUG, "tk_longlong\n")); break; + case ::CORBA::tk_ulonglong: ACE_DEBUG ((LM_DEBUG, "tk_ulonglong\n")); break; + case ::CORBA::tk_longdouble: ACE_DEBUG ((LM_DEBUG, "tk_longdouble\n")); break; + case ::CORBA::tk_wchar: ACE_DEBUG ((LM_DEBUG, "tk_wchar\n")); break; + case ::CORBA::tk_wstring: ACE_DEBUG ((LM_DEBUG, "tk_wstring\n")); break; + case ::CORBA::tk_fixed: ACE_DEBUG ((LM_DEBUG, "tk_fixed\n")); break; + case ::CORBA::tk_value: ACE_DEBUG ((LM_DEBUG, "tk_value\n")); break; + case ::CORBA::tk_value_box: ACE_DEBUG ((LM_DEBUG, "tk_value_box\n")); break; + case ::CORBA::tk_native: ACE_DEBUG ((LM_DEBUG, "tk_native\n")); break; + case ::CORBA::tk_abstract_interface: ACE_DEBUG ((LM_DEBUG, "tk_abstract_interface\n")); break; + case ::CORBA::tk_local_interface: ACE_DEBUG ((LM_DEBUG, "tk_local_interface\n")); break; + case ::CORBA::tk_component: ACE_DEBUG ((LM_DEBUG, "tk_component\n")); break; + case ::CORBA::tk_home: ACE_DEBUG ((LM_DEBUG, "tk_home\n")); break; + case ::CORBA::tk_event: ACE_DEBUG ((LM_DEBUG, "tk_event\n")); break; + default: + break; + }; + } + + // ComponentInterfaceDescription + + void DnC_Dump::dump (const ::Deployment::ComponentInterfaceDescription &cid) + { + Dump_Obj dump_obj("ComponentInterfaceDescription"); + dump ("label", cid.label); + dump ("UUID", cid.UUID); + dump ("specificType", cid.specificType); + dump ("supportedType", cid.supportedType); + dump ("idlFile", cid.idlFile); + dump_sequence ("configProperty", cid.configProperty); + dump_sequence ("port", cid.port); + dump_sequence ("property", cid.property); + dump_sequence ("infoProperty", cid.infoProperty); + } + + // Requirement + + void DnC_Dump::dump (const ::Deployment::Requirement &req) + { + Dump_Obj dump_obj("Requirement"); + + dump ("resourceType", req.resourceType); + dump ("name", req.name); + dump_sequence ("property", req.property); + } + + // MonolithicDeploymentDescription + + void DnC_Dump::dump(const Deployment::MonolithicDeploymentDescription &mdd) + { + Dump_Obj dump_obj("MonolithicDeploymentDescription"); + + dump ("name", mdd.name); + dump ("source", mdd.source); + dump_ref_seq ("artifactRef", mdd.artifactRef, + "DeploymentPlan", + &DeploymentPlan::artifact); + dump_sequence ("execParameter", mdd.execParameter); + dump_sequence ("deployRequirement", mdd.deployRequirement); + } + + // ResourceUsageKind + + void DnC_Dump::dump(const Deployment::ResourceUsageKind &ruk) + { + ACE_DEBUG ((LM_DEBUG, "%sresourceUsage: ", Dump_Obj::indent())); + switch (ruk) { + case None: ACE_DEBUG ((LM_DEBUG, "None\n")); break; + case InstanceUsesResource: ACE_DEBUG ((LM_DEBUG, "InstanceUsesResource\n")); break; + case ResourceUsesInstance: ACE_DEBUG ((LM_DEBUG, "ResourceUsesInstance\n")); break; + case PortUsesResource: ACE_DEBUG ((LM_DEBUG, "PortUsesResource\n")); break; + case ResourceUsesPort: ACE_DEBUG ((LM_DEBUG, "ResourceUsesPort\n")); break; + } + } + + // InstanceResourceDeploymentDescription + + void DnC_Dump::dump(const Deployment::InstanceResourceDeploymentDescription &irdd) + { + Dump_Obj dump_obj("InstanceResourceDeploymentDescription"); + + dump (irdd.resourceUsage); + dump ("requirementName", irdd.requirementName); + dump ("resourceName", irdd.resourceName); + ACE_DEBUG ((LM_DEBUG, "%sresourceValue:\n", Dump_Obj::indent())); + dump (irdd.resourceValue); + } + + // InstanceDeploymentDescription + + void DnC_Dump::dump(const Deployment::InstanceDeploymentDescription &idd) + { + Dump_Obj dump_obj("InstanceDeploymentDescription"); + + dump ("name", idd.name); + dump ("node", idd.node); + dump ("source", idd.source); + dump_ref ("implementationRef", + idd.implementationRef, + "DeploymentPlan", + &DeploymentPlan::implementation); + dump_sequence ("configProperty", idd.configProperty); + dump_sequence ("deployedResource", idd.deployedResource); + dump_sequence ("deployedSharedResource", idd.deployedSharedResource); + } + + // ComponentExternalPortEndpoint + + void DnC_Dump::dump (const ::Deployment::ComponentExternalPortEndpoint &cepe) + { + Dump_Obj dump_obj("ComponentExternalPortEndpoint"); + + dump ("portName", cepe.portName); + } + + // PlanSubcomponentPortEndpoint + + void DnC_Dump::dump(const Deployment::PlanSubcomponentPortEndpoint &pspe) + { + Dump_Obj dump_obj("PlanSubcomponentPortEndpoint"); + + dump ("portName", pspe.portName); + dump ("provider", pspe.provider); + ACE_DEBUG ((LM_DEBUG, "%skind: ", Dump_Obj::indent())); + switch (pspe.kind) { + case Facet: ACE_DEBUG ((LM_DEBUG, "Facet\n")); break; + case SimplexReceptacle: ACE_DEBUG ((LM_DEBUG, "SimplexReceptacle\n")); break; + case MultiplexReceptacle: ACE_DEBUG ((LM_DEBUG, "MultiplexReceptacle\n")); break; + case EventEmitter: ACE_DEBUG ((LM_DEBUG, "EventEmitter\n")); break; + case EventPublisher: ACE_DEBUG ((LM_DEBUG, "EventPublisher\n")); break; + case EventConsumer: ACE_DEBUG ((LM_DEBUG, "EventConsumer\n")); break; + } + dump_ref ("instanceRef", pspe.instanceRef, + "DeploymentPlan", + &DeploymentPlan::instance); + } + + // ExternalReferenceEndpoint + + void DnC_Dump::dump (const ::Deployment::ExternalReferenceEndpoint &ere) + { + Dump_Obj dump_obj("ExternalReferenceEndpoint"); + + dump ("location", ere.location); + } + + // ConnectionResourceDeploymentDescription + + void DnC_Dump::dump(const Deployment::ConnectionResourceDeploymentDescription &crdd) + { + Dump_Obj dump_obj("ConnectionResourceDeploymentDescription"); + + dump ("targetName", crdd.targetName); + dump ("requirementName", crdd.requirementName); + dump ("resourceName", crdd.resourceName); + ACE_DEBUG ((LM_DEBUG, "%sresourceValue:\n", Dump_Obj::indent())); + dump (crdd.resourceValue); + } + + // PlanConnectionDescription + + void DnC_Dump::dump(const Deployment::PlanConnectionDescription &pcd) + { + Dump_Obj dump_obj("PlanConnectionDescription"); + + dump ("name", pcd.name); + dump ("source", pcd.source); + dump_sequence ("deployRequirement", pcd.deployRequirement); + dump_sequence ("externalEndpoint", pcd.externalEndpoint); + dump_sequence ("internalEndpoint", pcd.internalEndpoint); + dump_sequence ("externalReference", pcd.externalReference); + dump_sequence ("deployedResource", pcd.deployedResource); + } + + // PlanSubcomponentPropertyReference + + void DnC_Dump::dump(const Deployment::PlanSubcomponentPropertyReference &pspr) + { + Dump_Obj dump_obj("PlanSubcomponentPropertyReference"); + + dump ("propertyName", pspr.propertyName); + + dump_ref ("instanceRef", pspr.instanceRef, + "DeploymentPlan", + &DeploymentPlan::instance); + } + + // PlanPropertyMapping + + void DnC_Dump::dump(const Deployment::PlanPropertyMapping &ppm) + { + Dump_Obj dump_obj("PlanPropertyMapping"); + + dump ("name", ppm.name); + dump ("source", ppm.source); + dump ("externalName", ppm.externalName); + dump_sequence ("delegatesTo", ppm.delegatesTo); + } + + // ImplementationDependency + + void DnC_Dump::dump(const Deployment::ImplementationDependency &id) + { + Dump_Obj dump_obj("ImplementationDependency"); + + dump ("requiredType", id.requiredType); + } + + // ResourceDeploymentDescription + + void DnC_Dump::dump(const Deployment::ResourceDeploymentDescription &rdd) + { + Dump_Obj dump_obj("ResourceDeploymentDescription"); + + dump ("requirementName", rdd.requirementName); + dump ("resourceName", rdd.resourceName); + ACE_DEBUG ((LM_DEBUG, "%sresourceValue:\n", Dump_Obj::indent())); + dump (rdd.resourceValue); + } + + // ArtifactDeploymentDescription + + void DnC_Dump::dump(const Deployment::ArtifactDeploymentDescription &add) + { + Dump_Obj dump_obj("ArtifactDeploymentDescription"); + + dump ("name", add.name); + dump ("location", add.location); + dump ("node", add.node); + dump ("source", add.source); + dump_sequence ("execParameter", add.execParameter); + dump_sequence ("deployRequirement", add.deployRequirement); + dump_sequence ("deployedResource", add.deployedResource); + } + + void DnC_Dump::dump(const Deployment::DeploymentPlan &plan) + { + Dump_Obj dump_obj("DeploymentPlan", plan); + + dump ("label", plan.label); + dump ("UUID", plan.UUID); + dump (plan.realizes); + dump_sequence ("implementation", plan.implementation); + dump_sequence ("instance", plan.instance); + dump_sequence ("connection", plan.connection); + dump_sequence ("externalProperty", plan.externalProperty); + dump_sequence ("dependsOn", plan.dependsOn); + dump_sequence ("artifact", plan.artifact); + dump_sequence ("infoProperty", plan.infoProperty); + } + + // ComponentPackageReference + + void DnC_Dump::dump (const ::Deployment::ComponentPackageReference &cpr) + { + Dump_Obj dump_obj("ComponentPackageReference"); + + dump ("requiredUUID", cpr.requiredUUID); + dump ("requiredName", cpr.requiredName); + dump ("requiredType", cpr.requiredType); + } + + // SubcomponentInstantiationDescription + + void DnC_Dump::dump (const ::Deployment::SubcomponentInstantiationDescription &sid) + { + Dump_Obj dump_obj("SubcomponentInstantiationDescription"); + + dump ("name", sid.name); + dump_sequence ("package", sid.package); + dump_sequence ("configProperty", sid.configProperty); + dump_sequence ("selectRequirement", sid.selectRequirement); + dump_sequence ("reference", sid.reference); + } + + // SubcomponentPortEndpoint + + void DnC_Dump::dump (const ::Deployment::SubcomponentPortEndpoint& spe) + { + Dump_Obj dump_obj("SubcomponentPortEndpoint"); + + dump ("portName", spe.portName); + int value = spe.instanceRef; + ACE_DEBUG ((LM_DEBUG, "%sinstance: %s \n", Dump_Obj::indent (), + Dump_Obj::desc + ("ComponentAssemblyDescription").instance[value].name.in ())); + } + + // AssemblyConnectionDescription + + void DnC_Dump::dump (const ::Deployment::AssemblyConnectionDescription &acd) + { + Dump_Obj dump_obj("AssemblyConnectionDescription"); + + dump ("name", acd.name); + dump_sequence ("deployRequirement", acd.deployRequirement); + dump_sequence ("externalEndpoint", acd.externalEndpoint); + dump_sequence ("internalEndpoint", acd.internalEndpoint); + dump_sequence ("externalReference", acd.externalReference); + } + + // SubcomponentPropertyReference + + void DnC_Dump::dump (const ::Deployment::SubcomponentPropertyReference &spr) + { + Dump_Obj dump_obj("SubcomponentPropertyReference"); + + dump ("propertyName", spr.propertyName); + int value = spr.instanceRef; + ACE_DEBUG ((LM_DEBUG, "%sinstance: %s \n", Dump_Obj::indent (), + Dump_Obj::desc + ("ComponentAssemblyDescription").instance[value].name.in ())); + } + + // AssemblyPropertyMapping + + void DnC_Dump::dump (const ::Deployment::AssemblyPropertyMapping &apm) + { + Dump_Obj dump_obj("AssemblyPropertyMapping"); + + dump ("name", apm.name); + dump ("externalName", apm.externalName); + dump_sequence ("delegatesTo", apm.delegatesTo); + } + + // ComponentAssemblyDescription + + void DnC_Dump::dump (const ::Deployment::ComponentAssemblyDescription& cad) + { + Dump_Obj dump_obj("ComponentAssemblyDescription", cad); + + dump_sequence ("instance", cad.instance); + dump_sequence ("connection", cad.connection); + dump_sequence ("externalProperty", cad.externalProperty); + } + + // ImplementationArtifactDescription + + void DnC_Dump::dump (const ::Deployment::ImplementationArtifactDescription &iad) + { + Dump_Obj dump_obj("ImplementationArtifactDescription"); + + dump ("label", iad.label); + dump ("UUID", iad.UUID); + dump ("location", iad.location); + dump_sequence ("execParameter", iad.execParameter); + dump_sequence ("deployRequirement", iad.deployRequirement); + dump_sequence ("dependsOn", iad.dependsOn); + dump_sequence ("infoProperty", iad.infoProperty); + } + + // NamedImplementationArtifact + + void DnC_Dump::dump (const ::Deployment::NamedImplementationArtifact &nia) + { + Dump_Obj dump_obj("NamedImplementationArtifact"); + + dump ("name", nia.name); + dump (nia.referencedArtifact); + } + + // ImplementationRequirement + + void DnC_Dump::dump (const ::Deployment::ImplementationRequirement &ir) + { + Dump_Obj dump_obj("ImplementationRequirement"); + + dump_sequence ("resourceUsage", ir.resourceUsage); + dump ("resourcePort", ir.resourcePort); + dump ("componentPort", ir.componentPort); + dump ("resourceType", ir.resourceType); + dump ("name", ir.name); + dump_sequence ("property", ir.property); + } + + // MonolithicImplementationDescription + + void DnC_Dump::dump (const ::Deployment::MonolithicImplementationDescription + &mid) + { + Dump_Obj dump_obj("MonolithicImplementationDescription"); + + dump_sequence ("execParameter", mid.execParameter); + dump_sequence ("primaryArtifact", mid.primaryArtifact); + dump_sequence ("deployRequirement", mid.deployRequirement); + } + + // Capability + + void DnC_Dump::dump (const ::Deployment::Capability &capability) + { + Dump_Obj dump_obj("Capability"); + + dump ("name", capability.name); + DnC_Dump::dump ("resourceType", capability.resourceType); + DnC_Dump::dump_sequence ("property", capability.property); + } + + // ComponentImplementationDescription + + void DnC_Dump::dump ( + const ::Deployment::ComponentImplementationDescription &cid) + { + Dump_Obj dump_obj("ComponentImplementationDescription"); + + dump ("label", cid.label); + dump ("UUID", cid.UUID); + ACE_DEBUG ((LM_DEBUG, "%sImplements:\n", Dump_Obj::indent())); + dump (cid.implements); + dump_sequence ("assemblyImpl", cid.assemblyImpl); + dump_sequence ("monolithicImpl", cid.monolithicImpl); + dump_sequence ("configProperty", cid.configProperty); + dump_sequence ("capability", cid.capability); + dump_sequence ("dependsOn", cid.dependsOn); + dump_sequence ("infoProperty", cid.infoProperty); + } + + // PackagedComponentImplementation + + void DnC_Dump::dump (const ::Deployment::PackagedComponentImplementation &pci) + { + Dump_Obj dump_obj("PackagedComponentImplementation"); + + dump ("Name", pci.name); + ACE_DEBUG ((LM_DEBUG, + "%sreferencedImplementation: \n", Dump_Obj::indent())); + DnC_Dump::dump (pci.referencedImplementation); + } + + // ComponentPackageDescription + + void DnC_Dump::dump (const ::Deployment::ComponentPackageDescription + &comppkgdesc) + { + Dump_Obj dump_obj("ComponentPackageDescription"); + + dump ("label", comppkgdesc.label); + dump ("UUID", comppkgdesc.UUID); + ACE_DEBUG ((LM_DEBUG, "%srealizes: \n", Dump_Obj::indent ())); + DnC_Dump::dump (comppkgdesc.realizes); // ComponentInterfaceDescription + dump_sequence ("configProperty", comppkgdesc.configProperty); + dump_sequence ("implementation", comppkgdesc.implementation); + dump_sequence ("infoProperty", comppkgdesc.infoProperty); + } + + // PackageConfiguration + + void DnC_Dump::dump (const ::Deployment::PackageConfiguration &pc) + { + Dump_Obj dump_obj("PackageConfiguration"); + + dump ("label", pc.label); + dump ("UUID", pc.UUID); + dump_sequence ("specializedConfig", pc.specializedConfig); + dump_sequence ("basePackage", pc.basePackage); + dump_sequence ("reference", pc.reference); + dump_sequence ("selectRequirement", pc.selectRequirement); + dump_sequence ("configProperty", pc.configProperty); + } + + // Requirement Satisfier + void DnC_Dump::dump (const Deployment::RequirementSatisfier& rs) + { + Dump_Obj dump_obj("RequirementSatisfier"); + + dump ("name", rs.name); + dump ("resourceType", rs.resourceType); + dump_sequence ("property", rs.property); + } + + // Property + void DnC_Dump::dump (const Deployment::Property& property) + { + Dump_Obj dump_obj("Property"); + dump ("name", property.name); + ACE_DEBUG ((LM_DEBUG, "%svalue:\n", Dump_Obj::indent())); + dump (property.value); + } + + // CORBA::Any + + void DnC_Dump::dump (const ::CORBA::Any &any) + { + ::CORBA::TypeCode * type = any.type (); + switch (type->kind ()) + { + case CORBA::tk_short: + { + CORBA::Short temp; + if (! (any >>= temp)) + { + ACE_DEBUG ((LM_DEBUG, "DnC_Dump::dump (CORBA::Any), expected short\ + encoded different type")); + ACE_THROW (CORBA::INTERNAL ()); + } + ACE_DEBUG ((LM_DEBUG, "%sAny value: %d \n", Dump_Obj::indent (), + temp)); + } + break; + + case CORBA::tk_null: + ACE_DEBUG ((LM_DEBUG, "%sAny value: null value encoded\n", + Dump_Obj::indent ())); + break; + + case CORBA::tk_void: + ACE_DEBUG ((LM_DEBUG, "Any value: void type encoded \n")); + break; + case CORBA::tk_long: + { + CORBA::Long temp; + if (! (any >>= temp)) + { + ACE_DEBUG ((LM_DEBUG, "DnC::dump (CORBA::Any) expected long\ + encoded with different type")); + ACE_THROW (CORBA::INTERNAL ()); + } + ACE_DEBUG ((LM_DEBUG, "%sAny value: %d \n", Dump_Obj::indent (), + temp)); + } + break; + + case CORBA::tk_ushort: + { + CORBA::UShort temp; + if (! (any >>= temp)) + { + ACE_DEBUG ((LM_DEBUG, "DnC::dump (CORBA::Any) expected u short\ + encoded with different type")); + ACE_THROW (CORBA::INTERNAL ()); + } + ACE_DEBUG ((LM_DEBUG, "%sAny value: %u \n", Dump_Obj::indent (), + temp)); + } + break; + + case CORBA::tk_ulong: + { + CORBA::ULong temp; + if (! (any >>= temp)) + { + ACE_DEBUG ((LM_DEBUG, "DnC::dump (CORBA::Any) expected ulong\ + encoded with different type")); + ACE_THROW (CORBA::INTERNAL ()); + } + ACE_DEBUG ((LM_DEBUG, "%sAny value: %u \n", Dump_Obj::indent (), + temp)); + } + break; + + case CORBA::tk_float: + { + CORBA::Float temp; + if (! (any >>= temp)) + { + ACE_DEBUG ((LM_DEBUG, "DnC::dump (CORBA::Any) expected float\ + encoded with different type")); + ACE_THROW (CORBA::INTERNAL ()); + } + ACE_DEBUG ((LM_DEBUG, "%sAny value: %f \n", Dump_Obj::indent (), + temp)); + } + break; + case CORBA::tk_double: + { + CORBA::Double temp; + if (! (any >>= temp)) + { + ACE_DEBUG ((LM_DEBUG, "DnC::dump (CORBA::Any) expected double\ + encoded with different type")); + ACE_THROW (CORBA::INTERNAL ()); + } + ACE_DEBUG ((LM_DEBUG, "%sAny value: %f \n", Dump_Obj::indent (), + temp)); + } + break; + case CORBA::tk_boolean: + { + CORBA::Boolean temp; + if (! (any >>= CORBA::Any::to_boolean (temp))) + { + ACE_DEBUG ((LM_DEBUG, "DnC::dump (CORBA::Any) expected bool\ + encoded with different type")); + ACE_THROW (CORBA::INTERNAL ()); + } + + if (temp) + ACE_DEBUG ((LM_DEBUG, "Any value: True \n")); + else + ACE_DEBUG ((LM_DEBUG, "Any value: False \n")); + } + break; + + case CORBA::tk_char: + { + CORBA::Char temp; + if (! (any >>= CORBA::Any::to_char (temp))) + { + ACE_DEBUG ((LM_DEBUG, "DnC::dump (CORBA::Any) expected char\ + encoded with different type")); + ACE_THROW (CORBA::INTERNAL ()); + } + ACE_DEBUG ((LM_DEBUG, "%sAny value: %c \n", Dump_Obj::indent (), + temp)); + } + break; + + case CORBA::tk_octet: + { + CORBA::Octet temp; + if (! (any >>= CORBA::Any::to_octet (temp))) + { + ACE_DEBUG ((LM_DEBUG, "DnC::dump (CORBA::Any) expected octet\ + encoded with different type")); + ACE_THROW (CORBA::INTERNAL ()); + } + ACE_DEBUG ((LM_DEBUG, "%sAny value: %d \n", Dump_Obj::indent (), + temp)); + } + break; + + case CORBA::tk_string: + { + const char * temp = 0; + if (! (any >>= temp)) + { + ACE_DEBUG ((LM_DEBUG, "DnC::dump (CORBA::Any) expected string\ + encoded with different type")); + ACE_THROW (CORBA::INTERNAL ()); + } + ACE_DEBUG ((LM_DEBUG, "%sAny value: %s \n", Dump_Obj::indent (), + temp)); + } + break; + case CORBA::tk_longlong: + { + CORBA::LongLong temp; + if (! (any >>= temp)) + { + ACE_DEBUG ((LM_DEBUG, "DnC::dump (CORBA::Any) expected longlong\ + encoded with different type")); + ACE_THROW (CORBA::INTERNAL ()); + } + ACE_DEBUG ((LM_DEBUG, "%sAny value: %l \n", Dump_Obj::indent (), + temp)); + } + break; + + case CORBA::tk_longdouble: + { + CORBA::LongDouble temp; + if (! (any >>= temp)) + { + ACE_DEBUG ((LM_DEBUG, "DnC::dump (CORBA::Any) expected longdouble\ + encoded with different type")); + ACE_THROW (CORBA::INTERNAL ()); + } + ACE_DEBUG ((LM_DEBUG, "%sAny value: %d \n", Dump_Obj::indent (), + temp)); + } + + break; + case CORBA::tk_wchar: + { + CORBA::WChar temp; + if (! (any >>= CORBA::Any::to_wchar (temp))) + { + ACE_DEBUG ((LM_DEBUG, "DnC::dump (CORBA::Any) expected wchar\ + encoded with different type")); + ACE_THROW (CORBA::INTERNAL ()); + } + ACE_DEBUG ((LM_DEBUG, "%sAny value: %c \n", Dump_Obj::indent (), + temp)); + } + break; + + case CORBA::tk_wstring: + { + const CORBA::WChar * temp; + if (! (any >>= temp)) + { + ACE_DEBUG ((LM_DEBUG, "DnC::dump (CORBA::Any) expected wstring\ + encoded with different type")); + ACE_THROW (CORBA::INTERNAL ()); + } + ACE_DEBUG ((LM_DEBUG, "%sAny value: %s \n", Dump_Obj::indent (), + temp)); + } + break; + + default: + ACE_DEBUG ((LM_DEBUG, "Unknown type encoded in Any\n")); + ACE_THROW (CORBA::INTERNAL ()); + } + } +#endif // ACE_HAS_BROKEN_NESTED_TEMPLATES +} + +#endif /* DNC_DUMP_C */ diff --git a/TAO/CIAO/DAnCE/Config_Handlers/DnC_Dump.h b/TAO/CIAO/DAnCE/Config_Handlers/DnC_Dump.h new file mode 100644 index 00000000000..db09a278158 --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/DnC_Dump.h @@ -0,0 +1,176 @@ +//================================================================== +/** + * @file DnC_Dump.h + * + * $Id$ + * + * @author Gan Deng + */ +//===================================================================== + +#ifndef DNC_DUMP_H +#define DNC_DUMP_H +#include /**/ "ace/pre.h" + +#include "ciao/DeploymentC.h" +#include "Config_Handler_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +#pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + + +namespace Deployment +{ + /** + * @class DnC_Dump + * + * @brief This class defines a set of overloaded "dump" methods to print + * the contents of various IDL data types, which passed as input. + */ + class Config_Handler_Export DnC_Dump + { +/* + * If the compiler has broken nested templates exclude dumping functionality. + */ +#ifndef ACE_HAS_BROKEN_NESTED_TEMPLATES + + public: + /// Dump functions for CORBA sequences + static void DnC_Dump::dump (const char* caption, + const ::CORBA::StringSeq &str_seq); + + template + static void dump_sequence (const char* caption, const SEQUENCE &seq); + + template + static void dump_ref_seq (const char* caption, SEQUENCE& seq, + const char* root, DATA_TYPE CLASS::*data); + + template + static void dump_ref (const char* caption, REFERENCE& ref, + const char* root, DATA_TYPE CLASS::*data); + + static void dump (const char* caption, const TAO_String_Manager& str); + + static void dump (const char* caption, const CORBA::Boolean& val); + + /// A whole slew of overloaded dump routines for different IDL data types. + + static void dump(const Deployment::SatisfierProperty &sp); + + static void dump (const Deployment::SharedResource& sr); + + static void dump (const Deployment::Node& node); + + static void dump (const Deployment::Resource& resource); + + static void dump (const Deployment::Interconnect& conn); + + static void dump (const Deployment::Bridge& bridge); + + static void dump (const ::Deployment::Property &property); + + static void dump (const ::Deployment::AssemblyConnectionDescription &acd); + + static void dump (const ::Deployment::AssemblyPropertyMapping &apm); + + static void dump (const ::Deployment::ComponentPackageDescription + &comppkgdesc); + + static void dump (const ::Deployment::ComponentPortDescription + &compportdesc); + + static void dump (const ::Deployment::ComponentPropertyDescription + &comppropdesc); + + static void dump (const ::Deployment::MonolithicImplementationDescription + &mid); + + static void dump (const ::Deployment::PackageConfiguration &pc); + + static void dump (const ::Deployment::PackagedComponentImplementation + &pci); + + static void dump (const ::Deployment::SubcomponentPortEndpoint &spe); + + static void dump (const ::Deployment::Requirement &requirement); + + static void dump (const ::Deployment::ComponentExternalPortEndpoint + &cepe); + + static void dump (const ::Deployment::ComponentPackageReference &cpr); + + static void dump (const ::Deployment::ComponentImplementationDescription + &cid); + + static void dump (const ::Deployment::SubcomponentInstantiationDescription + &sid); + + static void dump (const ::Deployment::NamedImplementationArtifact + &named_implementation); + + static void dump (const ::Deployment::ComponentInterfaceDescription &cid); + + static void dump (const ::Deployment::SubcomponentPropertyReference + &scpr); + + static void dump (const ::Deployment::ExternalReferenceEndpoint &ere); + + static void dump (const ::Deployment::Domain &domain); + + static void dump (const ::Deployment::Capability &capability); + + static void dump (const ::Deployment::ImplementationArtifactDescription + &iad); + + static void dump (const ::Deployment::ImplementationRequirement &ir); + + static void dump(const Deployment::ResourceUsageKind &ruk); + + static void dump(const Deployment::DeploymentPlan &plan); + + static void dump(const Deployment::MonolithicDeploymentDescription &mdd); + + static void dump(const Deployment::InstanceDeploymentDescription &idd); + + static void dump(const Deployment::PlanConnectionDescription &pcd); + + static void dump(const Deployment::PlanPropertyMapping &ppm); + + static void dump(const Deployment::ImplementationDependency &id); + + static void dump(const Deployment::ArtifactDeploymentDescription &add); + + static void dump(const Deployment::InstanceResourceDeploymentDescription + &irdd); + + static void dump(const PlanSubcomponentPortEndpoint &pspe); + + static void dump(const ConnectionResourceDeploymentDescription &crdd); + + static void dump(const PlanSubcomponentPropertyReference &pspr); + + static void dump(const ResourceDeploymentDescription &rdd); + + static void dump (const ::Deployment::ComponentAssemblyDescription& cad); + + static void dump (const Deployment::RequirementSatisfier& rs); + + private: + static void dump (const ::CORBA::Any &any); + // Helper function to print an Any + +#else // ACE_HAS_BROKEN_NESTED_TEMPLATES + + static void dump(const Deployment::DeploymentPlan &plan) { } + +#endif // ACE_HAS_BROKEN_NESTED_TEMPLATES + }; +} + +#include /**/ "ace/post.h" + +#endif /* DNC_DUMP_H */ diff --git a/TAO/CIAO/DAnCE/Deployment.mwc b/TAO/CIAO/DAnCE/Deployment.mwc new file mode 100644 index 00000000000..fcf95d10967 --- /dev/null +++ b/TAO/CIAO/DAnCE/Deployment.mwc @@ -0,0 +1,4 @@ +// $Id$ + +workspace { +} diff --git a/TAO/CIAO/DAnCE/Deployment.xsd b/TAO/CIAO/DAnCE/Deployment.xsd new file mode 100644 index 00000000000..c8a6399730b --- /dev/null +++ b/TAO/CIAO/DAnCE/Deployment.xsd @@ -0,0 +1,776 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TAO/CIAO/DAnCE/Deployment.xsd.orig b/TAO/CIAO/DAnCE/Deployment.xsd.orig new file mode 100644 index 00000000000..a59a47f1360 --- /dev/null +++ b/TAO/CIAO/DAnCE/Deployment.xsd.orig @@ -0,0 +1,897 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TAO/CIAO/DAnCE/XMI.xsd b/TAO/CIAO/DAnCE/XMI.xsd new file mode 100644 index 00000000000..f4adac91934 --- /dev/null +++ b/TAO/CIAO/DAnCE/XMI.xsd @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TAO/CIAO/DAnCE/XMI.xsd.orig b/TAO/CIAO/DAnCE/XMI.xsd.orig new file mode 100644 index 00000000000..f4adac91934 --- /dev/null +++ b/TAO/CIAO/DAnCE/XMI.xsd.orig @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.1