You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2006/09/09 04:29:28 UTC

svn commit: r441727 - in /incubator/tuscany/cpp/sca/runtime: core/src/tuscany/sca/model/ extensions/cpp/src/tuscany/sca/cpp/ extensions/cpp/src/tuscany/sca/cpp/model/ extensions/cpp/xsd/ extensions/python/src/tuscany/sca/python/ extensions/python/src/t...

Author: jsdelfino
Date: Fri Sep  8 19:29:26 2006
New Revision: 441727

URL: http://svn.apache.org/viewvc?view=rev&rev=441727
Log:
Moved scope from interface to implementation, and added a conversational attribute to interface

Modified:
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Interface.cpp
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Interface.h
    incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.cpp
    incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPInterfaceExtension.cpp
    incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.cpp
    incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.h
    incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.cpp
    incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.h
    incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.cpp
    incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.h
    incubator/tuscany/cpp/sca/runtime/extensions/cpp/xsd/sca-implementation-cpp.xsd
    incubator/tuscany/cpp/sca/runtime/extensions/cpp/xsd/sca-interface-cpp.xsd
    incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonImplementationExtension.cpp
    incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp
    incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.h
    incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.cpp
    incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.h
    incubator/tuscany/cpp/sca/runtime/extensions/python/xsd/sca-implementation-python.xsd

Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Interface.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Interface.cpp?view=diff&rev=441727&r1=441726&r2=441727
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Interface.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Interface.cpp Fri Sep  8 19:29:26 2006
@@ -30,8 +30,8 @@
         {
 
             // Constructor
-            Interface::Interface(bool remotable, Scope scope)
-                : remotable(remotable), scope(scope)
+            Interface::Interface(bool remotable, bool conversational)
+                : remotable(remotable), conversational(conversational)
             {
             }
 

Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Interface.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Interface.h?view=diff&rev=441727&r1=441726&r2=441727
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Interface.h (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Interface.h Fri Sep  8 19:29:26 2006
@@ -36,18 +36,9 @@
             public:
                 
                 /**
-                 * Scope of the interface.
-                 */
-                enum Scope
-                {
-                    COMPOSITE,
-                    STATELESS
-                };
-
-                /**
                  * Constructor
                  */
-                SCA_API Interface(bool remotable, Scope scope);
+                SCA_API Interface(bool remotable, bool conversational);
                   
                 /**
                  * Destructor
@@ -58,14 +49,14 @@
                  * Returns true if the interface is remotable.
                  * @return True if the interface is remotable.
                  */
-                bool isRemotable() const { return remotable; };
+                SCA_API bool isRemotable() const { return remotable; };
                             
                 /**
-                 * Get the scope of the interface.
-                 * @return The scope of the interface.
+                 * Returns true if the interface is conversational.
+                 * @return True if the interface is conversational.
                  */
-                 Scope getScope() { return scope; }
-
+                SCA_API bool isConversational() const { return conversational; };
+                            
             private:
 
                 /**
@@ -74,9 +65,9 @@
                 bool remotable;
 
                 /**
-                 * Scope of the interface.
-                 */
-                Scope scope;
+                 * True if the interface is conversational
+                 */            
+                bool conversational;
 
             };
             

Modified: incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.cpp?view=diff&rev=441727&r1=441726&r2=441727
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.cpp Fri Sep  8 19:29:26 2006
@@ -61,6 +61,17 @@
                     string library = scdlImplementation->getCString("library");
                     string header = scdlImplementation->getCString("header");
                     string className = scdlImplementation->getCString("class");
+                    string scopeName = scdlImplementation->getCString("scope");
+
+                    CPPImplementation::Scope scope;
+                    if (scopeName == "composite")
+                    {
+                        scope = CPPImplementation::COMPOSITE;
+                    }
+                    else
+                    {
+                        scope = CPPImplementation::STATELESS;
+                    }
 
                     string headerPath;
                     string headerStub;
@@ -76,7 +87,8 @@
                     string tmp;             
                     Utils::rTokeniseString(".h", headerStub, headerStub, tmp);
                     
-                    CPPImplementation* cppImpl = new CPPImplementation(library, header, headerPath, headerStub, className);
+                    CPPImplementation* cppImpl = new CPPImplementation(
+                                    library, header, headerPath, headerStub, className, scope);
                     
                     return cppImpl;
                 }

Modified: incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPInterfaceExtension.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPInterfaceExtension.cpp?view=diff&rev=441727&r1=441726&r2=441727
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPInterfaceExtension.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPInterfaceExtension.cpp Fri Sep  8 19:29:26 2006
@@ -60,19 +60,10 @@
                 {
                     string header = scdlInterface->getCString("header");
                     string className = scdlInterface->getCString("class");
-                    string scopeName = scdlInterface->getCString("scope");
                     bool remotable = scdlInterface->getBoolean("remotable");
+                    bool conversational = scdlInterface->getBoolean("conversational");
                     
-                    Interface::Scope scope;
-                    if (scopeName == "composite")
-                    {
-                        scope = Interface::COMPOSITE;
-                    }
-                    else
-                    {
-                        scope = Interface::STATELESS;
-                    }
-                    return new CPPInterface(header, className, scope, remotable);
+                    return new CPPInterface(header, className, remotable, conversational);
                 }
                 return 0;
             }

Modified: incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.cpp?view=diff&rev=441727&r1=441726&r2=441727
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.cpp Fri Sep  8 19:29:26 2006
@@ -56,7 +56,7 @@
     
                 component = service->getComponent();
                 interf = service->getType()->getInterface();
-                remotable = interf->isRemotable();
+                implementation = (CPPImplementation*)component->getType();
                 
                 LOGEXIT(1,"CPPServiceWrapper::constructor");
                 
@@ -77,7 +77,7 @@
             // ======================================================================
             void* CPPServiceWrapper::getImplementation()
             {
-                if (interf->getScope() == Interface::COMPOSITE)
+                if (implementation->getScope() == CPPImplementation::COMPOSITE)
                 {
                     if (!staticImpl)
                     {
@@ -96,7 +96,7 @@
             // ======================================================================
             void CPPServiceWrapper::releaseImplementation()
             {
-                if (interf->getScope() == Interface::STATELESS)
+                if (implementation->getScope() == CPPImplementation::STATELESS)
                 {
                     deleteImplementation();
                 }            

Modified: incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.h?view=diff&rev=441727&r1=441726&r2=441727
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.h (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.h Fri Sep  8 19:29:26 2006
@@ -25,6 +25,7 @@
 #include "tuscany/sca/core/Operation.h"
 #include "tuscany/sca/model/Component.h"
 #include "tuscany/sca/model/Interface.h"
+#include "tuscany/sca/cpp/model/CPPImplementation.h"
 #include "tuscany/sca/util/Library.h"
 
 using namespace tuscany::sca::model;
@@ -134,9 +135,9 @@
                 Interface* interf;
     
                 /**
-                 * Set to true if the service is remotable.
+                 * The component implementation
                  */
-                bool remotable;
+                 CPPImplementation* implementation;
                 
                 /**
                  * Pointer to the loaded library which contains the component

Modified: incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.cpp?view=diff&rev=441727&r1=441726&r2=441727
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.cpp Fri Sep  8 19:29:26 2006
@@ -36,10 +36,10 @@
 
             // Constructor
             CPPImplementation::CPPImplementation(const string& library, const string& header,
-                    const string&headerPath, const string& headerStub, const string& className)
+                    const string&headerPath, const string& headerStub, const string& className, Scope scope)
                 : ComponentType(headerPath + headerStub),
                     library(library), header(header), headerPath(headerPath),
-                    headerStub(headerStub), className(className)
+                    headerStub(headerStub), className(className), scope(scope)
             {
             }
 

Modified: incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.h?view=diff&rev=441727&r1=441726&r2=441727
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.h (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.h Fri Sep  8 19:29:26 2006
@@ -42,6 +42,15 @@
                 
             public:
                 /**
+                 * Scope of the component implementation.
+                 */
+                enum Scope
+                {
+                    COMPOSITE,
+                    STATELESS
+                };
+
+                /**
                  * Constructor.
                  * @param dllName Name of the shared library.
                  * @param header Name of the header file that contains the class declaring the 
@@ -50,7 +59,7 @@
                  * if this is not specified).
                  */
                 CPPImplementation(const string& library, const string& header, const string&headerPath,
-                        const string& headerStub, const string& className);
+                        const string& headerStub, const string& className, Scope scope);
                 
                 /**
                  * Destructor
@@ -93,6 +102,11 @@
                  */
                 const string& getClass() const { return className; }
                 
+                /**
+                 * Returns the implementation scope
+                 */
+                 Scope getScope() { return scope; }
+                
             private:
                 
                 /**
@@ -120,6 +134,11 @@
                  * May be an empty string if not set in the SCDL file.
                  */
                 string className;
+                
+                /**
+                 * Scope of the implementation
+                 */
+                Scope scope;
             };
             
         } // End namespace cpp

Modified: incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.cpp?view=diff&rev=441727&r1=441726&r2=441727
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.cpp Fri Sep  8 19:29:26 2006
@@ -33,9 +33,9 @@
                 CPPInterface::CPPInterface(
                     const string& header,
                     const string& className,
-                    Scope scope,
-                    bool remotable)  
-                    : Interface(remotable, scope), header(header), className(className)
+                    bool remotable,
+                    bool conversational)  
+                    : Interface(remotable, conversational), header(header), className(className)
             {
                 string::size_type dot = header.rfind(".h"); // this will also find .hpp
                 if (dot != string::npos)

Modified: incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.h?view=diff&rev=441727&r1=441726&r2=441727
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.h (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.h Fri Sep  8 19:29:26 2006
@@ -55,8 +55,8 @@
                 CPPInterface(
                     const string& header,
                     const string& className,
-                    Scope scope,
-                    bool remotable);  
+                    bool remotable,
+                    bool conversational);  
 
                 /**
                  * Destructor.

Modified: incubator/tuscany/cpp/sca/runtime/extensions/cpp/xsd/sca-implementation-cpp.xsd
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/cpp/xsd/sca-implementation-cpp.xsd?view=diff&rev=441727&r1=441726&r2=441727
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/cpp/xsd/sca-implementation-cpp.xsd (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/cpp/xsd/sca-implementation-cpp.xsd Fri Sep  8 19:29:26 2006
@@ -30,8 +30,16 @@
 				<attribute name="path" type="NCName" use="optional"/>
                 <attribute name="header" type="NCName" use="required"/>
                 <attribute name="class" type="Name" use="optional"/>
+                <attribute name="scope" type="sca:CPPImplementationScope" use="optional" />
 				<anyAttribute namespace="##any" processContents="lax"/>
 			</extension>
 		</complexContent>
 	</complexType>
+
+    <simpleType name="CPPImplementationScope">
+        <restriction base="string">
+            <enumeration value="stateless" />
+            <enumeration value="composite" />
+        </restriction>
+    </simpleType>
 </schema>

Modified: incubator/tuscany/cpp/sca/runtime/extensions/cpp/xsd/sca-interface-cpp.xsd
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/cpp/xsd/sca-interface-cpp.xsd?view=diff&rev=441727&r1=441726&r2=441727
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/cpp/xsd/sca-interface-cpp.xsd (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/cpp/xsd/sca-interface-cpp.xsd Fri Sep  8 19:29:26 2006
@@ -30,17 +30,11 @@
                 <attribute name="class" type="Name" use="optional" />
                 <attribute name="callbackHeader" type="NCName" use="optional" />
                 <attribute name="callbackClass" type="Name" use="optional" />
-                <attribute name="scope" type="sca:CPPScope" use="optional" />
                 <attribute name="remotable" type="boolean" use="optional" />
+                <attribute name="conversational" type="boolean" use="optional" />
                 <anyAttribute namespace="##any" processContents="lax" />
             </extension>
         </complexContent>
     </complexType>
     
-    <simpleType name="CPPScope">
-        <restriction base="string">
-            <enumeration value="stateless" />
-            <enumeration value="composite" />
-        </restriction>
-    </simpleType>
 </schema>

Modified: incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonImplementationExtension.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonImplementationExtension.cpp?view=diff&rev=441727&r1=441726&r2=441727
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonImplementationExtension.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonImplementationExtension.cpp Fri Sep  8 19:29:26 2006
@@ -61,8 +61,19 @@
                     string module = scdlImplementation->getCString("module");
                     string path = scdlImplementation->getCString("path");
                     string className = scdlImplementation->getCString("class");
+                    string scopeName = scdlImplementation->getCString("scope");
                     
-                    PythonImplementation* pythonImpl = new PythonImplementation(module, path, className);
+                    PythonImplementation::Scope scope;
+                    if (scopeName == "composite")
+                    {
+                        scope = PythonImplementation::COMPOSITE;
+                    }
+                    else
+                    {
+                        scope = PythonImplementation::STATELESS;
+                    }
+
+                    PythonImplementation* pythonImpl = new PythonImplementation(module, path, className, scope);
                     
                     return pythonImpl;
                 }

Modified: incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp?view=diff&rev=441727&r1=441726&r2=441727
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp Fri Sep  8 19:29:26 2006
@@ -65,7 +65,7 @@
     
                 component = service->getComponent();
                 interf = service->getType()->getInterface();
-                remotable = interf->isRemotable();                
+                implementation = (PythonImplementation*)component->getType();              
 
                 pythonModule = NULL;
                 pythonClassInstance = NULL;
@@ -202,8 +202,8 @@
             {
                 LOGENTRY(1,"PythonServiceWrapper::getInstance");
 
-                Interface::Scope scope = interf->getScope();
-                if (scope == Interface::COMPOSITE)
+                PythonImplementation::Scope scope = implementation->getScope();
+                if (scope == PythonImplementation::COMPOSITE)
                 {
                     if (!pythonClassInstance)
                     {
@@ -211,7 +211,7 @@
                     }
                     return pythonClassInstance;
                 }
-                else // (scope == CPPInterface::STATELESS)
+                else // (scope == PythonImplementation::STATELESS)
                 {
                     return newInstance();
                 }        
@@ -225,8 +225,8 @@
             {
                 LOGENTRY(1,"PythonServiceWrapper::releaseInstance");
                 
-                Interface::Scope scope = interf->getScope();
-                if(scope == Interface::STATELESS)
+                PythonImplementation::Scope scope = implementation->getScope();
+                if(scope == PythonImplementation::STATELESS)
                 {
                     // Delete the class instance if there is one
                     if(pythonClassInstance != NULL && PyInstance_Check(pythonClassInstance))

Modified: incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.h?view=diff&rev=441727&r1=441726&r2=441727
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.h (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.h Fri Sep  8 19:29:26 2006
@@ -25,6 +25,7 @@
 #include "tuscany/sca/core/Operation.h"
 #include "tuscany/sca/model/Component.h"
 #include "tuscany/sca/model/Interface.h"
+#include "tuscany/sca/python/model/PythonImplementation.h"
 
 using namespace tuscany::sca::model;
 
@@ -116,15 +117,15 @@
                 Component* component;
     
                 /**
-                 * Set to true if the service is remotable.
-                 */
-                bool remotable;                
-
-                /**
                  * A pointer to the interface which the service exposes.
                  */
                 Interface* interf;
 
+                /**
+                 * The component implementation
+                 */
+                 PythonImplementation* implementation;
+                
             };
             
         } // End namespace python

Modified: incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.cpp?view=diff&rev=441727&r1=441726&r2=441727
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.cpp Fri Sep  8 19:29:26 2006
@@ -35,9 +35,10 @@
         {
 
             // Constructor
-            PythonImplementation::PythonImplementation(const string& module, const string& modulePath, const string& className)
+            PythonImplementation::PythonImplementation(
+                const string& module, const string& modulePath, const string& className, Scope scope)
                 : ComponentType(modulePath + "/" + module),
-                    module(module), modulePath(modulePath), className(className)
+                    module(module), modulePath(modulePath), className(className), scope(scope)
             {
                 LOGENTRY(1,"PythonImplementation::constructor");
                 LOGEXIT(1,"PythonImplementation::constructor");

Modified: incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.h?view=diff&rev=441727&r1=441726&r2=441727
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.h (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.h Fri Sep  8 19:29:26 2006
@@ -42,6 +42,15 @@
                 
             public:
                 /**
+                 * Scope of the component implementation.
+                 */
+                enum Scope
+                {
+                    COMPOSITE,
+                    STATELESS
+                };
+
+                /**
                  * Constructor.
                  * @param module Name of the module.
                  * @param modulePath Path to the module (could be a blank string
@@ -49,7 +58,7 @@
                  * @param className Name of the class in the module (could be a blank string
                  * if this is not specified).
                  */
-                PythonImplementation(const string& module, const string& modulePath, const string& className);
+                PythonImplementation(const string& module, const string& modulePath, const string& className, Scope scope);
                 
                 /**
                  * Destructor
@@ -80,6 +89,11 @@
                  */
                 const string& getClass() const { return className; }
                 
+                /**
+                 * Returns the implementation scope
+                 */
+                 Scope getScope() const { return scope; }
+                
             private:
                 
                 /**
@@ -97,6 +111,11 @@
                  * May be an empty string if not set in the SCDL file.
                  */
                 string className;
+                
+                /**
+                 * The implementation scope
+                 */
+                 Scope scope;
             };
             
         } // End namespace python

Modified: incubator/tuscany/cpp/sca/runtime/extensions/python/xsd/sca-implementation-python.xsd
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/python/xsd/sca-implementation-python.xsd?view=diff&rev=441727&r1=441726&r2=441727
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/python/xsd/sca-implementation-python.xsd (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/python/xsd/sca-implementation-python.xsd Fri Sep  8 19:29:26 2006
@@ -29,8 +29,16 @@
 				<attribute name="module" type="NCName" use="required"/>
 				<attribute name="path" type="NCName" use="optional"/>
                 <attribute name="class" type="Name" use="optional"/>
+                <attribute name="scope" type="sca:PythonImplementationScope" use="optional" />
 				<anyAttribute namespace="##any" processContents="lax"/>
 			</extension>
 		</complexContent>
 	</complexType>
+
+    <simpleType name="PythonImplementationScope">
+        <restriction base="string">
+            <enumeration value="stateless" />
+            <enumeration value="composite" />
+        </restriction>
+    </simpleType>
 </schema>



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org