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/01/05 11:59:14 UTC

svn commit: r366157 [6/33] - in /incubator/tuscany/cpp/sca: ./ bin/ include/ include/osoa/ include/osoa/sca/ include/tuscany/ include/tuscany/sca/ include/tuscany/sca/core/ include/tuscany/sca/model/ include/tuscany/sca/util/ include/tuscany/sca/ws/ li...

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCAEntryPoint.h
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCAEntryPoint.h?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCAEntryPoint.h (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCAEntryPoint.h Thu Jan  5 02:54:16 2006
@@ -0,0 +1,126 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/* $Rev$ $Date: 2005/12/22 11:33:21 $ */
+
+#ifndef tuscany_sca_core_scaentrypoint_h
+#define tuscany_sca_core_scaentrypoint_h
+
+#include "osoa/sca/export.h"
+
+#include <vector>
+using std::vector;
+#include "tuscany/sca/core/ServiceWrapper.h"
+#include "tuscany/sca/model/WireTarget.h"
+#include "tuscany/sca/model/Subsystem.h"
+#include "tuscany/sca/model/EntryPoint.h"
+#include "tuscany/sca/model/Module.h"
+using namespace tuscany::sca::model;
+#include "commonj/sdo/SDO.h"
+using commonj::sdo::DataObjectPtr;
+using commonj::sdo::DataFactoryPtr;
+
+namespace tuscany
+{
+    namespace sca
+    {
+        /**
+         * A runtime class which is used by external bindings to provide the entry
+         * point into the SCA runtime. An entry point will be defined in an SCA
+         * module, and a binding class will be provided to service the
+         * communication between the external binding (e.g. for web services the
+         * SOAP/HTTP communication) and the SCA runtime. The binding class will
+         * use SCAEntryPoint to call into the SCA runtime.
+         */
+        class  SCAEntryPoint
+        {
+        public:
+            /**
+             * Constructor to create a new instance which will be associated with
+             * a given entry point in an SCA module.
+             * @param entryPointName The qualified name of the entry point in an 
+             * SCA module. It is of the form 
+             * "subsystem name"/"module component name"/"entry point name".
+             */
+            SCA_API SCAEntryPoint(const char* entryPointName);
+
+            /**
+             * Destructor.
+             */
+            SCA_API virtual    ~SCAEntryPoint();
+
+            /**
+             * Invokes an operation on the component to which the SCA entry point
+             * is wired in the SCA module.
+             * Note that the operation must take a single data object as a parameter, and
+             * the return is a single data object.
+             * @param operationName Name of the operation.
+             * @param inDataObject The parameter for the operation.
+             * @return The data object which holds the result of the operation.
+             */
+            SCA_API virtual DataObjectPtr invoke(const char* operationName, DataObjectPtr inDataObject);
+
+            /**
+             * Returns a SDO data factory from which all the types associated with the entry point
+             * and module can be created.
+             */
+            SCA_API DataFactoryPtr getDataFactory() {return dataFactory;}
+
+        protected:
+
+        private:
+            /**
+             * The subsystem in which this entry point is found.
+             */ 
+            Subsystem* subsystem;
+
+            /**
+             * The entry point in the module.
+             */
+            EntryPoint* entrypoint;
+
+            /**
+             * The module component in the subsystem.
+             */
+            Module* module;
+
+            /**
+             * Cached data factory which has all the types defined for the module in which
+             * this entry point is found.
+             */
+            DataFactoryPtr dataFactory;
+
+            typedef vector<ServiceWrapper*> SERVICES;
+            /**
+             * Vector of all the service wrappers created for this entry point. 
+             * Used to destroy the wrappers when this class is destroyed.
+             */
+            SERVICES services;
+
+            /**
+             * Creates and returns the service wrapper for a given target.
+             * @param target The target of the wire for which a service wrapper is
+             * to be created.
+             * @return A service wrapper to be used for invoking the target implementation.
+             */
+            ServiceWrapper* getServiceWrapper(WireTarget* target);
+            
+        };
+    } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_core_scaentrypoint_h

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCAEntryPoint.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCAEntryPoint.h
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.cpp
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.cpp?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.cpp Thu Jan  5 02:54:16 2006
@@ -0,0 +1,275 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/* $Rev$ $Date: 2005/12/22 11:33:21 $ */
+
+#include "tuscany/sca/core/SCARuntime.h"
+#include "tuscany/sca/core/ComponentServiceWrapper.h"
+#include "tuscany/sca/util/Logging.h"
+#include "tuscany/sca/util/Utils.h"
+#include "tuscany/sca/util/Exceptions.h"
+
+#include "tuscany/sca/model/System.h"
+#include "tuscany/sca/model/Subsystem.h"
+#include "tuscany/sca/model/ModelLoader.h"
+
+#if defined(WIN32)  || defined (_WINDOWS)
+#include <windows.h> 
+#endif
+
+namespace tuscany
+{
+    namespace sca
+    {
+
+        // ==========================================================
+        // Initialize static class member to not pointing at anything
+        // ==========================================================
+        SCARuntime* SCARuntime::instance = 0;
+        
+
+        // ===================================================================
+        // Constructor for the SCARuntime class. This will be a singleton that
+        // holds all the information about the current runtime.
+        // ===================================================================
+        SCARuntime::SCARuntime() : system(new System()), defaultModule(0)
+        { 
+            LOGENTRY(1, "SCARuntime::constructor");
+            
+            // Locate the SCA install root
+            char*  root = 0;
+            root = getenv("SCA4CPP");
+            if (root == 0)
+            {
+                throw SystemConfigurationException("SCA4CPP environment variable not set");
+            }
+            else
+            {
+                SCARoot = root;
+            }
+            
+            LOGEXIT(1, "SCARuntime::constructor");
+        }
+
+        // =============================================================
+        // Get the instance of the runtime, creates it if does not exist
+        // static method
+        // =============================================================
+        SCARuntime* SCARuntime::getInstance()
+        {
+            LOGENTRY(1, "SCARuntime::getInstance");
+            
+            if (instance == NULL) 
+            {
+                instance = new SCARuntime();
+                
+                // Load the runtime
+                // Get root from environment variable SCA4CPP_SYSTEM_ROOT
+                char* systemRoot = getenv("SCA4CPP_SYSTEM_ROOT");
+                if (systemRoot == 0)
+                {
+                    throw SystemConfigurationException("SCA4CPP_SYSTEM_ROOT environment variable not set");
+                }
+                instance->load(systemRoot);
+            }
+            
+            LOGEXIT(1, "SCARuntime::getInstance");
+            
+            return instance;
+            
+        }
+
+        // ======================================
+        // Load up all the details of the runtime
+        // ======================================
+        void SCARuntime::load(const char *configurationRoot)
+        {
+            LOGENTRY(1, "SCARuntime::load");
+            std::string root = configurationRoot;
+            
+            LOGINFO_1(2,"configuration root: %s", configurationRoot);
+            
+            ModelLoader loader(system);
+            // Load details of the module
+            loader.load(configurationRoot);
+            
+            LOGEXIT(1, "SCARuntime::load");
+        }
+        
+        
+        // ===================================
+        // Return the top of the runtime model
+        // ===================================
+        System* SCARuntime::getSystem()
+        {
+            return system;
+        }
+
+
+        // ===================================================
+        // setCurrentComponent: push component for this thread
+        // ===================================================        
+        void SCARuntime::setCurrentComponent(Component* component)
+        {
+
+#if defined(WIN32)  || defined (_WINDOWS)
+            DWORD currentThreadId = GetCurrentThreadId();
+#else
+            pthread_t currentThreadId = pthread_self();
+#endif
+            COMPONENTS_MAP::iterator iter = components.find(currentThreadId);
+            if (iter == components.end())
+            {
+                components[currentThreadId] = COMPONENT_STACK();
+                iter = components.find(currentThreadId);
+            }
+            
+            COMPONENT_STACK& compStack = iter->second;
+            compStack.push(component);
+        }
+
+        
+        // ====================================================
+        // unsetCurrentComponent: pop component for this thread
+        // ====================================================
+        Component* SCARuntime::unsetCurrentComponent()
+        {
+#if defined(WIN32)  || defined (_WINDOWS)
+            DWORD currentThreadId = GetCurrentThreadId();
+#else
+            pthread_t currentThreadId = pthread_self();
+#endif
+
+            COMPONENTS_MAP::iterator iter = components.find(currentThreadId);
+            if (iter != components.end())
+            {    
+                COMPONENT_STACK& compStack = iter->second;
+                if (compStack.size() > 0)
+                {
+                    Component* component = compStack.top();
+                    compStack.pop();
+                    return component;
+                }
+            }
+            
+            return 0;
+        }
+        
+        // =============================================================
+        // getCurrentComponent: return current component for this thread
+        // =============================================================
+        Component* SCARuntime::getCurrentComponent()
+        {
+#if defined(WIN32)  || defined (_WINDOWS)
+            DWORD currentThreadId = GetCurrentThreadId();
+#else
+            pthread_t currentThreadId = pthread_self();
+#endif
+
+            COMPONENTS_MAP::iterator iter = components.find(currentThreadId);
+            if (iter == components.end())
+            {
+                components[currentThreadId] = COMPONENT_STACK();
+                iter = components.find(currentThreadId);
+            }
+            
+            COMPONENT_STACK& compStack = iter->second;
+            if (compStack.size() > 0)
+            {
+                return compStack.top();
+            }
+            else
+            {
+                return 0;
+            }
+            
+        }
+        
+
+        // ===========================================
+        // getCurrentModule: return the current module
+        // ===========================================
+        Module* SCARuntime::getCurrentModule()
+        {
+            // ---------------------------------------------
+            // Get module from current component if possible
+            // ---------------------------------------------
+            Component* comp = getCurrentComponent();
+            if (comp != 0)
+            {
+                return comp->getModule();
+            }
+
+            // ----------------------
+            // Get the default Module
+            // ----------------------
+            string message;
+            if (!defaultModule)
+            {
+                // -------------------------------------------
+                // Get the default module from the environment
+                // -------------------------------------------
+                const char* defMod = getenv("SCA4CPP_DEFAULT_MODULE");
+                if (!defMod)
+                {
+                    throw SystemConfigurationException("SCA4CPP_DEFAULT_MODULE environment variable not set");
+                }
+
+                string subsystemName, moduleName;
+                Utils::tokeniseUri(defMod, subsystemName, moduleName);
+
+                // ---------------------------
+                // Subsystem must be specified
+                // ---------------------------
+                Subsystem* subsystem = system->findSubsystem(subsystemName);
+                if (!subsystem)
+                {
+                    message = "Default subsystem \'" + subsystemName + "\' not found";
+                    throw SystemConfigurationException(message.c_str());
+                }
+                
+                // --------------------------------------------------------------------------
+                // If module is not specified then get the default module for this subsystem.
+                // This will be the ONLY module for this subsystem
+                // --------------------------------------------------------------------------
+                if (moduleName == "")
+                {
+                    defaultModule = subsystem->getDefaultModule();
+                    if (!defaultModule)
+                    {
+                        message = "Default module not found for subsystem \'" + subsystemName + "\'";
+                        throw SystemConfigurationException(message.c_str());
+                    }
+                }
+                else 
+                {
+                    // -----------------------------
+                    // get the named ModuleComponent
+                    // -----------------------------
+                    defaultModule = subsystem->findModuleByComponentName(moduleName);
+                    if (!defaultModule)
+                    {
+                        message = "Default module \'" + moduleName  + "\' not found in subsystem \'" + subsystemName +"\'";
+                        throw SystemConfigurationException(message.c_str());
+                    }
+                }
+            }
+            return defaultModule;        
+        }
+                
+    } // End namespace sca
+} // End namespace tuscany

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.h
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.h?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.h (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.h Thu Jan  5 02:54:16 2006
@@ -0,0 +1,166 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/* $Rev$ $Date: 2005/12/22 11:33:21 $ */
+
+#ifndef tuscany_sca_core_scaruntime_h
+#define tuscany_sca_core_scaruntime_h
+
+#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;
+
+#if defined(WIN32)  || defined (_WINDOWS)
+#include <windows.h>
+#else
+#include <pthread.h>
+#endif
+
+#include <stack>
+#include <string>
+#include <map>
+using namespace std;
+
+namespace tuscany
+{
+    namespace sca
+    {
+        
+        /**
+         * A singleton which represents the executing SCA runtime.
+         */
+        class SCARuntime {
+        public:
+            /**
+             * Get the single instance.
+             * @return The single instance of the runtime.
+             */
+            SCA_API static SCARuntime* getInstance();
+
+            /**
+             * Set the current component for the current thread.
+             * @param component The current component.
+             */
+            SCA_API void setCurrentComponent(Component* component);
+
+            /**
+             * Remove the current component from this thread, and return
+             * to the previous component (if there was one).
+             * @return The previous component.
+             */
+            SCA_API Component* unsetCurrentComponent();
+
+            /**
+             * Get a pointer to the configured SCA system which this
+             * SCA runtime represents. 
+             * The rest of the SCA configuration can be navigated from
+             * the System.
+             * @return The configured SCA system.
+             */
+            System* getSystem();
+
+            /**
+             * The directory in which the Tuscany runtime has been installed.
+             */
+            const string& getInstallRoot() {return SCARoot;}
+
+            /**
+             * Return the current component for this thread.
+             * @return The current component for this thread.
+             */
+            Component* getCurrentComponent();
+
+            /**
+             * Get the current module. The current module will either
+             * be the module in which the current component for this thread
+             * is defined, or it will be the default module if there is no current
+             * component. There will not be a current component if a client of
+             * the SCA runtime is making a call into the SCA runtime.
+             */
+            Module* getCurrentModule();
+
+        private:
+            /**
+             * Default constructor is private to prevent more than one instance.
+             */
+            SCARuntime();            
+
+            /**
+             * Load the SCA configuration from the scdl files (sca.module, 
+             * *.fragment, etc).
+             * This will create the runtime model from which the SCA runtime
+             * will operate.
+             * @param configurationRoot The path to the configuration of the 
+             * SCA runtime. Under this root will be the subsystems and modules
+             * directories.
+             */
+            void load(const char* configurationRoot);
+
+            /**
+             * The single instance of this class.
+             */
+            static SCARuntime* instance;
+
+            /**
+             * Pointer to the top of the runtime model.
+             */
+            System* system;
+
+            /**
+             * The installed path of the Tuscany runtime.
+             */
+            string SCARoot;
+
+            /**
+             * Get the default module set for this runtime.
+             * @return The default module.
+             */
+            Module* getDefaultModule() {return defaultModule;}
+
+            /**
+             * The default module set for this runtime.
+             */
+            Module* defaultModule;
+            
+            
+            typedef stack<Component*> COMPONENT_STACK; 
+#if defined(WIN32)  || defined (_WINDOWS)
+            typedef map<DWORD, COMPONENT_STACK> COMPONENTS_MAP;
+#else
+            typedef map<pthread_t, COMPONENT_STACK> COMPONENTS_MAP;
+#endif
+
+            /**
+             * A map of threads to components.
+             */
+            COMPONENTS_MAP components;
+        };
+
+        
+    } // End namespace sca
+} // End namespace tuscany
+
+
+
+
+#endif // tuscany_sca_core_scaruntime_h
+

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.h
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceProxy.cpp
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceProxy.cpp?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceProxy.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceProxy.cpp Thu Jan  5 02:54:16 2006
@@ -0,0 +1,121 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/* $Rev$ $Date: 2005/12/22 11:33:21 $ */
+
+#include "tuscany/sca/core/ServiceProxy.h"
+
+#include "tuscany/sca/util/Logging.h"
+#include "tuscany/sca/util/Exceptions.h"
+#include "tuscany/sca/core/SCARuntime.h"
+#include "tuscany/sca/model/CPPImplementation.h"
+
+using namespace osoa::sca;
+
+namespace tuscany
+{
+    namespace sca
+    {
+        // ============================
+        // Constructor: Create a proxy
+        // ============================
+        ServiceProxy::ServiceProxy(Component* component, const string& name, ServiceWrapper* target)
+        {
+            LOGENTRY(1,"ServiceProxy::constructor");
+            string msg;
+
+            // ----------------------
+            // Get the implementation
+            // ----------------------
+            Implementation* impl = component->getImplementation();
+            if (!impl)
+            {
+                msg = "Component " + component->getName() + " has no implementation defined";
+                throw ServiceNotFoundException(msg.c_str());
+            }
+            
+            // TODO: This only handle CPP implementation for now
+            if (impl->getImplementationType() == Implementation::CPP)
+            {
+                // ----------------------------------------------------
+                // Get implementation dll name and service factory name
+                // ----------------------------------------------------
+                string dllName = ((CPPImplementation*)impl)->getDll();
+                string headerStub = ((CPPImplementation*)impl)->getHeaderStub();
+
+                string fullDllName = component->getModule()->getRoot() + "/" + dllName;
+                string proxyFactoryName = headerStub + "_" + name + "_Proxy_Factory";
+                string proxyDestructorName = headerStub + "_" + name + "_Proxy_Destructor";        
+                typedef void* (* PROXYFACTORY) (ServiceWrapper*);
+                
+                // ------------
+                // Load the dll
+                // ------------
+                proxyLibrary = Library(fullDllName);
+
+                // -------------------------
+                // Locate the factory method
+                // -------------------------
+                PROXYFACTORY proxyFactory = (PROXYFACTORY)proxyLibrary.getSymbol(proxyFactoryName);        
+                if (!proxyFactory)
+                {
+                    LOGERROR_2(1, "ComponentContextImpl::getServiceProxy: Unable to locate %s in library %s",
+                        proxyFactoryName.c_str(), fullDllName.c_str());
+                    msg = "Unable to locate " + proxyFactoryName + " in library " + fullDllName;
+                    throw ServiceNotFoundException(msg.c_str());
+                }
+                
+                // -----------------------------------
+                // Now create an instance of the proxy                
+                // -----------------------------------
+                proxy = proxyFactory(target); 
+                if (!proxy)
+                {
+                    LOGERROR_2(1, "ComponentContextImpl::getServiceProxy: Factory method %s in library %s returned null",
+                        proxyFactoryName.c_str(), fullDllName.c_str());
+                    msg = "Factory method " + proxyFactoryName + " in library " + fullDllName + " returned null";
+                    throw ServiceNotFoundException(msg.c_str());
+                }
+
+                // -------------------------
+                // Get the destructor method
+                // -------------------------
+                destructor  = (PROXYDESTRUCTOR)proxyLibrary.getSymbol(proxyDestructorName);        
+            }
+            
+            LOGEXIT(1,"ServiceProxy::constructor");
+            
+        }
+
+        // ==========
+        // Destructor
+        // ==========
+        ServiceProxy::~ServiceProxy()
+        {
+            LOGENTRY(1,"ServiceProxy::destructor");
+
+            // Delete the proxy
+            if (destructor)
+            {
+                destructor(proxy);
+            }
+            LOGEXIT(1,"ServiceProxy::destructor");
+        }
+    
+        
+    } // End namespace sca
+} // End namespace tuscany

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceProxy.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceProxy.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceProxy.h
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceProxy.h?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceProxy.h (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceProxy.h Thu Jan  5 02:54:16 2006
@@ -0,0 +1,89 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/* $Rev$ $Date: 2005/12/22 11:33:21 $ */
+
+#ifndef tuscany_sca_core_serviceproxy_h
+#define tuscany_sca_core_serviceproxy_h
+
+#include "osoa/sca/export.h"
+
+#include "tuscany/sca/core/ServiceWrapper.h"
+#include "tuscany/sca/model/Component.h"
+#include "tuscany/sca/util/Library.h"
+
+using namespace tuscany::sca::model;
+
+namespace tuscany
+{
+    namespace sca
+    {
+        /**
+         * Holds a proxy for a given component and reference.
+         * The proxy which is held inside a ServiceProxy will be specific to the component
+         * and reference and will have been code generated and be contained in a dll 
+         * created by a developer of an SCA application.
+         */
+        class ServiceProxy 
+        {
+        public:
+            /**
+             * Create a new service proxy for a given component and reference name. The
+             * create proxy will contain a pointer to the target ServiceWrapper.
+             * @param component The component for which this proxy will be created (the
+             * source component).
+             * @param name The name of the reference on the component.
+             * @param target The wrapper of the component which is wired to this component and
+             * reference.
+             */
+            ServiceProxy(Component* component, const string& name, ServiceWrapper* target);
+
+            /**
+             * Destructor.
+             */
+            virtual    ~ServiceProxy();
+
+            /**
+             * Return an instance of the proxy created for this particular component and reference.
+             * @return The proxy.
+             */
+            void* getProxy() {return proxy;}
+
+
+        private:
+            /**
+             * Holds the instance of the code generated proxy.
+             */ 
+            void* proxy;
+
+            typedef void (* PROXYDESTRUCTOR) (void*);
+
+            /**
+             * A function pointer to the destructor of the proxy.
+             */
+            PROXYDESTRUCTOR destructor;
+            
+            /**
+             * The library which contains the code for the proxy.
+             */
+            Library proxyLibrary;
+
+        };
+    } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_core_serviceproxy_h

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceProxy.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceProxy.h
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceWrapper.cpp
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceWrapper.cpp?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceWrapper.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceWrapper.cpp Thu Jan  5 02:54:16 2006
@@ -0,0 +1,55 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/* $Rev$ $Date: 2005/12/22 11:33:21 $ */
+
+#include "tuscany/sca/core/ServiceWrapper.h"
+#include <stdarg.h>
+
+#include "tuscany/sca/util/Logging.h"
+#include "tuscany/sca/core/SCARuntime.h"
+
+
+
+namespace tuscany
+{
+    namespace sca
+    {
+        
+        // ===========
+        // Constructor
+        // ===========
+        ServiceWrapper::ServiceWrapper(WireTarget* targ)
+            : target(targ)
+        {
+            LOGENTRY(1,"ServiceWrapper::constructor");
+            
+            LOGEXIT(1,"ServiceWrapper::constructor");
+            
+        }
+        
+        // ==========
+        // Destructor
+        // ==========
+        ServiceWrapper::~ServiceWrapper()
+        {
+            LOGENTRY(1,"ServiceWrapper::destructor");
+            LOGEXIT(1,"ServiceWrapper::destructor");
+        }        
+        
+    } // End namespace sca
+} // End namespace tuscany

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceWrapper.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceWrapper.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceWrapper.h
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceWrapper.h?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceWrapper.h (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceWrapper.h Thu Jan  5 02:54:16 2006
@@ -0,0 +1,73 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/* $Rev$ $Date: 2005/12/22 11:33:21 $ */
+
+#ifndef tuscany_sca_core_servicewrapper_h
+#define tuscany_sca_core_servicewrapper_h
+
+#include "osoa/sca/export.h"
+
+#include "tuscany/sca/core/Operation.h"
+#include "tuscany/sca/model/WireTarget.h"
+using tuscany::sca::model::WireTarget;
+
+namespace tuscany
+{
+    namespace sca
+    {
+        /**
+         * An abstract class that wraps a component implementation or an external
+         * service.
+         */
+        class SCA_API ServiceWrapper 
+        {
+        public:
+            /**
+             * Constructor.
+             * @param target The service wrapper wraps the target of a wire.
+             */
+            ServiceWrapper(WireTarget* target);
+
+            /**
+             * Destructor.
+             */
+            virtual    ~ServiceWrapper();
+
+            /** 
+             * Get the target represented by this wrapper.
+             * @return The target represented by this wrapper.
+             */
+            virtual WireTarget* getTarget() {return target;}
+
+            /**
+             * All business method calls on the target service are performed through
+             * this invoke method.
+             * @param operation The details of the method, paramaters and return value for the
+             * business method to be called on the target service.
+             */
+            virtual void invoke(Operation& operation) = 0;
+        private:
+            /**
+             * The target represented by this wrapper.
+             */
+            WireTarget* target;
+        };
+    } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_core_servicewrapper_h

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceWrapper.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceWrapper.h
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Binding.cpp
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Binding.cpp?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Binding.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Binding.cpp Thu Jan  5 02:54:16 2006
@@ -0,0 +1,44 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/* $Rev$ $Date: 2005/12/22 11:33:21 $ */
+
+#include "tuscany/sca/util/Logging.h"
+#include "tuscany/sca/model/Binding.h"
+
+
+namespace tuscany
+{
+    namespace sca
+    {
+
+        namespace model
+        {
+
+            // Constructor
+            Binding::Binding(const string& uri) : uri(uri)
+            {
+            }
+
+            Binding::~Binding()
+            {
+            }
+
+        } // End namespace model
+
+    } // End namespace sca
+} // End namespace tuscany

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Binding.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Binding.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Binding.h
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Binding.h?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Binding.h (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Binding.h Thu Jan  5 02:54:16 2006
@@ -0,0 +1,85 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/* $Rev$ $Date: 2005/12/22 11:33:21 $ */
+
+#ifndef tuscany_sca_model_binding_h
+#define tuscany_sca_model_binding_h
+#include <string>
+using std::string;
+
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace model
+        {
+            /**
+             * Information about the binding for EntryPoint and ExternalService. An
+             * abstract class which will be extended by classes that hold specific
+             * information for each type of binding.
+             */
+            class Binding 
+            {
+                
+            public:
+                /**
+                 * Supported binding types.
+                 */
+                enum Type
+                {
+                    WS,
+                    SCA
+                };
+                
+                /**
+                 * Constructor to create a new binding.
+                 * @param uri The uri specified in the scdl file.
+                 */ 
+                Binding(const string& uri);  
+
+                /**
+                 * Destructor.
+                 */ 
+                virtual ~Binding();
+                            
+                /**
+                 * Return the enumerated type of binding.
+                 * @return The type of the binding (see Binding#Type).
+                 */ 
+                virtual Type getBindingType() = 0;
+
+                /**
+                 * Return the uri of the binding.
+                 * @return The uri of the binding.
+                 */
+                string getUri() {return uri;};
+                
+            private:
+                /**
+                 * The uri of the binding.
+                 */ 
+                string uri;
+            };
+            
+        } // End namespace model
+    } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_model_binding_h
+

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Binding.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Binding.h
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPImplementation.cpp
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPImplementation.cpp?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPImplementation.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPImplementation.cpp Thu Jan  5 02:54:16 2006
@@ -0,0 +1,52 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/* $Rev$ $Date: 2005/12/22 11:33:21 $ */
+
+#include "tuscany/sca/util/Logging.h"
+#include "tuscany/sca/model/CPPImplementation.h"
+
+namespace tuscany
+{
+    namespace sca
+    {
+
+        namespace model
+        {
+
+            // Constructor
+            CPPImplementation::CPPImplementation(const string& dllName, const string& head, const string& classN)
+                : dll(dllName), header(head), className(classN)
+            {
+                string::size_type dot = header.rfind(".h"); // this will also find .hpp
+                if (dot != string::npos)
+                {
+                    headerStub = header.substr(0, dot);
+                }
+                else
+                {
+                    headerStub = header;
+                }
+            }
+
+            CPPImplementation::~CPPImplementation()
+            {
+            }
+        } // End namespace model
+
+    } // End namespace sca
+} // End namespace tuscany

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPImplementation.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPImplementation.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPImplementation.h
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPImplementation.h?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPImplementation.h (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPImplementation.h Thu Jan  5 02:54:16 2006
@@ -0,0 +1,114 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/* $Rev$ $Date: 2005/12/22 11:33:21 $ */
+
+#ifndef tuscany_sca_model_cppimplementation_h
+#define tuscany_sca_model_cppimplementation_h
+#include "tuscany/sca/model/Implementation.h"
+
+#include <map>
+using std::map;
+#include <string>
+using std::string;
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace model
+        {
+            /**
+             * Holds informatio about an SCA implementation written in C++
+             */
+            class CPPImplementation : public Implementation
+            {
+                
+            public:        
+                /**
+                 * Constructor.
+                 * @param dllName Name of the shared library.
+                 * @param header Name of the header file that contains the class declaring the 
+                 * implementation class.
+                 * @param className Name of the class in the header file (could be a blank string
+                 * if this is not specified).
+                 */
+                CPPImplementation(const string& dllName, const string& header, const string& className);
+                
+                /**
+                 * Destructor
+                 */
+                virtual ~CPPImplementation();
+                            
+                /**
+                 * Return the implementation type.
+                 * @return Always returns CPP.
+                 */
+                virtual Type getImplementationType() {return CPP;}
+
+                /**
+                 * Returns the name of the shared library.
+                 * @return The name of the shared library.
+                 */
+                const string& getDll() {return dll;}
+
+                /**
+                 * Get the name of the header file.
+                 * @return Name of the header file.
+                 */
+                const string& getHeader() {return header;}
+
+                /**
+                 * Get the header file name without the extension.
+                 * @return The name of the header file without any extension.
+                 */
+                const string& getHeaderStub() {return headerStub;}
+
+                /**
+                 * Get the name of the class.
+                 * @return The class name if specified.
+                 */
+                const string& getClass() {return className;}
+            private:
+                /**
+                 * Name of the shared library.
+                 */
+                string dll;
+
+                /**
+                 * Name of the header file describing the interface.
+                 */
+                string header;
+
+                /**
+                 * Name of the header file without the extension.
+                 */
+                string headerStub;
+
+                /**
+                 * Name of the class in the header file declaring the implementation.
+                 * May be an empty string if not set in the SCDL file.
+                 */
+                string className;
+            };
+            
+        } // End namespace model
+    } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_model_cppimplementation_h
+

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPImplementation.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPImplementation.h
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPInterface.cpp
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPInterface.cpp?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPInterface.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPInterface.cpp Thu Jan  5 02:54:16 2006
@@ -0,0 +1,67 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/* $Rev$ $Date: 2005/12/22 11:33:21 $ */
+
+#include "tuscany/sca/util/Logging.h"
+#include "tuscany/sca/model/CPPInterface.h"
+
+
+namespace tuscany
+{
+    namespace sca
+    {
+
+        namespace model
+        {
+
+            // Constructor
+            CPPInterface::CPPInterface(
+                    const string& head,
+                    const string& classN,
+                    const string& scop,
+                    bool remote)
+                    : header(head), className(classN), remotable(remote)
+            {
+                 string::size_type dot = header.rfind(".h"); // this will also find .hpp
+                if (dot != string::npos)
+                {
+                    headerStub = header.substr(0, dot);
+                }
+                else
+                {
+                    headerStub = header;
+                }
+
+                if (scop == "module")
+                {
+                    scope = MODULE;
+                }
+                else
+                {
+                    scope = STATELESS;
+                }
+           }
+
+            CPPInterface::~CPPInterface()
+            {
+            }
+
+        } // End namespace model
+
+    } // End namespace sca
+} // End namespace tuscany

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPInterface.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPInterface.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPInterface.h
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPInterface.h?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPInterface.h (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPInterface.h Thu Jan  5 02:54:16 2006
@@ -0,0 +1,143 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/* $Rev$ $Date: 2005/12/22 11:33:21 $ */
+
+#ifndef tuscany_sca_model_cppinterface_h
+#define tuscany_sca_model_cppinterface_h
+
+#include "tuscany/sca/model/Interface.h"
+
+
+#include <map>
+using std::map;
+#include <string>
+using std::string;
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace model
+        {
+            /**
+             * Holds information about an interface described using a C++
+             * header file.
+             */
+            class CPPInterface : public Interface
+            {
+                
+            public:    
+                /**
+                 * Constuctor.
+                 * @param header Name of the header file containing the class that
+                 * describes the interface.
+                 * @param className Name of the class in the header file that 
+                 * describes the interface. 
+                 * @param scope The scope of the interface (stateless or module).
+                 * @param remotable True if the interface is remotable.
+                 */
+                CPPInterface(
+                    const string& header,
+                    const string& className,
+                    const string& scope,
+                    bool remotable);  
+
+                /**
+                 * Destructor.
+                 */
+                virtual ~CPPInterface();
+                
+                /**
+                 * Return the type of the interface.
+                 * @return Always returns CPP.
+                 */
+                virtual Type getInterfaceType() {return CPP;}
+
+                /**
+                 * Get the name of the header file.
+                 * @return The name of the header file containing the definition of the
+                 * interface.
+                 */
+                const string& getHeader() {return header;}
+
+                /**
+                 * Return the name of the header file without the extension.
+                 * @return Header file name without any extension.
+                 */
+                const string& getHeaderStub() {return headerStub;}
+
+                /**
+                 * Get the name of the class.
+                 * @return The name of the class defining the interface.
+                 */
+                const string& getClass() {return className;}
+
+                /**
+                 * Scope of interface.
+                 */
+                enum SCOPE
+                {
+                    MODULE,
+                    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:
+                /**
+                 * Name of the header file containing the definition of the interface.
+                 */
+                string header;
+
+                /**
+                 * Name of the header file without the extension.
+                 */
+                string headerStub;
+
+                /**
+                 * Name of the class in the header file.
+                 */
+                string className;
+
+                /**
+                 * Scope of the interface.
+                 */
+                SCOPE scope;
+
+                /**
+                 * Remotable interface or not.
+                 */
+                bool remotable;
+            };
+            
+        } // End namespace model
+    } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_model_cppinterface_h
+

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPInterface.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPInterface.h
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Component.cpp
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Component.cpp?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Component.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Component.cpp Thu Jan  5 02:54:16 2006
@@ -0,0 +1,303 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/* $Rev$ $Date: 2005/12/22 11:33:21 $ */
+
+// Component.cpp : Represent a loaded Component
+//
+#include "tuscany/sca/util/Logging.h"
+#include "tuscany/sca/util/Exceptions.h"
+#include "tuscany/sca/util/Utils.h"
+#include "tuscany/sca/model/Component.h"
+
+using namespace commonj::sdo;
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace model
+        {
+           // Constructor
+            Component::Component(const std::string& componentName, Module* module) 
+                : name(componentName), containingModule(module), implementation(0)
+            {
+                LOGENTRY(1, "Component::constructor");
+                LOGINFO_1(3, "Component::constructor: Component name: %s", name.c_str());
+                LOGEXIT(1, "Component::constructor");
+            }
+
+            Component::~Component()
+            {
+            }
+
+            Service* Component::addService(const std::string& serviceName)
+            {
+                Service* service = new Service(serviceName, this);
+                services[serviceName] = service;
+                return service;
+            }
+            
+            Service* Component::findService(const std::string& serviceName)
+            {
+                // If serviceName is null then return the ONLY service
+                if (serviceName == "" 
+                    && services.size() == 1)
+                {
+                    return services.begin()->second;
+                }
+                else
+                {
+                    return services[serviceName];
+                }
+            }
+            
+            ServiceReference* Component::findReference(const std::string& referenceName)
+            {
+                return references[referenceName];
+            }
+            
+            ServiceReference* Component::addReference(const std::string& referenceName)
+            {
+                ServiceReference* serviceReference = references[referenceName];
+                if (!serviceReference)
+                {
+                    references[referenceName] = new ServiceReference(referenceName);
+                }
+                return references[referenceName];
+            }
+            
+            void Component::setImplementation(Implementation* impl)
+            {
+                implementation = impl;
+            }
+            
+            void Component::addProperty(const string& name,
+                const string& type,
+                bool many,
+                bool required,
+                const char* defaultValue)
+            {
+                // Create a Type in the Properties dataFactory
+                DataFactoryPtr factory = getPropertyDataFactory();
+                
+                string typeUri, typeName;
+                Utils::tokeniseQName(type, typeUri, typeName);
+                
+                if (typeUri == "http://www.w3.org/2001/XMLSchema")                                
+                {
+                    typeUri = Type::SDOTypeNamespaceURI;
+                    if (typeName == "string")
+                    {
+                        typeName = "String";
+                    }
+                    else if (typeName == "anyType")
+                    {
+                        typeName = "DataObject";
+                    }
+                    else if (typeName == "int")
+                    {
+                        typeName = "Integer";
+                    }
+                    else if (typeName == "integer")
+                    {
+                        typeName = "Integer";
+                    }
+                    else if (typeName == "negativeInteger")
+                    {
+                        typeName = "Integer";
+                    }
+                    else if (typeName == "nonNegativeInteger")
+                    {
+                        typeName = "Integer";
+                    }
+                    else if (typeName == "positiveInteger")
+                    {
+                        typeName = "Integer";
+                    }
+                    else if (typeName == "nonPositiveInteger")
+                    {
+                        typeName = "Integer";
+                    }
+                    else if (typeName == "unsignedLong")
+                    {
+                        typeName = "Integer";
+                    }
+                    else if (typeName == "unsignedShort")
+                    {
+                        typeName = "Integer";
+                    }
+                    else if (typeName == "unsignedInt")
+                    {
+                        typeName = "Long";
+                    }
+                    else if (typeName == "long")
+                    {
+                        typeName = "Long";
+                    }
+                    else if (typeName == "double")
+                    {
+                        typeName = "Double";
+                    }
+                    else if (typeName == "short")
+                    {
+                        typeName = "Short";
+                    }
+                    else if (typeName == "unsignedByte")
+                    {
+                        typeName = "Short";
+                    }
+                    else if (typeName == "float")
+                    {
+                        typeName = "Float";
+                    }
+                    else if (typeName == "boolean")
+                    {
+                        typeName = "Boolean";
+                    }
+                    else if (typeName == "byte")
+                    {
+                        typeName = "Byte";
+                    }
+                    else if (typeName == "base64Binary")
+                    {
+                        typeName = "Bytes";
+                    }
+                    else if (typeName == "hexBinary")
+                    {
+                        typeName = "Bytes";
+                    }
+                    else if (typeName == "anyURI")
+                    {
+                        typeName = "URI";
+                    }
+                    else if (typeName == "QName")
+                    {
+                        typeName = "URI";
+                    }
+                    else
+                    {
+                        // Default unknown xs: types to string??
+                        typeName = "String";
+                    }
+                }
+                else
+                {
+                    // It's not an XML type
+                }
+
+
+                factory->addPropertyToType(
+                    "org/osoa/sca",
+                    "Properties",
+                    name.c_str(),
+                    typeUri.c_str(), 
+                    typeName.c_str(),
+                    many,
+                    false,
+                    true);
+
+                // Set the default
+                
+                
+                // Add to list of required properties
+                if (required)
+                {
+                }
+            }
+            
+            DataFactoryPtr Component::getPropertyDataFactory()
+            {
+                if (!propertyFactory)
+                {
+                    propertyFactory = DataFactory::getDataFactory();
+                    // Add the root type
+                    propertyFactory->addType("org/osoa/sca", "Properties", false, false, false, false);
+                }
+                return propertyFactory;
+            }
+            
+            DataObjectPtr Component::getProperties()
+            {
+                if (!properties)
+                {
+                    properties = getPropertyDataFactory()->create("org/osoa/sca", "Properties");
+                }
+                return properties;
+            }
+            
+            void Component::addProperties(DataObjectPtr values)
+            {
+                if (!values)
+                {
+                    return;
+                }
+
+                DataObjectPtr props = getProperties();
+
+                PropertyList pl = values->getInstanceProperties();
+                for (int i=0; i < pl.size(); i++)
+                {
+                    if (!values->isSet(i))
+                    {
+                        continue;
+                    }
+
+                    // Add the property value to the component to be resolved later
+                    string propName = pl[i].getName();
+
+                    // Get the property's type
+                    try
+                    {
+                        const Property& propProperty = props->getProperty(pl[i].getName());
+                        const Type& propType = propProperty.getType();
+
+                        DataObjectList& proplist = values->getList(pl[i]);
+                        for (int proplistI=0; proplistI<proplist.size(); proplistI++)
+                        {
+                            if (propType.isDataType())
+                            {
+                                if (propProperty.isMany())
+                                {
+                                    DataObjectList& dol = props->getList(pl[i]);
+                                    dol.append(proplist.getCString(proplistI));
+                                }
+                                else
+                                {
+                                    props->setCString(pl[i], proplist.getCString(proplistI));
+                                }
+                            }
+                            else
+                            {
+                                // Create a new instance of the DO
+                                // iterate over properties setting each one
+                            }
+                        }
+                    }
+                    catch (SDOPropertyNotFoundException&)
+                    {
+                        // Configuration error: property is not defined
+                        string message = "Undefined property: " + propName;
+                        throw SystemConfigurationException(message.c_str());
+                    }
+                    
+                }
+            }
+
+        } // End namespace model
+    } // End namespace sca
+} // End namespace tuscany

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Component.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Component.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Component.h
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Component.h?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Component.h (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Component.h Thu Jan  5 02:54:16 2006
@@ -0,0 +1,202 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/* $Rev$ $Date: 2005/12/22 11:33:21 $ */
+
+#ifndef tuscany_sca_model_component_h
+#define tuscany_sca_model_component_h
+
+#include <string>
+using std::string;
+
+#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"
+using commonj::sdo::DataObjectPtr;
+using commonj::sdo::DataFactoryPtr;
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace model
+        {
+
+            class Module;
+
+            /**
+             * Information about an SCA component.
+             */
+            class Component
+            {
+            public:
+                /**
+                 * Constructor
+                 * @param name The name of the component.
+                 * @param module The module containing this component.
+                 */
+                Component(const std::string& name, Module* module);
+
+                /**
+                 * Destructor.
+                 */
+                virtual ~Component();
+
+                /**
+                 * Returns the name of the component.
+                 * @return The name of the component.
+                 */
+                const string& getName() {return name;}
+
+                /** 
+                 * Get the module containing this component.
+                 * @return The containing module.
+                 */
+                Module* getModule() {return containingModule;}
+
+                /**
+                 * 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);
+
+                /**
+                 * Find an existing service on this component.
+                 * @param serviceName The name of the service to find.
+                 * If the serviceName is the zero length string then if there is
+                 * only one service it will be returned.
+                 * @return The found service, or 0 if not found.
+                 */
+                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);
+
+                /**
+                 * 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);
+
+                /**
+                 * Set the details of the implementation of this component.
+                 * @param impl The details of the implementation.
+                 */
+                void setImplementation(Implementation* impl);
+
+                /**
+                 * Returns the details of the implementation of this component.
+                 * @return The details of the implementation.
+                 */
+                Implementation* getImplementation() {return implementation;}
+
+                /**
+                 * Add a new property to this component. Properties are 
+                 * added one at a time. The property definitions come from the component
+                 * type file.
+                 * @param name The name of the property.
+                 * @param type The full name of the type (including uri and local name).
+                 * @param many True if this is a many valued property.
+                 * @param required True if this property must have a value set.
+                 * @param defaultValue The default value if the property does not have a
+                 * value set.
+                 */
+                void addProperty(const string& name,
+                    const string& type,
+                    bool many,
+                    bool required,
+                    const char* defaultValue = 0);
+    
+                /**
+                 * Add the property values to the properties defined on this 
+                 * component. The values will come from the sca.module file.
+                 * @param properties A data object representing all the values set
+                 * for this component.
+                 */
+                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();
+            private:
+                /**
+                 * Name of the component.
+                 */
+                string name;
+
+                /**
+                 * Module containing this component for navigating up the tree.
+                 */
+                Module* containingModule;
+
+                /**
+                 * Information about the implementation of this component.
+                 */
+                Implementation* implementation;
+
+                typedef std::map<std::string, Service*> SERVICE_MAP;
+                /**
+                 * Map of all the services defined on this component.
+                 */
+                SERVICE_MAP services;
+
+                typedef std::map<std::string, ServiceReference*> REFERENCE_MAP;
+                /**
+                 * Map of all the references defined on this component.
+                 */
+                REFERENCE_MAP references;
+
+                /**
+                 * SDO data factory which has all the property types defined from
+                 * the component type file
+                 */
+                DataFactoryPtr propertyFactory;
+
+                /**
+                 * Return the SDO data factory which has the property types defined
+                 * in it.
+                 * @return The data factory.
+                 */
+                DataFactoryPtr getPropertyDataFactory();
+
+                /**
+                 * The properties and their values for this component.
+                 */ 
+                DataObjectPtr properties;
+
+           };
+
+        } // End namespace model
+
+    } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_model_component_h
+

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Component.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Component.h
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/EntryPoint.cpp
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/EntryPoint.cpp?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/EntryPoint.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/EntryPoint.cpp Thu Jan  5 02:54:16 2006
@@ -0,0 +1,96 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/* $Rev$ $Date: 2005/12/22 11:33:21 $ */
+
+#include "tuscany/sca/util/Logging.h"
+#include "tuscany/sca/model/EntryPoint.h"
+#include "tuscany/sca/util/Exceptions.h"
+
+
+namespace tuscany
+{
+    namespace sca
+    {
+
+        namespace model
+        {
+
+            // Constructor
+            EntryPoint::EntryPoint(const std::string& epName) 
+                : name(epName)
+            {
+                LOGENTRY(1, "EntryPoint::constructor");
+                LOGERROR_1(0, "EntryPoint::constructor: EntryPoint name: %s", name.c_str());
+                LOGEXIT(1, "EntryPoint::constructor");
+            }
+
+            EntryPoint::~EntryPoint()
+            {
+            }
+
+            void EntryPoint::addTarget(WireTarget* targ)
+            {
+                if (multiplicity == ONE_ONE || multiplicity == ZERO_ONE)
+                {
+                    if (targets.size() > 0)
+                    {
+                        // throw exception
+                        string message = "Duplicate wire for reference: " + name;
+                        throw SystemConfigurationException(message.c_str());
+                    }
+                }
+
+                // TODO - must be remotable
+
+                targets.push_back(targ);
+            }
+            
+            void EntryPoint::setMultiplicity(const std::string& multip)
+            {
+                if (multip == "0..1")
+                {
+                    multiplicity = ZERO_ONE;
+                }
+                else if (multip == "1..1")
+                {
+                    multiplicity = ONE_ONE;
+                }
+                else if (multip == "0..n")
+                {
+                    multiplicity = ZERO_MANY;
+                }
+                else if (multip == "1..n")
+                {
+                    multiplicity = ONE_MANY;
+                }
+                else
+                {
+                    string msg = "Invalid multiplicity specified, " + multip + ", for reference: " +name;
+                    throw SystemConfigurationException(msg.c_str());
+                }
+            }
+            
+             void EntryPoint::setInterface(Interface* interf)
+            {
+                iface = interf;
+            }
+
+        } // End namespace model
+
+    } // End namespace sca
+} // End namespace tuscany

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/EntryPoint.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/EntryPoint.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/EntryPoint.h
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/EntryPoint.h?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/EntryPoint.h (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/EntryPoint.h Thu Jan  5 02:54:16 2006
@@ -0,0 +1,138 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/* $Rev$ $Date: 2005/12/22 11:33:21 $ */
+
+#ifndef tuscany_sca_model_entrypoint_h
+#define tuscany_sca_model_entrypoint_h
+
+#include <string>
+using std::string;
+#include <vector>
+using std::vector;
+
+#include "tuscany/sca/model/Interface.h"
+#include "tuscany/sca/model/WireTarget.h"
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace model
+        {
+            /**
+             * Represents the information about an entry point.
+             */
+            class EntryPoint 
+            {
+
+            public:
+                /**
+                 * Constructor.
+                 * @param name The name of the entry point.
+                 */
+                EntryPoint(const std::string& name);  
+
+                /**
+                 * Destructor.
+                 */
+                virtual ~EntryPoint();
+
+                /**
+                 * Return the name of the entry point.
+                 * @return The name of the entry point.
+                 */
+                const string& getName() {return name;}
+
+                /**
+                 * How many wires can be wired from this entry point.
+                 */
+                enum Multiplicity
+                {
+                    ZERO_ONE,
+                    ONE_ONE,
+                    ZERO_MANY,
+                    ONE_MANY
+                };
+
+                /**
+                 * Set the multiplicity of this entry point.
+                 * @param multiplicity One of 0..1, 1..1, 0..n, 1..n
+                 */
+                void setMultiplicity(const std::string& multiplicity);
+
+                /**
+                 * Return the multiplicity of this entry point (how
+                 * many wires can be wired from this entry point).
+                 * @return The multiplicity.
+                 */
+                Multiplicity getMultiplicity() {return multiplicity;}
+
+                /**
+                 * Set the interface describing this entry point.
+                 * @param iface The interface.
+                 */
+                void setInterface(Interface* iface);
+
+                /**
+                 * Get the interface describing this entry point. Use
+                 * Interface#getType to find out the type of interface 
+                 * describing this entry point.
+                 * @return iface The interface.
+                 */
+                Interface* getInterface() {return iface;}
+
+                /**
+                 * Add a target to the entry point.
+                 * @param target Add a target (derived from a wire) to
+                 * the entry point.
+                 */
+                void addTarget(WireTarget* target);
+                typedef vector<WireTarget*> TARGETS;
+
+                /**
+                 * Get a vector of targets added to this entry point.
+                 */
+                const TARGETS& getTargets() {return targets;}
+            private:
+                /**
+                 * Name of the entry point.
+                 */
+                string name;            
+                
+                /**
+                 * The interface describing this entry point.
+                 */
+                Interface* iface;
+
+                /**
+                 * The multiplicity of this entry point..
+                 */
+                Multiplicity multiplicity;
+
+                /**
+                 * The vector of targets added to this entry point.
+                 */
+                TARGETS targets;
+           };
+
+        } // End namespace model
+    } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_model_entrypoint_h
+

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/EntryPoint.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/EntryPoint.h
------------------------------------------------------------------------------
    svn:keywords = Rev,Date