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

svn commit: r432505 - in /incubator/tuscany/sandbox/robbinspg: ./ sca/ sca/deploy/extensions/ sca/deploy/include/tuscany/sca/extension/ sca/projects/tuscany_sca/ sca/projects/tuscany_sca/tuscany_sca/ sca/runtime/core/src/osoa/sca/ sca/runtime/core/src/...

Author: robbinspg
Date: Fri Aug 18 00:09:41 2006
New Revision: 432505

URL: http://svn.apache.org/viewvc?rev=432505&view=rev
Log:
create sandbox are to experiment with restructuring

Added:
    incubator/tuscany/sandbox/robbinspg/
      - copied from r431855, incubator/tuscany/cpp/
    incubator/tuscany/sandbox/robbinspg/sca/
      - copied from r432201, incubator/tuscany/cpp/sca/
    incubator/tuscany/sandbox/robbinspg/sca/deploy/extensions/
    incubator/tuscany/sandbox/robbinspg/sca/deploy/include/tuscany/sca/extension/
    incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp
      - copied unchanged from r431903, incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp
Removed:
    incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/model/CPPImplementation.cpp
    incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/model/CPPImplementation.h
Modified:
    incubator/tuscany/sandbox/robbinspg/sca/projects/tuscany_sca/tuscany_sca.dsw
    incubator/tuscany/sandbox/robbinspg/sca/projects/tuscany_sca/tuscany_sca.ncb
    incubator/tuscany/sandbox/robbinspg/sca/projects/tuscany_sca/tuscany_sca.opt
    incubator/tuscany/sandbox/robbinspg/sca/projects/tuscany_sca/tuscany_sca/tuscany_sca.dsp
    incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/osoa/sca/ComponentContextImpl.cpp
    incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/osoa/sca/CompositeContextImpl.cpp
    incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/core/ComponentServiceWrapper.cpp
    incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/core/ComponentServiceWrapper.h
    incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/core/SCARuntime.cpp
    incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/core/SCARuntime.h
    incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/core/ServiceProxy.cpp
    incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/model/Component.h
    incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/model/Implementation.cpp
    incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/model/Implementation.h
    incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/model/ModelLoader.cpp
    incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/model/ModelLoader.h
    incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/util/Utils.h
    incubator/tuscany/sandbox/robbinspg/sca/samples/ides/devstudio6/projects/Calculator/Calculator.ncb
    incubator/tuscany/sandbox/robbinspg/sca/samples/ides/devstudio6/projects/Calculator/Calculator.opt
    incubator/tuscany/sandbox/robbinspg/sdo/projects/tuscany_sdo/tuscany_sdo.ncb
    incubator/tuscany/sandbox/robbinspg/sdo/projects/tuscany_sdo/tuscany_sdo.opt
    incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/main.cpp
    incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/sdotest.cpp
    incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/sdotest.h

Modified: incubator/tuscany/sandbox/robbinspg/sca/projects/tuscany_sca/tuscany_sca.dsw
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sca/projects/tuscany_sca/tuscany_sca.dsw?rev=432505&r1=432201&r2=432505&view=diff
==============================================================================
--- incubator/tuscany/sandbox/robbinspg/sca/projects/tuscany_sca/tuscany_sca.dsw (original)
+++ incubator/tuscany/sandbox/robbinspg/sca/projects/tuscany_sca/tuscany_sca.dsw Fri Aug 18 00:09:41 2006
@@ -15,6 +15,21 @@
 
 ###############################################################################
 
+Project: "tuscany_sca_cpp"=.\tuscany_sca_cpp\tuscany_sca_cpp.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name tuscany_sca
+    End Project Dependency
+}}}
+
+###############################################################################
+
 Project: "tuscany_sca_test"=.\tuscany_sca_test\tuscany_sca_test.dsp - Package Owner=<4>
 
 Package=<5>

Modified: incubator/tuscany/sandbox/robbinspg/sca/projects/tuscany_sca/tuscany_sca.ncb
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sca/projects/tuscany_sca/tuscany_sca.ncb?rev=432505&r1=432201&r2=432505&view=diff
==============================================================================
Binary files - no diff available.

Modified: incubator/tuscany/sandbox/robbinspg/sca/projects/tuscany_sca/tuscany_sca.opt
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sca/projects/tuscany_sca/tuscany_sca.opt?rev=432505&r1=432201&r2=432505&view=diff
==============================================================================
Binary files - no diff available.

Modified: incubator/tuscany/sandbox/robbinspg/sca/projects/tuscany_sca/tuscany_sca/tuscany_sca.dsp
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sca/projects/tuscany_sca/tuscany_sca/tuscany_sca.dsp?rev=432505&r1=432201&r2=432505&view=diff
==============================================================================
--- incubator/tuscany/sandbox/robbinspg/sca/projects/tuscany_sca/tuscany_sca/tuscany_sca.dsp (original)
+++ incubator/tuscany/sandbox/robbinspg/sca/projects/tuscany_sca/tuscany_sca/tuscany_sca.dsp Fri Aug 18 00:09:41 2006
@@ -57,7 +57,7 @@
 # ADD LINK32 axis2_engine.lib tuscany_sdo_axiom.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib tuscany_sdo.lib axis2_parser.lib axis2_util.lib axiom.lib /nologo /dll /machine:I386 /libpath:"$(TUSCANY_SDOCPP)\lib" /libpath:"$(AXIS2C_HOME)\lib"
 # Begin Special Build Tool
 SOURCE="$(InputPath)"
-PostBuild_Cmds=del ..\..\..\deploy\bin\tuscany_sca.*	del ..\..\..\deploy\lib\*.lib	copy ..\..\..\runtime\core\src\osoa\sca\*.h ..\..\..\deploy\include\osoa\sca	copy ..\..\..\runtime\core\src\tuscany\sca\core\*.h ..\..\..\deploy\include\tuscany\sca\core	copy ..\..\..\runtime\core\src\tuscany\sca\model\*.h ..\..\..\deploy\include\tuscany\sca\model	copy ..\..\..\runtime\core\src\tuscany\sca\util\*.h ..\..\..\deploy\include\tuscany\sca\util	copy ..\..\..\runtime\core\src\tuscany\sca\ws\*.h ..\..\..\deploy\include\tuscany\sca\ws	copy Release\tuscany_sca.dll ..\..\..\deploy\bin	copy Release\tuscany_sca.lib ..\..\..\deploy\lib	copy ..\..\..\xsd\*.* ..\..\..\deploy\xsd
+PostBuild_Cmds=del ..\..\..\deploy\bin\tuscany_sca.*	del ..\..\..\deploy\lib\*.lib	copy ..\..\..\runtime\core\src\osoa\sca\*.h ..\..\..\deploy\include\osoa\sca	copy ..\..\..\runtime\core\src\tuscany\sca\core\*.h ..\..\..\deploy\include\tuscany\sca\core	copy ..\..\..\runtime\core\src\tuscany\sca\model\*.h ..\..\..\deploy\include\tuscany\sca\model	copy ..\..\..\runtime\core\src\tuscany\sca\util\*.h ..\..\..\deploy\include\tuscany\sca\util	copy ..\..\..\runtime\core\src\tuscany\sca\ws\*.h ..\..\..\deploy\include\tuscany\sca\ws	copy Release\tuscany_sca.dll ..\..\..\deploy\bin	copy Release\tuscany_sca.lib ..\..\..\deploy\lib	copy ..\..\..\xsd\*.* ..\..\..\deploy\xsd	copy ..\..\..\runtime\core\src\tuscany\sca\extension\*.h ..\..\..\deploy\include\tuscany\sca\extension
 # End Special Build Tool
 
 !ELSEIF  "$(CFG)" == "tuscany_sca - Win32 Debug"
@@ -88,7 +88,7 @@
 # ADD LINK32 axis2_engine.lib tuscany_sdo_axiom.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib tuscany_sdo.lib axis2_parser.lib axis2_util.lib axiom.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"$(TUSCANY_SDOCPP)\lib" /libpath:"$(AXIS2C_HOME)\lib"
 # Begin Special Build Tool
 SOURCE="$(InputPath)"
-PostBuild_Cmds=del ..\..\..\deploy\bin\tuscany_sca.*	del ..\..\..\deploy\lib\*.lib	copy ..\..\..\runtime\core\src\osoa\sca\*.h ..\..\..\deploy\include\osoa\sca	copy ..\..\..\runtime\core\src\tuscany\sca\core\*.h ..\..\..\deploy\include\tuscany\sca\core	copy ..\..\..\runtime\core\src\tuscany\sca\model\*.h ..\..\..\deploy\include\tuscany\sca\model	copy ..\..\..\runtime\core\src\tuscany\sca\util\*.h ..\..\..\deploy\include\tuscany\sca\util	copy ..\..\..\runtime\core\src\tuscany\sca\ws\*.h ..\..\..\deploy\include\tuscany\sca\ws	copy Debug\tuscany_sca.dll ..\..\..\deploy\bin	copy Debug\tuscany_sca.pdb ..\..\..\deploy\bin	copy Debug\tuscany_sca.lib ..\..\..\deploy\lib	copy ..\..\..\xsd\*.* ..\..\..\deploy\xsd
+PostBuild_Cmds=del ..\..\..\deploy\bin\tuscany_sca.*	del ..\..\..\deploy\lib\*.lib	copy ..\..\..\runtime\core\src\osoa\sca\*.h ..\..\..\deploy\include\osoa\sca	copy ..\..\..\runtime\core\src\tuscany\sca\core\*.h ..\..\..\deploy\include\tuscany\sca\core	copy ..\..\..\runtime\core\src\tuscany\sca\model\*.h ..\..\..\deploy\include\tuscany\sca\model	copy ..\..\..\runtime\core\src\tuscany\sca\util\*.h ..\..\..\deploy\include\tuscany\sca\util	copy ..\..\..\runtime\core\src\tuscany\sca\ws\*.h ..\..\..\deploy\include\tuscany\sca\ws	copy Debug\tuscany_sca.dll ..\..\..\deploy\bin	copy Debug\tuscany_sca.pdb ..\..\..\deploy\bin	copy Debug\tuscany_sca.lib ..\..\..\deploy\lib	copy ..\..\..\xsd\*.* ..\..\..\deploy\xsd	copy ..\..\..\runtime\core\src\tuscany\sca\extension\*.h ..\..\..\deploy\include\tuscany\sca\extension
 # End Special Build Tool
 
 !ENDIF 
@@ -277,14 +277,6 @@
 # End Source File
 # Begin Source File
 
-SOURCE=..\..\..\runtime\core\src\tuscany\sca\model\CPPImplementation.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\runtime\core\src\tuscany\sca\model\CPPImplementation.h
-# End Source File
-# Begin Source File
-
 SOURCE=..\..\..\runtime\core\src\tuscany\sca\model\CPPInterface.cpp
 # End Source File
 # Begin Source File
@@ -482,6 +474,18 @@
 # Begin Source File
 
 SOURCE=..\..\..\runtime\core\src\tuscany\sca\ws\WSServiceProxy.h
+# End Source File
+# End Group
+# Begin Group "extension"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\..\runtime\core\src\tuscany\sca\extension\ImplementationExtension.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\runtime\core\src\tuscany\sca\extension\ImplementationExtension.h
 # End Source File
 # End Group
 # End Group

Modified: incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/osoa/sca/ComponentContextImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/osoa/sca/ComponentContextImpl.cpp?rev=432505&r1=432201&r2=432505&view=diff
==============================================================================
--- incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/osoa/sca/ComponentContextImpl.cpp (original)
+++ incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/osoa/sca/ComponentContextImpl.cpp Fri Aug 18 00:09:41 2006
@@ -23,7 +23,6 @@
 #include "tuscany/sca/model/WireTarget.h"
 #include "tuscany/sca/core/ComponentServiceWrapper.h"
 #include "tuscany/sca/core/CompositeReferenceWrapper.h"
-#include "tuscany/sca/model/CPPImplementation.h"
 #include "tuscany/sca/model/Composite.h"
 
 using namespace tuscany::sca;

Modified: incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/osoa/sca/CompositeContextImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/osoa/sca/CompositeContextImpl.cpp?rev=432505&r1=432201&r2=432505&view=diff
==============================================================================
--- incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/osoa/sca/CompositeContextImpl.cpp (original)
+++ incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/osoa/sca/CompositeContextImpl.cpp Fri Aug 18 00:09:41 2006
@@ -20,7 +20,6 @@
 #include "tuscany/sca/util/Logging.h"
 #include "tuscany/sca/util/Exceptions.h"
 #include "tuscany/sca/model/Component.h"
-#include "tuscany/sca/model/CPPImplementation.h"
 #include "osoa/sca/CompositeContextImpl.h"
 #include "tuscany/sca/core/ComponentServiceWrapper.h"
 
@@ -76,7 +75,7 @@
             // -------------------------
             // Create the ServiceWrapper
             // -------------------------
-            ComponentServiceWrapper* serviceWrapper = ComponentServiceWrapper::createServiceWrapper(service);
+            ServiceWrapper* serviceWrapper = ComponentServiceWrapper::createServiceWrapper(service);
             
             // ----------------------------
             // Get a Proxy for this service

Modified: incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/core/ComponentServiceWrapper.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/core/ComponentServiceWrapper.cpp?rev=432505&r1=432201&r2=432505&view=diff
==============================================================================
--- incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/core/ComponentServiceWrapper.cpp (original)
+++ incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/core/ComponentServiceWrapper.cpp Fri Aug 18 00:09:41 2006
@@ -23,7 +23,7 @@
 #include "tuscany/sca/util/Logging.h"
 #include "tuscany/sca/util/Utils.h"
 #include "tuscany/sca/core/SCARuntime.h"
-#include "tuscany/sca/model/CPPImplementation.h"
+#include "tuscany/sca/model/Implementation.h"
 using namespace osoa::sca;
 
 namespace tuscany
@@ -134,11 +134,10 @@
         // ======================================================================
         // createServiceWrapper: create a wrapper for the target ComponentService
         // ======================================================================
-        ComponentServiceWrapper* ComponentServiceWrapper::createServiceWrapper(Service* service)
+        ServiceWrapper* ComponentServiceWrapper::createServiceWrapper(Service* service)
         {            
             string msg;
-            ComponentServiceWrapper* serviceWrapper = 0;
-            
+           
             // -----------------------------------------------
             // Get the implementation for the target component
             // -----------------------------------------------
@@ -150,58 +149,7 @@
                 throw ServiceNotFoundException(msg.c_str());
             }
             
-            // TODO: This only handle CPP implementation for now
-            if (impl->getImplementationType() == Implementation::CPP)
-            {
-                // ----------------------------------------------------
-                // Get implementation dll name and wrapper factory name
-                // ----------------------------------------------------
-                string dllName = ((CPPImplementation*)impl)->getDll();
-                string wrapperFactoryName = ((CPPImplementation*)impl)->getHeaderStub() 
-                    + "_" + service->getName() + "_Wrapper_Factory";
-                
-                // ------------
-                // Load the dll
-                // ------------
-                string fullDllName = targetComponent->getComposite()->getRoot() + "/" + dllName;
-                typedef ComponentServiceWrapper* (* WRAPPERFACTORY) (Service*);                
-                Library* wrapperLib = new Library(fullDllName);
-                
-                // -------------------------
-                // Locate the factory method
-                // -------------------------
-                WRAPPERFACTORY wrapperFactory = (WRAPPERFACTORY)wrapperLib->getSymbol(wrapperFactoryName);
-                if (!wrapperFactory)
-                {
-                    LOGERROR_2(1, "ComponentServiceWrapper::createServiceWrapper: Unable to locate %s in library %s",
-                        wrapperFactoryName.c_str(), fullDllName.c_str());
-                    msg = "Unable to locate " + wrapperFactoryName + " in library " + fullDllName;
-                    throw ServiceNotFoundException(msg.c_str());
-                }
-                
-                // -------------------------------------
-                // Now create an instance of the wrapper
-                // -------------------------------------                
-                serviceWrapper = wrapperFactory(service);
-                if (!serviceWrapper)
-                {
-                    LOGERROR_2(1, "ComponentServiceWrapper::createServiceWrapper: Factory method %s in library %s returned null",
-                        wrapperFactoryName.c_str(), fullDllName.c_str());
-                    msg = "Factory method " + wrapperFactoryName + " in library " + fullDllName + " returned null";
-                    throw ServiceNotFoundException(msg.c_str());
-                }                
-                serviceWrapper->setLibrary(wrapperLib);
-            }
-            else
-            {
-                // ----------------------
-                // Non CPP Implementation
-                // ----------------------
-                msg = "Unsupported implementation type for service: " + service->getName();
-                throw ServiceNotFoundException(msg.c_str());
-            }        
-            
-            return serviceWrapper;
+            return impl->getImplementationExtension()->getServiceWrapper(service);
         }    
         
     } // End namespace sca

Modified: incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/core/ComponentServiceWrapper.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/core/ComponentServiceWrapper.h?rev=432505&r1=432201&r2=432505&view=diff
==============================================================================
--- incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/core/ComponentServiceWrapper.h (original)
+++ incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/core/ComponentServiceWrapper.h Fri Aug 18 00:09:41 2006
@@ -51,7 +51,7 @@
              * created.
              * @return A wrapper that references the given target.
              */
-            static SCA_API ComponentServiceWrapper* createServiceWrapper(Service* target);
+            static SCA_API ServiceWrapper* createServiceWrapper(Service* target);
 
             /**
              * Constructor.

Modified: incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/core/SCARuntime.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/core/SCARuntime.cpp?rev=432505&r1=432201&r2=432505&view=diff
==============================================================================
--- incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/core/SCARuntime.cpp (original)
+++ incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/core/SCARuntime.cpp Fri Aug 18 00:09:41 2006
@@ -177,12 +177,75 @@
             LOGENTRY(1, "SCARuntime::load");
             
             LOGINFO_1(2,"configuration root: %s", configurationRoot.c_str());
+
+            // load extensions
+            loadExtensions();
+            loadImplementationExtensions();
             
             ModelLoader loader(system);
             // Load details of the composite
             loader.load(configurationRoot);
             
             LOGEXIT(1, "SCARuntime::load");
+        }
+              
+
+        // ======================================
+        // Load up extensions to the runtime
+        // ======================================
+        void SCARuntime::loadExtensions()
+        {
+            LOGENTRY(1, "SCARuntime::loadExtensions");
+
+            string extensionsRoot = SCARoot + "/extensions";
+
+#if defined(WIN32)  || defined (_WINDOWS)
+            string pattern = "*.dll";
+#else
+            string pattern = "*.so";
+#endif
+
+            Files files(extensionsRoot, pattern, false);
+            for (unsigned int i=0; i < files.size(); i++)
+            {
+                try
+                {
+                    extensionsList.push_back(Library(files[i].getFileName()));                    
+                }
+                catch (ServiceRuntimeException &)
+                {
+                    LOGERROR_1(0, "SCARuntime::loadExtensions failed to load extension library: %s", files[i].getFileName().c_str());
+                }
+            }
+            
+            LOGEXIT(1, "SCARuntime::loadExtensions");
+        }
+
+        // ======================================
+        // Load up all the details of the runtime
+        // ======================================
+        void SCARuntime::loadImplementationExtensions()
+        {
+            LOGENTRY(1, "SCARuntime::loadImplementationExtensions");
+
+            
+            for (EXTENSIONS_LIST::iterator iter = extensionsList.begin();
+                 iter != extensionsList.end();
+                 iter++)
+            {
+                TUSCANY_IMPLEMENTATION_EXTENSION_FACTORY impl = 
+                    (TUSCANY_IMPLEMENTATION_EXTENSION_FACTORY)iter->getSymbol("tuscany_sca_extension_getImplementation");
+                if (impl)
+                {
+                    ImplementationExtension* extension = impl();
+                    if (extension)
+                    {
+                        implementationExtensions[extension->getImplementationTypeQName()] = extension;
+                    }
+                }
+            }
+            
+            LOGEXIT(1, "SCARuntime::loadImplementationExtensions");
         }
         
         

Modified: incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/core/SCARuntime.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/core/SCARuntime.h?rev=432505&r1=432201&r2=432505&view=diff
==============================================================================
--- incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/core/SCARuntime.h (original)
+++ incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/core/SCARuntime.h Fri Aug 18 00:09:41 2006
@@ -22,13 +22,13 @@
 
 #include "osoa/sca/export.h"
 
-#include "osoa/sca/ComponentContext.h"
-using osoa::sca::ComponentContext;
-
 #include "tuscany/sca/core/ServiceWrapper.h"
 #include "tuscany/sca/model/System.h"
 using namespace tuscany::sca::model;
 
+#include "tuscany/sca/extension/ImplementationExtension.h"
+#include "tuscany/sca/util/Library.h"
+
 #if defined(WIN32)  || defined (_WINDOWS)
 #include <windows.h>
 #else
@@ -38,6 +38,7 @@
 #include <stack>
 #include <string>
 #include <map>
+#include <list>
 using namespace std;
 
 namespace tuscany
@@ -115,6 +116,8 @@
              */
             Composite* getCurrentComposite();
 
+            typedef map<string, ImplementationExtension*> IMPLEMENTATIONS_MAP;
+            IMPLEMENTATIONS_MAP& getImplementationExtensions() {return implementationExtensions;}
         private:
             /**
              * Default constructor is private to prevent more than one instance.
@@ -182,6 +185,16 @@
              * A map of threads to components.
              */
             COMPONENTS_MAP components;
+
+            IMPLEMENTATIONS_MAP implementationExtensions;
+
+            // Runtime Extensions
+            void loadExtensions();
+            void loadImplementationExtensions();
+
+            typedef list<Library> EXTENSIONS_LIST;
+            EXTENSIONS_LIST extensionsList;
+
         };
 
         

Modified: incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/core/ServiceProxy.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/core/ServiceProxy.cpp?rev=432505&r1=432201&r2=432505&view=diff
==============================================================================
--- incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/core/ServiceProxy.cpp (original)
+++ incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/core/ServiceProxy.cpp Fri Aug 18 00:09:41 2006
@@ -22,7 +22,7 @@
 #include "tuscany/sca/util/Logging.h"
 #include "tuscany/sca/util/Exceptions.h"
 #include "tuscany/sca/core/SCARuntime.h"
-#include "tuscany/sca/model/CPPImplementation.h"
+#include "tuscany/sca/model/Implementation.h"
 
 using namespace osoa::sca;
 
@@ -49,7 +49,7 @@
             }
             
             // TODO: This only handle CPP implementation for now
-            if (impl->getImplementationType() == Implementation::CPP)
+            if (impl->getImplementationType() == "cpp")
             {
                 // ----------------------------------------------------
                 // Get implementation dll name and service factory name

Modified: incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/model/Component.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/model/Component.h?rev=432505&r1=432201&r2=432505&view=diff
==============================================================================
--- incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/model/Component.h (original)
+++ incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/model/Component.h Fri Aug 18 00:09:41 2006
@@ -26,7 +26,6 @@
 #include <map>
 
 #include "tuscany/sca/model/Service.h"
-#include "tuscany/sca/model/Implementation.h"
 #include "tuscany/sca/model/ServiceReference.h"
 
 #include "commonj/sdo/SDO.h"
@@ -41,6 +40,7 @@
         {
 
             class Composite;
+            class Implementation;
 
             /**
              * Information about an SCA component.
@@ -53,31 +53,31 @@
                  * @param name The name of the component.
                  * @param composite The composite containing this component.
                  */
-                Component(const std::string& name, Composite* composite);
+                SCA_API Component(const std::string& name, Composite* composite);
 
                 /**
                  * Destructor.
                  */
-                virtual ~Component();
+                SCA_API virtual ~Component();
 
                 /**
                  * Returns the name of the component.
                  * @return The name of the component.
                  */
-                const string& getName() {return name;}
+                SCA_API const string& getName() {return name;}
 
                 /** 
                  * Get the composite containing this component.
                  * @return The containing composite.
                  */
-                Composite* getComposite() {return containingComposite;}
+                SCA_API Composite* getComposite() {return containingComposite;}
 
                 /**
                  * Add a new service to this component.
                  * @param serviceName The name of the service to add.
                  * @return The newly added service.
                  */
-                Service* addService(const std::string& serviceName);
+                SCA_API Service* addService(const std::string& serviceName);
 
                 /**
                  * Find an existing service on this component.
@@ -86,33 +86,33 @@
                  * only one service it will be returned.
                  * @return The found service, or 0 if not found.
                  */
-                Service* findService(const std::string& serviceName);
+                SCA_API Service* findService(const std::string& serviceName);
 
                 /**
                  * Add a new reference to this component.
                  * @param referenceName The name of the reference to add.
                  * @return The newly added reference.
                  */
-                ServiceReference* addReference(const std::string& referenceName);
+                SCA_API ServiceReference* addReference(const std::string& referenceName);
 
                 /**
                  * Find an existing reference on this component.
                  * @param referenceName The name of the reference to find.
                  * @return The found reference, or 0 if not found.
                  */
-                ServiceReference* findReference(const std::string& referenceName);
+                SCA_API ServiceReference* findReference(const std::string& referenceName);
 
                 /**
                  * Set the details of the implementation of this component.
                  * @param impl The details of the implementation.
                  */
-                void setImplementation(Implementation* impl);
+                SCA_API void setImplementation(Implementation* impl);
 
                 /**
                  * Returns the details of the implementation of this component.
                  * @return The details of the implementation.
                  */
-                Implementation* getImplementation() {return implementation;}
+                SCA_API Implementation* getImplementation() {return implementation;}
 
                 /**
                  * Add a new property to this component. Properties are 
@@ -124,7 +124,7 @@
                  * @param defaultValue The default value if the property does not have a
                  * value set.
                  */
-                void addProperty(const string& name,
+                SCA_API void addProperty(const string& name,
                     const string& type,
                     bool many,
                     const char* defaultValue = 0);
@@ -135,14 +135,14 @@
                  * @param properties A data object representing all the values set
                  * for this component.
                  */
-                void addProperties(DataObjectPtr properties);
+                SCA_API void addProperties(DataObjectPtr properties);
 
                 /**
                  * Returns a data object from which all the properties and their
                  * values can be accessed.
                  * @return A data object holding the property values.
                  */
-                DataObjectPtr getProperties();
+                SCA_API DataObjectPtr getProperties();
             private:
                 /**
                  * Name of the component.

Modified: incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/model/Implementation.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/model/Implementation.cpp?rev=432505&r1=432201&r2=432505&view=diff
==============================================================================
--- incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/model/Implementation.cpp (original)
+++ incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/model/Implementation.cpp Fri Aug 18 00:09:41 2006
@@ -31,6 +31,7 @@
 
             // Constructor
             Implementation::Implementation()
+                : implementationExtension(0)
             {
             }
 

Modified: incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/model/Implementation.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/model/Implementation.h?rev=432505&r1=432201&r2=432505&view=diff
==============================================================================
--- incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/model/Implementation.h (original)
+++ incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/model/Implementation.h Fri Aug 18 00:09:41 2006
@@ -22,6 +22,8 @@
 
 #include <string>
 
+#include "tuscany/sca/extension/ImplementationExtension.h"
+
 namespace tuscany
 {
     namespace sca
@@ -33,19 +35,11 @@
              * of a component. The subtypes will hold information specific to 
              * the type of implementation.
              */ 
-            class Implementation 
+            class SCA_API Implementation 
             {
                 
             public:
-                /**
-                 * Supported types of implementation.
-                 */
-                enum Type
-                {
-                    CPP,
-                    JAVA
-                };
-                
+                 
                 Implementation();  
                 virtual ~Implementation();
                                 
@@ -53,9 +47,11 @@
                  * Return the type of the implementation.
                  * @return Will depend on the subtype.
                  */
-                virtual Type getImplementationType() = 0;
-                
+                virtual const std::string getImplementationType() = 0;
+                virtual std::string getComponentTypeFileName() {return "";}
+                virtual ImplementationExtension* getImplementationExtension() {return implementationExtension;}
             private:
+                ImplementationExtension* implementationExtension;
             };
             
         } // End namespace model

Modified: incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/model/ModelLoader.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/model/ModelLoader.cpp?rev=432505&r1=432201&r2=432505&view=diff
==============================================================================
--- incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/model/ModelLoader.cpp (original)
+++ incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/model/ModelLoader.cpp Fri Aug 18 00:09:41 2006
@@ -22,10 +22,10 @@
 #include "tuscany/sca/util/Exceptions.h"
 #include "tuscany/sca/util/Logging.h"
 #include "tuscany/sca/model/ModelLoader.h"
-#include "tuscany/sca/model/CPPImplementation.h"
 #include "tuscany/sca/model/CPPInterface.h"
 #include "tuscany/sca/core/SCARuntime.h"
 #include "tuscany/sca/model/WSBinding.h"
+#include "tuscany/sca/model/Implementation.h"
 #include "commonj/sdo/TypeDefinitions.h"
 
 
@@ -45,6 +45,7 @@
             ModelLoader::ModelLoader(System* system) : system(system)
             {
                 LOGENTRY(1, "ModelLoader::constructor");
+                implementationExtensions = &SCARuntime::getInstance()->getImplementationExtensions();
                 
                 
                 LOGEXIT(1, "ModelLoader::constructor");
@@ -354,51 +355,47 @@
                     message = message + componentDO->getCString("name");
                     throw SystemConfigurationException(message.c_str());
                 }
-
-                // Determine the type
-                string componentTypeName;
-                string componentTypePath;
-                string implType = impl->getType().getName();
-                if (implType == "CPPImplementation")
-                {
-                    string library = impl->getCString("library");
-                    string header = impl->getCString("header");
-                    string className = impl->getCString("class");
-                    CPPImplementation* cppImpl = new CPPImplementation(library, header, className);
-                    componentTypePath = cppImpl->getHeaderPath();
-                    componentTypeName = cppImpl->getHeaderStub();
-                    component->setImplementation(cppImpl);
-                    
-                }
-                else if (implType == "JavaImplementation")
-                {
-                }
                 
-                // -----------------------
-                // Load the .componentType
-                // -----------------------
-                string typeFileName = composite->getRoot() + "/" + componentTypePath + componentTypeName + ".componentType";
-                try 
-                {
-                    XMLDocumentPtr componentTypeFile = getXMLHelper()->loadFile(typeFileName.c_str());
-                    if (componentTypeFile->getRootDataObject() == 0)
-                    {
-                        LOGERROR_1(0, "ModelLoader::mapComposite: Unable to load file: %s", typeFileName.c_str());
-                    }
-                    else
-                    {                                            
-                        //Utils::printDO(componentTypeFile->getRootDataObject());
-                        //commonj::sdo::SDOUtils::printDataObject(componentTypeFile->getRootDataObject());
-                        addServices(component, componentTypeFile->getRootDataObject());
-                        addReferences(component, componentTypeFile->getRootDataObject());
-                        addProperties(component, componentTypeFile->getRootDataObject());
+                string implTypeQname = impl->getType().getURI();
+                implTypeQname += "#";
+                implTypeQname += impl->getType().getName();
+                
+                // Locate extension that handles this implementation type
+                ImplementationExtension* implExtension = (*implementationExtensions)[implTypeQname];
+                if (implExtension)
+                {
+                    implExtension->loadModelElement(impl, component);
+                    Implementation* theImpl = component->getImplementation();
+                    if (theImpl)
+                    {
+                        // -----------------------
+                        // Load the .componentType
+                        // -----------------------
+                        string componentTypeFileName = theImpl->getComponentTypeFileName();
+                        if (componentTypeFileName != "")
+                        {
+                            string typeFileName = composite->getRoot() + "/" + componentTypeFileName + ".componentType";
+                            try 
+                            {
+                                XMLDocumentPtr componentTypeFile = getXMLHelper()->loadFile(typeFileName.c_str());
+                                if (componentTypeFile->getRootDataObject() == 0)
+                                {
+                                    LOGERROR_1(0, "ModelLoader::mapComposite: Unable to load file: %s", typeFileName.c_str());
+                                }
+                                else
+                                {                                            
+                                    addServices(component, componentTypeFile->getRootDataObject());
+                                    addReferences(component, componentTypeFile->getRootDataObject());
+                                    addProperties(component, componentTypeFile->getRootDataObject());
+                                }
+                            } catch (SDORuntimeException& ex) 
+                            {
+                                LOGERROR_1(0, "ModelLoader::mapComposite: Exception caught: %s", ex.getMessageText());
+                                throw SystemConfigurationException(ex.getMessageText());
+                            }    
+                        }
                     }
-                } catch (SDORuntimeException& ex) 
-                {
-                    LOGERROR_1(0, "ModelLoader::mapComposite: Exception caught: %s", ex.getMessageText());
-                    throw SystemConfigurationException(ex.getMessageText());
-                }    
-
+                }
                 
                 // ----------
                 // Properties

Modified: incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/model/ModelLoader.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/model/ModelLoader.h?rev=432505&r1=432201&r2=432505&view=diff
==============================================================================
--- incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/model/ModelLoader.h (original)
+++ incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/model/ModelLoader.h Fri Aug 18 00:09:41 2006
@@ -31,6 +31,7 @@
 
 #include "tuscany/sca/util/File.h"
 
+#include "tuscany/sca/core/SCARuntime.h"
 namespace tuscany
 {
     namespace sca
@@ -94,7 +95,8 @@
                 void loadWSDLTypes(XSDHelperPtr xsdHelper);
     
                 Interface* getInterface(DataObjectPtr obj);
-
+                
+                SCARuntime::IMPLEMENTATIONS_MAP* implementationExtensions;
             
             };
         } // End namespace model

Modified: incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/util/Utils.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/util/Utils.h?rev=432505&r1=432201&r2=432505&view=diff
==============================================================================
--- incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/util/Utils.h (original)
+++ incubator/tuscany/sandbox/robbinspg/sca/runtime/core/src/tuscany/sca/util/Utils.h Fri Aug 18 00:09:41 2006
@@ -32,7 +32,7 @@
         /**
          * Utility methods to parse strings and provide debugging information.
          */
-        class Utils {
+        class SCA_API Utils {
 
         public:
             static void tokeniseUri(const string& uri, string& token1, string& token2);
@@ -51,8 +51,8 @@
 
             static void breakpoint();
 
-            SCA_API static void printDO(commonj::sdo::DataObjectPtr dataObject, int increment=0);
-            SCA_API static void printTypes(commonj::sdo::DataFactoryPtr df);
+            static void printDO(commonj::sdo::DataObjectPtr dataObject, int increment=0);
+            static void printTypes(commonj::sdo::DataFactoryPtr df);
             
         private:
             static void tabs(int increment=0);

Modified: incubator/tuscany/sandbox/robbinspg/sca/samples/ides/devstudio6/projects/Calculator/Calculator.ncb
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sca/samples/ides/devstudio6/projects/Calculator/Calculator.ncb?rev=432505&r1=432201&r2=432505&view=diff
==============================================================================
Binary files - no diff available.

Modified: incubator/tuscany/sandbox/robbinspg/sca/samples/ides/devstudio6/projects/Calculator/Calculator.opt
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sca/samples/ides/devstudio6/projects/Calculator/Calculator.opt?rev=432505&r1=432201&r2=432505&view=diff
==============================================================================
Binary files - no diff available.

Modified: incubator/tuscany/sandbox/robbinspg/sdo/projects/tuscany_sdo/tuscany_sdo.ncb
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sdo/projects/tuscany_sdo/tuscany_sdo.ncb?rev=432505&r1=431855&r2=432505&view=diff
==============================================================================
Binary files - no diff available.

Modified: incubator/tuscany/sandbox/robbinspg/sdo/projects/tuscany_sdo/tuscany_sdo.opt
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sdo/projects/tuscany_sdo/tuscany_sdo.opt?rev=432505&r1=431855&r2=432505&view=diff
==============================================================================
Binary files - no diff available.

Modified: incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/main.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/main.cpp?rev=432505&r1=431855&r2=432505&view=diff
==============================================================================
--- incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/main.cpp (original)
+++ incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/main.cpp Fri Aug 18 00:09:41 2006
@@ -167,6 +167,7 @@
     TEST (  sdotest::b46617() );
     TEST (  sdotest::b46613() );
     TEST (  sdotest::b45933() );
+    TEST (  sdotest::importnamespace() );
 
     cout << "Total tests:" << totaltests << " Tests passed:" << testspassed << endl;
 

Modified: incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/sdotest.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/sdotest.cpp?rev=432505&r1=431855&r2=432505&view=diff
==============================================================================
--- incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/sdotest.cpp (original)
+++ incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/sdotest.cpp Fri Aug 18 00:09:41 2006
@@ -313,6 +313,7 @@
     DataObjectPtr com = dor->createDataObject("companies");
     com->setCString("name","acme");
     com->setCString("id","123");
+    cout << com;
     
     ChangeSummaryPtr cs = dor->getChangeSummary();
     cs->beginLogging();
@@ -8830,6 +8831,22 @@
 }
 
 
+
+int sdotest::importnamespace()
+{
+    try 
+    {
+        XSDHelperPtr xsh = HelperProvider::getXSDHelper();
+        xsh->defineFile("importnamespace.xsd");
+        return 1;
+    }
+    catch (SDORuntimeException e)
+    {
+        if (!silent)cout << "importnamespace" << endl << e << endl;
+        return 0;
+    }
+
+}
 
 
 

Modified: incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/sdotest.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/sdotest.h?rev=432505&r1=431855&r2=432505&view=diff
==============================================================================
--- incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/sdotest.h (original)
+++ incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/sdotest.h Fri Aug 18 00:09:41 2006
@@ -189,4 +189,5 @@
         static int b46617();
         static int b46617b();
         static int b45933();
+        static int importnamespace();
 };



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