[ 
https://issues.apache.org/jira/browse/TUSCANY-1383?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Brady Johnson updated TUSCANY-1383:
-----------------------------------

    Attachment: WSDLDefinition_cpp_jira1383

Attaching WSDLDefinition.cpp

> Tuscany SCA native/C++ : Ability to query the runtime for its loaded 
> operations
> -------------------------------------------------------------------------------
>
>                 Key: TUSCANY-1383
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1383
>             Project: Tuscany
>          Issue Type: Improvement
>          Components: C++ SCA
>    Affects Versions: Cpp-M3
>         Environment: API enhancement - all platforms
>            Reporter: Brady Johnson
>            Priority: Minor
>             Fix For: Cpp-Next
>
>         Attachments: Composite_cpp_jira1383, Composite_h_jira1383, 
> WSDLDefinition_cpp_jira1383, WSDLDefinition_h_jira1383
>
>
> Im investigating using TuscanySCA (C++ version) with a container other 
> than Axis. To do this, the container needs to be able to obtain the 
> WSDL operations, types, etc loaded by Tuscany. I would like to propose 
> extending some of the Tuscany APIs to allow them to be queried, since 
> currently you can only do a find with a known operation name. These 
> query operations could be done either by returning an iterator to the
> internal map, or by just returning a list of map's value strings. The
> second option would probably be safer and more thread-safe. 
> Here are the additions that I propose adding:
> runtime/core/src/tuscany/sca/model/Composite.h
>    std::list<std::string> getIncludedComposites(); 
>    Composite* findIncludedComposite(const std::string& compositeName);
>    std::list<std::string> Composite::getWSDLNamespaces();
>    Change 
>      std::vector<Composite*> includes;
>    To 
>      std::map<std::string, Composite> includes;
> runtime/core/src/tuscany/sca/model/WSDLDefinition.h
>    std::list<std::string> WSDLDefinition::getPortTypes();
>    std::list<std::string> WSDLDefinition::getOperations( const std::string 
> &portTypeName );
> The suggested usage of and rationale behind these additions is as follows:
> Once the projects have been loaded by calling:
>    tuscany::sca::SCARuntime::initializeSharedRuntime( .. )
> The system composite can then be obtained by calling:
>    tuscany::sca::model::Composite* SCARuntime::getSystem();
> The system composite doesnt usually contain much other than included 
> composites, so first iterate
> over the composites included in the system composite with these additions to 
> the Composite class:
>    std::list<std::string> compositeList = 
> systemComposite->getIncludedComposites();
>    tuscany::sca::model::Composite* includedComposite = 
> findIncludedComposite(const std::string& compositeName);
> In order to make this easier, the tuscany::sca::model::Composite::includes 
> data member should be changed from a
> vector to a map, which would map from the composite name to the composite. As 
> it is now, it would be necessary to
> return the actual includes vector, which isnt generally a good idea since 
> users could inadvertantly corrupt it.
> For each included composite, this addition to the Composite class would allow 
> you to get all of the 
> WSDL namespaces loaded for a Composite.
>    std::list<std::string> wsdlNSList = includedComposite->getWSDLNamespaces();
> The WSDLDefinition can then be obtained by calling:
>    WSDLDefinition* wsdlDef = includedComposite->findWSDLDefinition( 
> wsdlNamespace );
> Then, for each WSDLDefinition, you can iterate over all of the WSDL PortTypes 
> and PortType operations
> with these additions to the WSDLDefinition class:
>    std::list<std::string> wsdlPortTypeList = wsdlDef->getPortTypes();
>    std::list<std::string> wsdlPortTypeOpList = wsdlDef->getOperations( 
> portTypeName );
> Now get the WSDLOperation:
>    WSDLOperation wsdlOp = wsdlDef->findOperation( portTypeName, operName );
> Im not currently a TuscanySCA contributor, so can someone please submit the 
> attached patch?
> Thanks
> --------------------
> Brady Johnson
> Rogue Wave Software - [EMAIL PROTECTED]
> Lead Software Developer - HydraSCA

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to