tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsdelf...@apache.org
Subject svn commit: r440631 - 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/python/src/ extensions/python/src/osoa/sca/ extensions/python/src/tuscany/...
Date Wed, 06 Sep 2006 06:29:32 GMT
Author: jsdelfino
Date: Tue Sep  5 23:29:31 2006
New Revision: 440631

URL: http://svn.apache.org/viewvc?view=rev&rev=440631
Log:
Moved remotable and scope from CPPInterface to Interface, removed dependency on CPP from the
Python extension

Removed:
    incubator/tuscany/cpp/sca/runtime/extensions/python/src/osoa/sca/export.h
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/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/CPPInterface.cpp
    incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.h
    incubator/tuscany/cpp/sca/runtime/extensions/python/src/Makefile.am
    incubator/tuscany/cpp/sca/runtime/extensions/python/src/osoa/sca/ServiceRuntimeException.h
    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

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=440631&r1=440630&r2=440631
==============================================================================
--- 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 Tue Sep  5
23:29:31 2006
@@ -30,7 +30,8 @@
         {
 
             // Constructor
-            Interface::Interface()
+            Interface::Interface(bool remotable, Scope scope)
+                : remotable(remotable), scope(scope)
             {
             }
 

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=440631&r1=440630&r2=440631
==============================================================================
--- 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 Tue Sep  5 23:29:31
2006
@@ -35,11 +35,49 @@
                 
             public:
                 
-                SCA_API Interface();
+                /**
+                 * Scope of the interface.
+                 */
+                enum Scope
+                {
+                    COMPOSITE,
+                    STATELESS
+                };
+
+                /**
+                 * Constructor
+                 */
+                SCA_API Interface(bool remotable, Scope scope);
                   
+                /**
+                 * Destructor
+                 */
                 SCA_API virtual ~Interface();
+                
+                /**
+                 * Returns true if the interface is remotable.
+                 * @return True if the interface is remotable.
+                 */
+                bool isRemotable() const { return remotable; };
                             
+                /**
+                 * Get the scope of the interface.
+                 * @return The scope of the interface.
+                 */
+                 Scope getScope() { return scope; }
+
             private:
+
+                /**
+                 * True if the interface is remotable
+                 */            
+                bool remotable;
+
+                /**
+                 * Scope of the interface.
+                 */
+                Scope scope;
+
             };
             
         } // End namespace model

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=440631&r1=440630&r2=440631
==============================================================================
--- 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
Tue Sep  5 23:29:31 2006
@@ -60,9 +60,18 @@
                 {
                     string header = scdlInterface->getCString("header");
                     string className = scdlInterface->getCString("class");
-                    string scope = scdlInterface->getCString("scope");
+                    string scopeName = scdlInterface->getCString("scope");
                     bool remotable = scdlInterface->getBoolean("remotable");
                     
+                    Interface::Scope scope;
+                    if (scopeName == "composite")
+                    {
+                        scope = Interface::COMPOSITE;
+                    }
+                    else
+                    {
+                        scope = Interface::STATELESS;
+                    }
                     return new CPPInterface(header, className, scope, remotable);
                 }
                 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=440631&r1=440630&r2=440631
==============================================================================
--- 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
Tue Sep  5 23:29:31 2006
@@ -29,7 +29,7 @@
 #include "tuscany/sca/model/ServiceType.h"
 #include "tuscany/sca/core/SCARuntime.h"
 #include "tuscany/sca/cpp/model/CPPImplementation.h"
-#include "tuscany/sca/cpp/model/CPPInterface.h"
+#include "tuscany/sca/model/Interface.h"
 
 using namespace osoa::sca;
 
@@ -55,8 +55,8 @@
                 LOGENTRY(1,"CPPServiceWrapper::constructor");
     
                 component = service->getComponent();
-                interf = (CPPInterface*)service->getType()->getInterface();
-                remotable = interf->getRemotable();
+                interf = service->getType()->getInterface();
+                remotable = interf->isRemotable();
                 
                 LOGEXIT(1,"CPPServiceWrapper::constructor");
                 
@@ -77,8 +77,7 @@
             // ======================================================================
             void* CPPServiceWrapper::getImplementation()
             {
-                CPPInterface::SCOPE scope = interf->getScope();
-                if (scope == CPPInterface::COMPOSITE)
+                if (interf->getScope() == Interface::COMPOSITE)
                 {
                     if (!staticImpl)
                     {
@@ -97,8 +96,7 @@
             // ======================================================================
             void CPPServiceWrapper::releaseImplementation()
             {
-                CPPInterface::SCOPE scope = interf->getScope();
-                if (scope == CPPInterface::STATELESS)
+                if (interf->getScope() == Interface::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=440631&r1=440630&r2=440631
==============================================================================
--- 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
Tue Sep  5 23:29:31 2006
@@ -24,6 +24,7 @@
 #include "tuscany/sca/core/ServiceWrapper.h"
 #include "tuscany/sca/core/Operation.h"
 #include "tuscany/sca/model/Component.h"
+#include "tuscany/sca/model/Interface.h"
 #include "tuscany/sca/util/Library.h"
 
 using namespace tuscany::sca::model;
@@ -35,7 +36,6 @@
     {
         namespace cpp
         {
-            class CPPInterface;
             
             /**
              * Wraps the service on a component implementation.
@@ -131,7 +131,7 @@
                 /**
                  * A pointer to the interface which the service exposes.
                  */
-                CPPInterface* interf;
+                Interface* interf;
     
                 /**
                  * Set to true if the service is remotable.

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=440631&r1=440630&r2=440631
==============================================================================
--- 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
Tue Sep  5 23:29:31 2006
@@ -33,9 +33,9 @@
                 CPPInterface::CPPInterface(
                     const string& header,
                     const string& className,
-                    const string& scop,
+                    Scope scope,
                     bool remotable)  
-                    : header(header), className(className), remotable(remotable)
+                    : Interface(remotable, scope), header(header), className(className)
             {
                 string::size_type dot = header.rfind(".h"); // this will also find .hpp
                 if (dot != string::npos)
@@ -47,14 +47,6 @@
                     headerStub = header;
                 }
 
-                if (scop == "composite")
-                {
-                    scope = COMPOSITE;
-                }
-                else
-                {
-                    scope = STATELESS;
-                }
            }
 
             CPPInterface::~CPPInterface()

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=440631&r1=440630&r2=440631
==============================================================================
--- 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
Tue Sep  5 23:29:31 2006
@@ -55,7 +55,7 @@
                 CPPInterface(
                     const string& header,
                     const string& className,
-                    const string& scope,
+                    Scope scope,
                     bool remotable);  
 
                 /**
@@ -82,27 +82,6 @@
                  */
                 const string& getClass() { return className; }
 
-                /**
-                 * Scope of interface.
-                 */
-                enum SCOPE
-                {
-                    COMPOSITE,
-                    STATELESS
-                };
-
-                /**
-                 * Get the scope of the interface.
-                 * @return The scope of the interface.
-                 */
-                 SCOPE getScope() { return scope; }
-
-                /**
-                 * Return whether the interface is remotable or local.
-                 * @return True if the interface is remotable, otherwise false.
-                 */
-                bool  getRemotable() { return remotable; }
-
            private:
            
                 /**
@@ -120,15 +99,6 @@
                  */
                 string className;
 
-                /**
-                 * Scope of the interface.
-                 */
-                SCOPE scope;
-
-                /**
-                 * Remotable interface or not.
-                 */
-                bool remotable;
             };
             
         } // End namespace cpp

Modified: incubator/tuscany/cpp/sca/runtime/extensions/python/src/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/python/src/Makefile.am?view=diff&rev=440631&r1=440630&r2=440631
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/python/src/Makefile.am (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/python/src/Makefile.am Tue Sep  5 23:29:31
2006
@@ -2,7 +2,6 @@
 lib_LTLIBRARIES = libtuscany_sca_python.la
 includedir=$(prefix)/extensions/python/include
 nobase_include_HEADERS = \
-osoa/sca/*.h \
 tuscany/sca/python/*.h \
 tuscany/sca/python/model/*.h
 
@@ -15,12 +14,10 @@
 
 libtuscany_sca_python_la_LIBADD = -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo \
 	-L$(top_builddir)/runtime/core/src -ltuscany_sca \
-	-L$(top_builddir)/runtime/extensions/cpp/src -ltuscany_sca_cpp \
 	-L${PYTHON_LIB} -lpython2.3
 
 INCLUDES = -Imodel -I$(top_builddir)/runtime/core/src \
            -I${TUSCANY_SDOCPP}/include \
-           -I$(top_builddir)/runtime/extensions/cpp/src \
            -I${PYTHON_INCLUDE}
                    
 AM_CPPFLAGS = $(CPPFLAGS) -D_DEBUG

Modified: incubator/tuscany/cpp/sca/runtime/extensions/python/src/osoa/sca/ServiceRuntimeException.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/python/src/osoa/sca/ServiceRuntimeException.h?view=diff&rev=440631&r1=440630&r2=440631
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/python/src/osoa/sca/ServiceRuntimeException.h
(original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/python/src/osoa/sca/ServiceRuntimeException.h
Tue Sep  5 23:29:31 2006
@@ -20,7 +20,7 @@
 #ifndef osoa_sca_serviceruntimeexception_h
 #define osoa_sca_serviceruntimeexception_h
 
-#include "osoa/sca/export.h"
+#include "tuscany/sca/export.h"
 
 #include "tuscany/sca/util/Exceptions.h"
 using tuscany::sca::TuscanyRuntimeException;
@@ -32,7 +32,7 @@
          * Top level exception to represent all the exceptions that may be 
          * thrown by an SCA runtime implementation.
          */
-        class SCA_PYTHON_API ServiceRuntimeException : public TuscanyRuntimeException
+        class SCA_API ServiceRuntimeException : public TuscanyRuntimeException
         {
         public:
             ServiceRuntimeException(
@@ -49,7 +49,7 @@
          * A remotable service is currently unavailable. It is possible that a retry
          * may resolve this exception.
          */
-        class SCA_PYTHON_API ServiceUnavailableException: public ServiceRuntimeException
+        class SCA_API ServiceUnavailableException: public ServiceRuntimeException
         {
         public:
             ServiceUnavailableException(const char* serviceName)
@@ -65,7 +65,7 @@
          * The target of a wire cannot be found, or the reference has not been
          * configured.
          */
-        class SCA_PYTHON_API ServiceNotFoundException: public ServiceRuntimeException
+        class SCA_API ServiceNotFoundException: public ServiceRuntimeException
         {
         public:
             ServiceNotFoundException(const char* msg)
@@ -81,7 +81,7 @@
          * There is no current component (for example, if a non-SCA component
          * tries to get the current ComponentContext).
          */
-        class SCA_PYTHON_API ComponentContextException: public ServiceRuntimeException
+        class SCA_API ComponentContextException: public ServiceRuntimeException
         {
         public:
             ComponentContextException(const char* msg)
@@ -95,7 +95,7 @@
         /**
          * There is an error whilst trying to invoke a component.
          */
-        class SCA_PYTHON_API ComponentInvocationException: public ServiceRuntimeException
+        class SCA_API ComponentInvocationException: public ServiceRuntimeException
         {
         public:
             ComponentInvocationException(const char* msg)

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=440631&r1=440630&r2=440631
==============================================================================
--- 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
Tue Sep  5 23:29:31 2006
@@ -25,9 +25,9 @@
 #include "tuscany/sca/model/Component.h"
 #include "tuscany/sca/model/Composite.h"
 #include "tuscany/sca/model/ServiceType.h"
+#include "tuscany/sca/model/Interface.h"
 #include "tuscany/sca/core/SCARuntime.h"
 #include "tuscany/sca/python/model/PythonImplementation.h"
-#include "tuscany/sca/cpp/model/CPPInterface.h"
 
 using namespace osoa::sca;
 
@@ -64,8 +64,8 @@
                 LOGENTRY(1,"PythonServiceWrapper::constructor");
     
                 component = service->getComponent();
-                interf = (CPPInterface*)service->getType()->getInterface();
-                remotable = interf->getRemotable();                
+                interf = service->getType()->getInterface();
+                remotable = interf->isRemotable();                
 
                 pythonModule = NULL;
                 pythonClassInstance = NULL;
@@ -202,9 +202,8 @@
             {
                 LOGENTRY(1,"PythonServiceWrapper::getInstance");
 
-                CPPInterface::SCOPE scope = interf->getScope();
-
-                if (scope == CPPInterface::COMPOSITE)
+                Interface::Scope scope = interf->getScope();
+                if (scope == Interface::COMPOSITE)
                 {
                     if (!pythonClassInstance)
                     {
@@ -225,9 +224,9 @@
             void PythonServiceWrapper::releaseInstance()
             {
                 LOGENTRY(1,"PythonServiceWrapper::releaseInstance");
-                CPPInterface::SCOPE scope = interf->getScope();
-
-                if(scope == CPPInterface::STATELESS)
+                
+                Interface::Scope scope = interf->getScope();
+                if(scope == Interface::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=440631&r1=440630&r2=440631
==============================================================================
--- 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
Tue Sep  5 23:29:31 2006
@@ -21,15 +21,12 @@
 #define tuscany_sca_python_pythonservicewrapper_h
 
 
-#include "osoa/sca/export.h"
 #include "tuscany/sca/core/ServiceWrapper.h"
 #include "tuscany/sca/core/Operation.h"
 #include "tuscany/sca/model/Component.h"
-
-#include "tuscany/sca/cpp/model/CPPInterface.h"
+#include "tuscany/sca/model/Interface.h"
 
 using namespace tuscany::sca::model;
-using tuscany::sca::cpp::CPPInterface;
 
 #include <Python.h>
 
@@ -49,7 +46,7 @@
              * An instance of this class wraps the actual component implementation which

              * has been written by a developer of an SCA application.
              */
-            class SCA_PYTHON_API PythonServiceWrapper : public ServiceWrapper
+            class SCA_API PythonServiceWrapper : public ServiceWrapper
             {
             public:
                 /**
@@ -126,7 +123,7 @@
                 /**
                  * A pointer to the interface which the service exposes.
                  */
-                CPPInterface* interf;
+                Interface* interf;
 
             };
             



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


Mime
View raw message