diff options
-rw-r--r-- | TAO/CIAO/tools/ChangeLog | 13 | ||||
-rw-r--r-- | TAO/CIAO/tools/XML_Helpers/RTConfig_Handlers.cpp | 226 | ||||
-rw-r--r-- | TAO/CIAO/tools/XML_Helpers/RTConfig_Handlers.h | 20 | ||||
-rw-r--r-- | TAO/CIAO/tools/XML_Helpers/XML_Utils.cpp | 57 | ||||
-rw-r--r-- | TAO/CIAO/tools/XML_Helpers/main.cpp | 26 | ||||
-rw-r--r-- | TAO/CIAO/tools/XML_Helpers/test.cad | 90 | ||||
-rw-r--r-- | TAO/CIAO/tools/XML_Helpers/test.rtd | 93 |
7 files changed, 471 insertions, 54 deletions
diff --git a/TAO/CIAO/tools/ChangeLog b/TAO/CIAO/tools/ChangeLog index d8faa290843..b52380f71d1 100644 --- a/TAO/CIAO/tools/ChangeLog +++ b/TAO/CIAO/tools/ChangeLog @@ -1,3 +1,16 @@ +Thu Aug 14 16:27:52 2003 Nanbor Wang <nanbor@cs.wustl.edu> + + * tools/XML_Helpers/RTCAD-example.rtd: + * tools/XML_Helpers/RTCAD-example.cad: Added new file to show some + example cad and rtd files. + + * tools/XML_Helpers/main.cpp: + * tools/XML_Helpers/XML_Utils.cpp: Extended to invoke the RTCAD + handler. + + * tools/XML_Helpers/RTConfig_Handlers.h: + * tools/XML_Helpers/RTConfig_Handlers.cpp: Fixed run-time errors. + Wed Aug 13 01:48:46 2003 Nanbor Wang <nanbor@cs.wustl.edu> * tools/RTComponentServer/RTComponentServer.mpc: Added dependency diff --git a/TAO/CIAO/tools/XML_Helpers/RTConfig_Handlers.cpp b/TAO/CIAO/tools/XML_Helpers/RTConfig_Handlers.cpp index a300222d527..b89a46c326b 100644 --- a/TAO/CIAO/tools/XML_Helpers/RTConfig_Handlers.cpp +++ b/TAO/CIAO/tools/XML_Helpers/RTConfig_Handlers.cpp @@ -17,19 +17,24 @@ CIAO::RTConfig_Handler::startElement (const ACEXML_Char *namespaceURI, switch (this->state_) { case START: - if (ACE_OS::strcmp (qName, "rtrecources") == 0) + if (ACE_OS::strcmp (qName, "rtresources") == 0) { this->state_ = RTRESOURCES; } else if (ACE_OS::strcmp (qName, "rtpolicyset") == 0) { this->state_ = RTPOLICYSET; - // @@ fix me this->create_new_rtpolicyset (alist); + this->create_new_policyset (alist + ACEXML_ENV_ARG_PARAMETER); } - else if (ACE_OS::strcmp (qName, "rtcad-ext") == 0) + else if (ACE_OS::strcmp (qName, "rtcad_ext") == 0) { ACE_DEBUG ((LM_DEBUG, "Start parsing RT cad file extension\n")); } + else + ACEXML_THROW (ACEXML_SAXException + ("Error parsing rtcad_ext child\n")); + return; case RTRESOURCES: @@ -53,28 +58,71 @@ CIAO::RTConfig_Handler::startElement (const ACEXML_Char *namespaceURI, alist ACEXML_ENV_ARG_PARAMETER); ACEXML_CHECK; - this->bands_config_->name = id; this->state_ = CONNBANDS; } + else + ACEXML_THROW (ACEXML_SAXException + ("Error parsing rtresource\n")); + return; case RTPOLICYSET: - if (ACE_OS::strcmp (qName, "priority_model_policy") == 0) - { - // @@ parse attributes and add it to the policy set - } - else if (ACE_OS::strcmp (qName, "threadpool_policy") == 0) - { - // @@ parse the attributes and add it to the policy set - } - else if (ACE_OS::strcmp (qName, "banded_connection_policy") == 0) + if (ACE_OS::strcmp (qName, "rtpolicyset") == 0) { - // @@ parse the attributes and add it to the policy set + this->create_new_policyset (alist + ACEXML_ENV_ARG_PARAMETER); } - else if (ACE_OS::strcmp (qName, "rtpolicyset") == 0) + else { - // @@ parse the attributes and add it to the policy set + CIAO::RTConfiguration::Policy_Config_var newpolicy + = new CIAO::RTConfiguration::Policy_Config; + + if (ACE_OS::strcmp (qName, "priority_model_policy") == 0) + { + CIAO::RTConfiguration::Priority_Model_Config config; + this->parse_priority_model_config (alist, + config + ACEXML_ENV_ARG_PARAMETER); + ACEXML_CHECK; + + newpolicy->type = RTCORBA::PRIORITY_MODEL_POLICY_TYPE; + newpolicy->configuration <<= config; + } + else if (ACE_OS::strcmp (qName, "threadpool_policy") == 0) + { + const char *idref; + XML_Utils::get_single_attribute ("idref", + idref, + alist + ACEXML_ENV_ARG_PARAMETER); + ACEXML_CHECK; + + newpolicy->type = RTCORBA::THREADPOOL_POLICY_TYPE; + // @@ try to catch CORBA exceptions here + newpolicy->configuration <<= idref; + } + else if (ACE_OS::strcmp (qName, "banded_connection_policy") == 0) + { + const char *idref; + XML_Utils::get_single_attribute ("idref", + idref, + alist + ACEXML_ENV_ARG_PARAMETER); + ACEXML_CHECK; + + newpolicy->type = RTCORBA::PRIORITY_BANDED_CONNECTION_POLICY_TYPE; + // @@ try to catch CORBA exceptions here + newpolicy->configuration <<= idref; + } + else + ACEXML_THROW (ACEXML_SAXException + ("Error parsing child of rtpolicyset element")); + + // Store the good parsed results. + CORBA::ULong len = this->policy_set_->configs.length (); + this->policy_set_->configs.length (len+1); + this->policy_set_->configs[len] = newpolicy; } return; @@ -96,11 +144,11 @@ CIAO::RTConfig_Handler::startElement (const ACEXML_Char *namespaceURI, default: ACEXML_THROW (ACEXML_SAXException - (ACE_TEXT ("RTConfig handler internal error"))); + ("RTConfig handler internal error")); return; } ACEXML_THROW (ACEXML_SAXException - (ACE_TEXT ("RTConfig handler internal error"))); + ("RTConfig handler internal error")); } void @@ -113,7 +161,7 @@ CIAO::RTConfig_Handler::endElement (const ACEXML_Char *, switch (this->state_) { case START: - if (ACE_OS::strcmp (qName, "rtcad-ext") == 0) + if (ACE_OS::strcmp (qName, "rtcad_ext") == 0) { ACE_DEBUG ((LM_DEBUG, "End parsing RT cad file extension\n")); } @@ -130,31 +178,40 @@ CIAO::RTConfig_Handler::endElement (const ACEXML_Char *, // Store the good parsed results. CORBA::ULong len = this->rtresources.tpl_configs.length (); this->rtresources.tpl_configs.length (len+1); - this->rtresources.tpl_configs[len-1] = this->tpl_config_; + this->rtresources.tpl_configs[len] = this->tpl_config_; + this->state_ = RTRESOURCES; } return; case CONNBANDS: if (ACE_OS::strcmp (qName, "connectionbands") == 0) { - // @@ wrap up band sequence. + // Store the good parsed results. + CORBA::ULong len = this->rtresources.pb_configs.length (); + this->rtresources.pb_configs.length (len+1); + this->rtresources.pb_configs[len] = this->bands_config_; + this->state_ = RTRESOURCES; } return; case RTPOLICYSET: if (ACE_OS::strcmp (qName, "rtpolicyset") == 0) { - // @@ add the policy set to the sequence. + // Store the good parsed results. + CORBA::ULong len = this->policysets.length (); + this->policysets.length (len+1); + this->policysets[len] = this->policy_set_; + this->state_ = START; } return; default: ACEXML_THROW (ACEXML_SAXException - (ACE_TEXT ("RTConfig handler internal error"))); + ("RTConfig handler internal error")); return; } ACEXML_THROW (ACEXML_SAXException - (ACE_TEXT ("RTConfig handler internal error"))); + ("RTConfig handler internal error")); } // ================================================================= @@ -164,14 +221,14 @@ CIAO::RTConfig_Handler::parse_threadpool_attrs (ACEXML_Attributes *alist ACEXML_ENV_ARG_DECL) ACE_THROW_SPEC ((ACEXML_SAXException)) { - const STACKSIZE_READ = 1; - const STATICTHR_READ = 2; - const DYNAMICTHR_READ = 4; - const DEFAULTPRIO_READ = 8; - const YES_BUFFERING_READ = 0X10; - const BUFFER_REQ_READ = 0X20; - const BUFFER_SIZE_READ = 0X40; - const TPNAME_READ = 0X80; + const int STACKSIZE_READ = 1; + const int STATICTHR_READ = 2; + const int DYNAMICTHR_READ = 4; + const int DEFAULTPRIO_READ = 8; + const int YES_BUFFERING_READ = 0X10; + const int BUFFER_REQ_READ = 0X20; + const int BUFFER_SIZE_READ = 0X40; + const int TPNAME_READ = 0X80; // Initialize the attribute parse progress. We will turn off these // bits one by one. At the end, the att_status should be 0. @@ -302,7 +359,7 @@ CIAO::RTConfig_Handler::parse_threadpool_attrs (ACEXML_Attributes *alist // Store the good parsed results. CORBA::ULong len = this->rtresources.tp_configs.length (); this->rtresources.tp_configs.length (len+1); - this->rtresources.tp_configs[len-1] = tp_config; + this->rtresources.tp_configs[len] = tp_config; } void @@ -310,12 +367,12 @@ CIAO::RTConfig_Handler::parse_threadpoollanes_attrs (ACEXML_Attributes *alist ACEXML_ENV_ARG_DECL) ACE_THROW_SPEC ((ACEXML_SAXException)) { - const STACKSIZE_READ = 1; - const YES_BORROWING_READ = 2; - const YES_BUFFERING_READ = 4; - const BUFFER_REQ_READ = 8; - const BUFFER_SIZE_READ = 0X10; - const TPNAME_READ = 0X20; + const int STACKSIZE_READ = 1; + const int YES_BORROWING_READ = 2; + const int YES_BUFFERING_READ = 4; + const int BUFFER_REQ_READ = 8; + const int BUFFER_SIZE_READ = 0X10; + const int TPNAME_READ = 0X20; // Initialize the attribute parse progress. We will turn off these // bits one by one. At the end, the att_status should be 0. @@ -364,7 +421,7 @@ CIAO::RTConfig_Handler::parse_threadpoollanes_attrs (ACEXML_Attributes *alist this->tpl_config_->allow_borrowing = 0; ACE_CLR_BITS (att_status, - YES_BUFFERING_READ); + YES_BORROWING_READ); } else if (ACE_OS_String::strcmp (attName, "buffering") == 0) { @@ -419,9 +476,9 @@ CIAO::RTConfig_Handler::add_threadpoollane (ACEXML_Attributes *alist ACEXML_ENV_ARG_DECL) ACE_THROW_SPEC ((ACEXML_SAXException)) { - const PRIORITY_READ = 1; - const STATICTHR_READ = 2; - const DYNAMICTHR_READ = 4; + const int PRIORITY_READ = 1; + const int STATICTHR_READ = 2; + const int DYNAMICTHR_READ = 4; // Initialize the attribute parse progress. We will turn off these // bits one by one. At the end, the att_status should be 0. @@ -490,7 +547,7 @@ CIAO::RTConfig_Handler::add_threadpoollane (ACEXML_Attributes *alist // Store the good parsed results. CORBA::ULong len = this->tpl_config_->lanes.length (); this->tpl_config_->lanes.length (len+1); - this->tpl_config_->lanes[len-1] = alane; + this->tpl_config_->lanes[len] = alane; } void @@ -498,8 +555,8 @@ CIAO::RTConfig_Handler::add_priorityband (ACEXML_Attributes *alist ACEXML_ENV_ARG_DECL) ACE_THROW_SPEC ((ACEXML_SAXException)) { - const LOW_READ = 1; - const HIGH_READ = 2; + const int LOW_READ = 1; + const int HIGH_READ = 2; // Initialize the attribute parse progress. We will turn off these // bits one by one. At the end, the att_status should be 0. @@ -554,5 +611,80 @@ CIAO::RTConfig_Handler::add_priorityband (ACEXML_Attributes *alist // Store the good parsed results. CORBA::ULong len = this->bands_config_->bands.length (); this->bands_config_->bands.length (len+1); - this->bands_config_->bands[len-1] = band; + this->bands_config_->bands[len] = band; +} + +void +CIAO::RTConfig_Handler::create_new_policyset (ACEXML_Attributes *alist + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + const char *id; + XML_Utils::get_single_attribute ("id", + id, + alist + ACEXML_ENV_ARG_PARAMETER); + ACEXML_CHECK; + + this->policy_set_ = new CIAO::RTConfiguration::Policy_Set; + + this->policy_set_->name = id; +} + +void +CIAO::RTConfig_Handler::parse_priority_model_config (ACEXML_Attributes *alist, + RTConfiguration::Priority_Model_Config &config + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + const int MODEL_READ = 1; + const int PRIORITY_READ = 2; + int att_status = + MODEL_READ | + PRIORITY_READ ; + + for (size_t i = 0; i < alist->getLength (); ++i) + { + const char *attName = alist->getQName (i); + const char *attValue = alist->getValue (i); + + if (ACE_OS_String::strcmp (attName, "type") == 0) + { + // Assuming we have a validating parser. + if (ACE_OS_String::strcmp (attValue, "server_declared") == 0) + config.model = RTCORBA::SERVER_DECLARED; + else if (ACE_OS_String::strcmp (attValue, "client_propagated") == 0) + config.model = RTCORBA::CLIENT_PROPAGATED; + else + ACEXML_THROW (ACEXML_SAXException + ("RTConfig handler error while reading Priority Model Config.")); + + ACE_CLR_BITS (att_status, + MODEL_READ); + } + else if (ACE_OS_String::strcmp (attName, "priority") == 0) + { + char *endpos; + + config.default_priority = + strtoul (attValue, &endpos, 10); + + if (*endpos != 0) + ACEXML_THROW + (ACEXML_SAXException + ("Invalid 'priority' attribute in Priority Model Config.")); + + ACE_CLR_BITS (att_status, + PRIORITY_READ); + } + else + ACEXML_THROW + (ACEXML_SAXException + ("Invalid attribute found in priority_model element")); + } + if (att_status != 0) + ACEXML_THROW + (ACEXML_SAXException + ("Not all 'priority_model' attributes are set.")); + } diff --git a/TAO/CIAO/tools/XML_Helpers/RTConfig_Handlers.h b/TAO/CIAO/tools/XML_Helpers/RTConfig_Handlers.h index 2369aac00dd..1cbc4ba8c91 100644 --- a/TAO/CIAO/tools/XML_Helpers/RTConfig_Handlers.h +++ b/TAO/CIAO/tools/XML_Helpers/RTConfig_Handlers.h @@ -15,8 +15,8 @@ */ //============================================================================= -#ifndef CIAO_ASSEMBLY_HANDLERS_H -#define CIAO_ASSEMBLY_HANDLERS_H +#ifndef CIAO_RTCONFIG_HANDLERS_H +#define CIAO_RTCONFIG_HANDLERS_H #include "Cascadable_DocHandler.h" #include "XML_Utils.h" @@ -99,6 +99,17 @@ namespace CIAO ACEXML_ENV_ARG_DECL) ACE_THROW_SPEC ((ACEXML_SAXException)); + /// parse and create a new policyset from attributes + void create_new_policyset (ACEXML_Attributes *atts + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)); + + /// parse and set up the priority model configuration information + void parse_priority_model_config (ACEXML_Attributes *atts, + RTConfiguration::Priority_Model_Config &config + ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)); + private: // Current context when filling RTConfiguration::ThreadPoolLanes_Configuration RTConfiguration::ThreadPoolLanes_Configuration_var tpl_config_; @@ -106,6 +117,9 @@ namespace CIAO // Current context when filling RTConfiguration::PriorityBands_Configuration RTConfiguration::PriorityBands_Configuration_var bands_config_; + // Current context when filling RTConfiguration::Policy_Set + RTConfiguration::Policy_Set_var policy_set_; + // RTORB related info. RTConfiguration::RTORB_Resource_Info &rtresources; @@ -118,4 +132,4 @@ namespace CIAO #if defined (__ACE_INLINE__) # include "RTConfig_Handlers.inl" #endif /* __ACE_INLINE__ */ -#endif /* CIAO_ASSEMBLY_HANDLERS_H */ +#endif /* CIAO_RTCONFIG_HANDLERS_H */ diff --git a/TAO/CIAO/tools/XML_Helpers/XML_Utils.cpp b/TAO/CIAO/tools/XML_Helpers/XML_Utils.cpp index 6506ea3c728..5455bc9b885 100644 --- a/TAO/CIAO/tools/XML_Helpers/XML_Utils.cpp +++ b/TAO/CIAO/tools/XML_Helpers/XML_Utils.cpp @@ -5,6 +5,7 @@ #include "ACEXML/common/StrCharStream.h" #include "ACEXML/parser/parser/Parser.h" #include "Assembly_Handlers.h" +#include "RTConfig_Handlers.h" #if !defined (__ACE_INLINE__) # include "XML_Utils.inl" @@ -135,6 +136,62 @@ CIAO::XML_Utils::parse_componentassembly (const char *filename, return 0; } +int +CIAO::XML_Utils::parse_rtcad_extension (const char *filename, + RTConfiguration::RTORB_Resource_Info &rtr, + RTConfiguration::Policy_Sets &pset) +{ + ACEXML_DefaultHandler *handler = 0; + auto_ptr<ACEXML_DefaultHandler> cleanup_handler (handler); + + ACEXML_FileCharStream *fstm = 0; + ACE_NEW_RETURN (fstm, + ACEXML_FileCharStream (), + 1); + + if (fstm->open (filename) != 0) + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("Fail to open XML file: %s\n"), + filename), + -1); + ACEXML_TRY_NEW_ENV + { + ACEXML_Parser parser; + + ACE_NEW_RETURN (handler, + CIAO::RTConfig_Handler (&parser, + rtr, + pset + ACEXML_ENV_ARG_PARAMETER), + -1); + + ACEXML_InputSource input(fstm); + + parser.setContentHandler (handler); + parser.setDTDHandler (handler); + parser.setErrorHandler (handler); + parser.setEntityResolver (handler); + + parser.parse (&input ACEXML_ENV_ARG_PARAMETER); + ACEXML_TRY_CHECK; + } + ACEXML_CATCH (ACEXML_SAXException, ex) + { + ex.print (); + return -1; + } + ACEXML_CATCHANY + { + ACE_ERROR_RETURN ((LM_ERROR, + "Caught unknown exception.\n"), + -1); + } + ACEXML_ENDTRY; + return 0; +} + + + long CIAO::XML_Utils::get_id_and_cardinality (const char *&id, ACEXML_Attributes *atts diff --git a/TAO/CIAO/tools/XML_Helpers/main.cpp b/TAO/CIAO/tools/XML_Helpers/main.cpp index 06510f08231..46fda5db00c 100644 --- a/TAO/CIAO/tools/XML_Helpers/main.cpp +++ b/TAO/CIAO/tools/XML_Helpers/main.cpp @@ -9,8 +9,9 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) { ACE_TCHAR *softpkg_filename = 0; ACE_TCHAR *assembly_filename = 0; + char * rtcad_filename = 0; - ACE_Get_Opt get_opt (argc, argv, ACE_TEXT ("a:s:")); + ACE_Get_Opt get_opt (argc, argv, ACE_TEXT ("a:s:r:")); ACE_TCHAR c; while ((c = get_opt ()) != -1) @@ -23,16 +24,19 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) case 'a': assembly_filename = get_opt.opt_arg (); break; + case 'r': + rtcad_filename = get_opt.opt_arg (); + break; default: ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("Usage: %s [-f <filename>]\n") - ACE_TEXT (" -f: Specify the svcconf filename\n"), + "Usage: %s [-s <softpkg>]\n\t[-a <assembly>]\n\t" + "[-r <rtcad>]\n", argv[0]), -1); } }; - if (softpkg_filename == 0 && assembly_filename == 0) + if (softpkg_filename == 0 && assembly_filename == 0 && rtcad_filename == 0) ACE_ERROR_RETURN ((LM_ERROR, "No filename specified\n"), -1); if (softpkg_filename != 0) @@ -55,5 +59,19 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) } } + if (rtcad_filename != 0) + { + CIAO::RTConfiguration::RTORB_Resource_Info resources; + CIAO::RTConfiguration::Policy_Sets psets; + + if (CIAO::XML_Utils::parse_rtcad_extension (rtcad_filename, + resources, + psets) == 0) + { + ACE_DEBUG ((LM_DEBUG, "RTCad extension Done.\n")); + } + + } + return 0; } diff --git a/TAO/CIAO/tools/XML_Helpers/test.cad b/TAO/CIAO/tools/XML_Helpers/test.cad new file mode 100644 index 00000000000..30d14d60d59 --- /dev/null +++ b/TAO/CIAO/tools/XML_Helpers/test.cad @@ -0,0 +1,90 @@ +<?xml version="1.0"?> <!-- -*- SGML -*- --> + +<!-- If this file is moved to a different directory, make sure to change the + path to the DTD below. Otherwise the examples won't work. --> +<!DOCTYPE componentassembly SYSTEM "../../docs/XML/componentassembly.dtd"> + +<!-- This file is taken from the OEP/Display example and shows how to --> +<!-- specify the RTCAD extension in a componentassembly file. --> +<!-- Just look for <extension> elements for more info. --> + +<componentassembly id="Single-process HUDisplay assembly"> + <componentfiles> + <componentfile id="com-RateGen"> + <fileinarchive name="RateGen.csd"/> + </componentfile> + <componentfile id="com-GPS"> + <fileinarchive name="GPS.csd"/> + </componentfile> + <componentfile id="com-NavDisplay"> + <fileinarchive name="NavDisplay.csd"/> + </componentfile> + </componentfiles> + + <partitioning> + + <!-- A plain vanilla partition. We don't even need the processcollocation tag here. --> + <homeplacement id="a_RateGenHome"> + <componentfileref idref="com-RateGen"/> + <componentinstantiation id="a_RateGen"> + <registercomponent> + <!-- writeiortofile is a non-standard CIAO extension. --> + <writeiortofile name="rategen.ior"/> + </registercomponent> + </componentinstantiation> + </homeplacement> + + <homeplacement id="a_GPSHome"> + <componentfileref idref="com-GPS"/> + <componentinstantiation id="a_GPS"/> + </homeplacement> + + <processcollocation> + <homeplacement id="a_NavDisplayHome"> + <componentfileref idref="com-NavDisplay"/> + <componentinstantiation id="a_NavDisplay"/> + <extension class="RT-POLICY-SET" origin="CIAO">faster</extension> + </homeplacement> + <extension class="RT-CAD-EXT" origin="CIAO">KOOKOOnest</extension> + <destination>Remote</destination> + </processcollocation> + </partitioning> + + <connections> + + <connectevent> + <consumesport> + <consumesidentifier>Refresh</consumesidentifier> + <componentinstantiationref idref="a_GPS"/> + </consumesport> + <publishesport> + <publishesidentifier>Pulse</publishesidentifier> + <componentinstantiationref idref="a_RateGen"/> + </publishesport> + </connectevent> + + <connectevent> + <consumesport> + <consumesidentifier>Refresh</consumesidentifier> + <componentinstantiationref idref="a_NavDisplay"/> + </consumesport> + <publishesport> + <publishesidentifier>Ready</publishesidentifier> + <componentinstantiationref idref="a_GPS"/> + </publishesport> + </connectevent> + + <connectinterface> + <usesport> + <usesidentifier>GPSLocation</usesidentifier> + <componentinstantiationref idref="a_NavDisplay"/> + </usesport> + <providesport> + <providesidentifier>MyLocation</providesidentifier> + <componentinstantiationref idref="a_GPS"/> + </providesport> + </connectinterface> + + </connections> + +</componentassembly> diff --git a/TAO/CIAO/tools/XML_Helpers/test.rtd b/TAO/CIAO/tools/XML_Helpers/test.rtd new file mode 100644 index 00000000000..f9fa45574cf --- /dev/null +++ b/TAO/CIAO/tools/XML_Helpers/test.rtd @@ -0,0 +1,93 @@ +<?xml version="1.0"?> <!-- -*- SGML -*- --> + +<!-- If this file is moved to a different directory, make sure to change the + path to the DTD below. Otherwise the examples won't work. --> +<!DOCTYPE rtcad_ext SYSTEM "../../docs/XML/ciao_rt_cad_ext.dtd"> + +<!-- Here is a sample real-time cad file extension descriptor. --> +<!-- Take a look at the RTCAD-example.cad to see how to associate --> +<!-- a componentassembly descriptor file with this file and how to --> +<!-- use the policy sets defined in this file. --> + +<rtcad_ext> + + <!-- First, we need to define how we are going to allocate --> + <!-- real-time related resources. --> + <rtresources> + + <threadpoolwithlanes + id="shared_pool" + stacksize="0" + borrowing="no" + buffering="no" + max_buffer="0" + buffer_size="0"> + <lane priority="1" + static_threads="100" + dynamic_threads="300"/> + <lane priority="2" + static_threads="2" + dynamic_threads="2"/> + <lane priority="3" + static_threads="1" + dynamic_threads="2"/> + </threadpoolwithlanes> + + <threadpool id="common_pool" + stacksize="0" + static_threads="10" + dynamic_threads="20" + priority="2" + buffering="no" + max_buffer="0" + buffer_size="0"/> + + <threadpool id="high_prio_pool" + stacksize="0" + static_threads="2" + dynamic_threads="2" + priority="3" + buffering="no" + max_buffer="0" + buffer_size="0"/> + + <threadpoolwithlanes + id="laned_pool" + stacksize="0" + borrowing="no" + buffering="no" + max_buffer="0" + buffer_size="0"> + <lane priority="1" + static_threads="10" + dynamic_threads="30"/> + <lane priority="2" + static_threads="3" + dynamic_threads="3"/> + <lane priority="3" + static_threads="1" + dynamic_threads="2"/> + </threadpoolwithlanes> + + <connectionbands id="common_conn"> + <band low="1" high="1"/> + <band low="2" high="2"/> + <band low="3" high="3000"/> + </connectionbands> + </rtresources> + + <!-- Then, we define sets of policies that can be associated with --> + <!-- containers (or <homeplacement> rather) --> + + <rtpolicyset id="POLICY_1"> + <priority_model_policy type="server_declared" priority="20"/> + <threadpool_policy idref="shared_bool"/> + <banded_connection_policy idref="common_conn"/> + </rtpolicyset> + + <rtpolicyset id="POLICY_2"> + <threadpool_policy idref="common_pool"/> + <priority_model_policy type="client_propagated" priority="10"/> + </rtpolicyset> + +</rtcad_ext>
\ No newline at end of file |