You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2007/02/12 07:59:31 UTC

svn commit: r506336 - in /incubator/tuscany/cpp/sca/runtime/extensions/sca: reference/ reference/axis2c/ reference/src/ reference/src/tuscany/ reference/src/tuscany/sca/ reference/src/tuscany/sca/binding/ reference/src/tuscany/sca/binding/model/ servic...

Author: jsdelfino
Date: Sun Feb 11 22:59:30 2007
New Revision: 506336

URL: http://svn.apache.org/viewvc?view=rev&rev=506336
Log:
Changed SCA binding to delegate to the WS binding instead of inheriting from it. This will allow the SCA binding to pick the best concrete binding depending on what's installed and the various QOS requirements on the binding.

Added:
    incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/
    incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/Makefile.am   (with props)
    incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/tuscany/
    incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/tuscany/sca/
    incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/tuscany/sca/binding/
    incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/tuscany/sca/binding/SCAServiceBindingExtension.cpp   (with props)
    incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/tuscany/sca/binding/SCAServiceBindingExtension.h   (with props)
    incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/tuscany/sca/binding/model/
    incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/tuscany/sca/binding/model/SCAServiceBinding.cpp   (with props)
    incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/tuscany/sca/binding/model/SCAServiceBinding.h   (with props)
    incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/
    incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/Makefile.am   (with props)
    incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/tuscany/
    incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/tuscany/sca/
    incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/tuscany/sca/binding/
    incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/tuscany/sca/binding/SCAReferenceBindingExtension.cpp   (with props)
    incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/tuscany/sca/binding/SCAReferenceBindingExtension.h   (with props)
    incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/tuscany/sca/binding/model/
    incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/tuscany/sca/binding/model/SCAReferenceBinding.cpp   (with props)
    incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/tuscany/sca/binding/model/SCAReferenceBinding.h   (with props)
Removed:
    incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/axis2c/
    incubator/tuscany/cpp/sca/runtime/extensions/sca/service/axis2c/
Modified:
    incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/Makefile.am
    incubator/tuscany/cpp/sca/runtime/extensions/sca/service/Makefile.am
    incubator/tuscany/cpp/sca/runtime/extensions/sca/service/deploy.bat

Modified: incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/Makefile.am?view=diff&rev=506336&r1=506335&r2=506336
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/Makefile.am (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/Makefile.am Sun Feb 11 22:59:30 2007
@@ -15,4 +15,4 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-SUBDIRS = axis2c
+SUBDIRS = src

Added: incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/Makefile.am?view=auto&rev=506336
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/Makefile.am (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/Makefile.am Sun Feb 11 22:59:30 2007
@@ -0,0 +1,36 @@
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you 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.
+
+libdir=$(prefix)/extensions/sca/reference/lib
+lib_LTLIBRARIES = libtuscany_sca_binding_reference.la
+
+noinst_HEADERS = \
+tuscany/sca/binding/*.h \
+tuscany/sca/binding/model/*.h
+
+libtuscany_sca_binding_reference_la_SOURCES = \
+tuscany/sca/binding/SCAServiceBindingExtension.cpp \
+tuscany/sca/binding/model/SCAServiceBinding.cpp
+
+libtuscany_sca_binding_reference_la_LIBADD = \
+  -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo -ltuscany_sdo_axiom \
+  -L$(top_builddir)/runtime/core/src -ltuscany_sca
+
+INCLUDES = -I$(top_builddir)/runtime/core/src \
+           -I${TUSCANY_SDOCPP}/include
+                   
+AM_CPPFLAGS = $(CPPFLAGS) -D_DEBUG

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/Makefile.am
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/Makefile.am
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/tuscany/sca/binding/SCAServiceBindingExtension.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/tuscany/sca/binding/SCAServiceBindingExtension.cpp?view=auto&rev=506336
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/tuscany/sca/binding/SCAServiceBindingExtension.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/tuscany/sca/binding/SCAServiceBindingExtension.cpp Sun Feb 11 22:59:30 2007
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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$ */
+
+#include "SCAServiceBindingExtension.h"
+#include "tuscany/sca/util/Logging.h"
+#include "tuscany/sca/util/Utils.h"
+#include "tuscany/sca/core/SCARuntime.h"
+#include "tuscany/sca/core/Exceptions.h"
+
+using namespace std;
+using namespace commonj::sdo;
+using namespace tuscany::sca::model;
+
+extern "C"
+{
+#if defined(WIN32) || defined(_WINDOWS)
+    __declspec(dllexport) 
+#endif
+        void tuscany_sca_binding_reference_initialize()
+    {
+        tuscany::sca::binding::SCAServiceBindingExtension::initialize();
+    }
+}
+
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace binding
+        {
+            // ===================================================================
+            // Constructor for the SCAServiceBinding class. 
+            // ===================================================================
+            SCAServiceBindingExtension::SCAServiceBindingExtension()
+            { 
+                logentry();
+            }
+            
+            // ===================================================================
+            // Destructor for the SCAServiceBindingExtension class.
+            // ===================================================================
+            SCAServiceBindingExtension::~SCAServiceBindingExtension()
+            { 
+                logentry();
+            }
+
+            const string SCAServiceBindingExtension::extensionName("sca");
+            const string SCAServiceBindingExtension::typeQName("http://www.osoa.org/xmlns/sca/1.0#SCABinding");
+                                                                                                    
+
+            // ===================================================================
+            // loadModelElement - load the info from binding.ws
+            // ===================================================================
+            ServiceBinding* SCAServiceBindingExtension::getServiceBinding(Composite *composite, Service* service, DataObjectPtr scdlBinding)
+            {
+                logentry();
+
+                SCARuntime* runtime = SCARuntime::getCurrentRuntime();
+                
+                ServiceBindingExtension* bindingExtension = NULL;  // runtime->getServiceBindingExtension("http://www.osoa.org/xmlns/sca/1.0#RESTBinding");
+                if (bindingExtension == NULL)
+                {
+                    bindingExtension = runtime->getServiceBindingExtension("http://www.osoa.org/xmlns/sca/1.0#WebServiceBinding");
+                    if (bindingExtension == NULL)
+                    {
+                        logerror("SCA default binding requires the REST or WS binding to be available");
+    
+                        string message = "SCA default binding requires the REST or WS binding to be available";
+                        throwException(SystemConfigurationException, message.c_str());
+                    }                
+                }
+
+                return bindingExtension->getServiceBinding(composite, service, scdlBinding);                
+            }
+
+            void SCAServiceBindingExtension::initialize()
+            { 
+                logentry();
+                SCARuntime::getCurrentRuntime()->registerServiceBindingExtension(new SCAServiceBindingExtension());
+            }
+
+        } // End namespace ws
+    } // End namespace sca
+} // End namespace tuscany

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/tuscany/sca/binding/SCAServiceBindingExtension.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/tuscany/sca/binding/SCAServiceBindingExtension.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/tuscany/sca/binding/SCAServiceBindingExtension.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/tuscany/sca/binding/SCAServiceBindingExtension.h?view=auto&rev=506336
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/tuscany/sca/binding/SCAServiceBindingExtension.h (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/tuscany/sca/binding/SCAServiceBindingExtension.h Sun Feb 11 22:59:30 2007
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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$ */
+
+#ifndef tuscany_sca_extension_binding_scaservicebindingextension_h
+#define tuscany_sca_extension_binding_scaservicebindingextension_h
+
+#include "tuscany/sca/extension/ServiceBindingExtension.h"
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace binding
+        {
+            
+            class SCAServiceBindingExtension : public ServiceBindingExtension 
+            {
+            public:
+            /**
+            * Default constructor
+                */
+                SCAServiceBindingExtension();
+                
+                /**
+                * Destructor
+                */
+                virtual ~SCAServiceBindingExtension();            
+                
+                /**
+                * return the name of the extension
+                */
+                virtual const std::string& getExtensionName() {return extensionName;}
+                
+                /**
+                * return the QName of schema elemant for this implementation extension
+                * (e.g. "http://www.osoa.org/xmlns/sca/1.0#binding.ws")
+                */
+                virtual const std::string& getExtensionTypeQName() {return typeQName;}
+                
+                virtual tuscany::sca::model::ServiceBinding* getServiceBinding(
+                    tuscany::sca::model::Composite* composite,
+                    tuscany::sca::model::Service* service,
+                    commonj::sdo::DataObjectPtr scdlBinding);
+                
+                static void initialize();
+
+            private:
+                static const std::string extensionName;
+                static const std::string typeQName;
+                
+            };
+            
+            
+        } // End namespace binding
+    } // End namespace sca
+} // End namespace tuscany
+
+#endif //tuscany_sca_extension_binding_scaservicebindingextension_h
+

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/tuscany/sca/binding/SCAServiceBindingExtension.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/tuscany/sca/binding/SCAServiceBindingExtension.h
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/tuscany/sca/binding/model/SCAServiceBinding.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/tuscany/sca/binding/model/SCAServiceBinding.cpp?view=auto&rev=506336
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/tuscany/sca/binding/model/SCAServiceBinding.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/tuscany/sca/binding/model/SCAServiceBinding.cpp Sun Feb 11 22:59:30 2007
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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$ */
+
+#include "tuscany/sca/util/Logging.h"
+#include "tuscany/sca/core/Exceptions.h"
+#include "tuscany/sca/binding/model/SCAServiceBinding.h"
+#include "tuscany/sca/core/ServiceWrapper.h"
+
+using namespace std;
+using namespace commonj::sdo;
+using namespace tuscany::sca;
+using namespace tuscany::sca::model;
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace binding
+        {
+
+            // Constructor
+            SCAServiceBinding::SCAServiceBinding(Composite* composite, Service* service, const string& uri, DataObjectPtr scdlBinding)
+                : ServiceBinding(service, uri)
+            {
+            }
+
+            // Destructor
+            SCAServiceBinding::~SCAServiceBinding()
+            {
+            }
+            
+            ServiceWrapper* SCAServiceBinding::getServiceWrapper()
+            {
+                logentry();
+                
+                throwException(SystemConfigurationException, "Not supported");
+            }
+            
+        } // End namespace binding
+    } // End namespace sca
+} // End namespace tuscany

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/tuscany/sca/binding/model/SCAServiceBinding.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/tuscany/sca/binding/model/SCAServiceBinding.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/tuscany/sca/binding/model/SCAServiceBinding.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/tuscany/sca/binding/model/SCAServiceBinding.h?view=auto&rev=506336
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/tuscany/sca/binding/model/SCAServiceBinding.h (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/tuscany/sca/binding/model/SCAServiceBinding.h Sun Feb 11 22:59:30 2007
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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$ */
+
+#ifndef tuscany_sca_extension_binding_model_scaservicebinding_h
+#define tuscany_sca_extension_binding_model_scaservicebinding_h
+
+#include <string>
+
+#include "tuscany/sca/core/SCARuntime.h"
+#include "tuscany/sca/model/ServiceBinding.h"
+#include "tuscany/sca/model/Composite.h"
+#include "tuscany/sca/model/Service.h"
+
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace binding
+        {
+            /**
+             * Information about an SCA service binding for service or a reference.
+             */
+            class SCAServiceBinding : public tuscany::sca::model::ServiceBinding
+            {    
+            public:
+
+                /**
+                 * Constructor.
+                 * @param uri The uri of the binding.
+                 */
+                SCAServiceBinding(tuscany::sca::model::Composite* composite, tuscany::sca::model::Service* service, const std::string& uri, commonj::sdo::DataObjectPtr scdlBinding);  
+
+                /**
+                 * Destructor.
+                 */
+                virtual ~SCAServiceBinding();
+                            
+                /**
+                 * Returns the type of binding.
+                 */                
+                virtual std::string getType() { return "http://www.osoa.org/xmlns/sca/1.0#SCABinding"; };
+                            
+               /**
+                 * Create a service wrapper handling the interaction
+                 * with the service configured with this binding.
+                 */
+                 virtual tuscany::sca::ServiceWrapper* getServiceWrapper();
+ 
+            private:
+            
+            };
+            
+        } // End namespace model
+    } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_extension_ws_model_wsservicebinding_h

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/tuscany/sca/binding/model/SCAServiceBinding.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/sca/reference/src/tuscany/sca/binding/model/SCAServiceBinding.h
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/cpp/sca/runtime/extensions/sca/service/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/sca/service/Makefile.am?view=diff&rev=506336&r1=506335&r2=506336
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/sca/service/Makefile.am (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/sca/service/Makefile.am Sun Feb 11 22:59:30 2007
@@ -15,4 +15,4 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-SUBDIRS = axis2c
+SUBDIRS = src

Modified: incubator/tuscany/cpp/sca/runtime/extensions/sca/service/deploy.bat
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/sca/service/deploy.bat?view=diff&rev=506336&r1=506335&r2=506336
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/sca/service/deploy.bat (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/sca/service/deploy.bat Sun Feb 11 22:59:30 2007
@@ -29,7 +29,7 @@
 set extdir=%deploydir%\extensions
 set wsextdir=%extdir%\sca
 set svcextdir=%wsextdir%\service
-set srcdir=%rootdir%\runtime\extensions\sca\service\axis2c\src
+set srcdir=%rootdir%\runtime\extensions\sca\service\src
 
 if . == .%2 (
 echo input directory not specified

Added: incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/Makefile.am?view=auto&rev=506336
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/Makefile.am (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/Makefile.am Sun Feb 11 22:59:30 2007
@@ -0,0 +1,36 @@
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you 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.
+
+libdir=$(prefix)/extensions/sca/service/lib
+lib_LTLIBRARIES = libtuscany_sca_binding_service.la
+
+noinst_HEADERS = \
+tuscany/sca/binding/*.h \
+tuscany/sca/binding/model/*.h
+
+libtuscany_sca_binding_service_la_SOURCES = \
+tuscany/sca/binding/SCAReferenceBindingExtension.cpp \
+tuscany/sca/binding/model/SCAReferenceBinding.cpp
+
+libtuscany_sca_binding_service_la_LIBADD = \
+  -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo -ltuscany_sdo_axiom \
+  -L$(top_builddir)/runtime/core/src -ltuscany_sca
+
+INCLUDES = -I$(top_builddir)/runtime/core/src \
+           -I${TUSCANY_SDOCPP}/include
+                   
+AM_CPPFLAGS = $(CPPFLAGS) -D_DEBUG

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/Makefile.am
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/Makefile.am
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/tuscany/sca/binding/SCAReferenceBindingExtension.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/tuscany/sca/binding/SCAReferenceBindingExtension.cpp?view=auto&rev=506336
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/tuscany/sca/binding/SCAReferenceBindingExtension.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/tuscany/sca/binding/SCAReferenceBindingExtension.cpp Sun Feb 11 22:59:30 2007
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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$ */
+
+
+#include "SCAReferenceBindingExtension.h"
+#include "model/SCAReferenceBinding.h"
+#include "tuscany/sca/util/Logging.h"
+#include "tuscany/sca/util/Utils.h"
+#include "tuscany/sca/core/SCARuntime.h"
+#include "tuscany/sca/core/Exceptions.h"
+
+using namespace std;
+using namespace commonj::sdo;
+using namespace tuscany::sca::model;
+
+extern "C"
+{
+#if defined(WIN32) || defined(_WINDOWS)
+    __declspec(dllexport) 
+#endif
+        void tuscany_sca_binding_service_initialize()
+    {
+        tuscany::sca::binding::SCAReferenceBindingExtension::initialize();
+    }
+}
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace binding
+        {
+            // ===================================================================
+            // Constructor for the SCAReferenceBinding class. 
+            // ===================================================================
+            SCAReferenceBindingExtension::SCAReferenceBindingExtension()
+            { 
+                logentry();
+            }
+            
+            // ===================================================================
+            // Destructor for the SCAReferenceBindingExtension class.
+            // ===================================================================
+            SCAReferenceBindingExtension::~SCAReferenceBindingExtension()
+            { 
+                logentry();
+            }
+
+            const string SCAReferenceBindingExtension::extensionName("sca");
+            const string SCAReferenceBindingExtension::typeQName("http://www.osoa.org/xmlns/sca/1.0#SCABinding");
+
+            // ===================================================================
+            // loadModelElement - load the info from binding.ws
+            // ===================================================================
+            ReferenceBinding* SCAReferenceBindingExtension::getReferenceBinding(Composite *composite, Reference* reference, DataObjectPtr scdlBinding)
+            {
+                logentry();
+
+                SCARuntime* runtime = SCARuntime::getCurrentRuntime();
+                
+                ReferenceBindingExtension* bindingExtension = NULL; // runtime->getReferenceBindingExtension("http://www.osoa.org/xmlns/sca/1.0#RESTBinding");
+                if (bindingExtension == NULL)
+                {
+                    bindingExtension = runtime->getReferenceBindingExtension("http://www.osoa.org/xmlns/sca/1.0#WebServiceBinding");
+                    if (bindingExtension == NULL)
+                    {
+                        logerror("SCA default binding requires the REST or WS binding to be available");
+    
+                        string message = "SCA default binding requires the REST or WS binding to be available";
+                        throwException(SystemConfigurationException, message.c_str());
+                    }                
+                }
+
+                return bindingExtension->getReferenceBinding(composite, reference, scdlBinding);                
+            }
+
+           void SCAReferenceBindingExtension::initialize()
+            { 
+                logentry();
+                SCARuntime::getCurrentRuntime()->registerReferenceBindingExtension(new SCAReferenceBindingExtension());
+            }
+
+        } // End namespace binding
+    } // End namespace sca
+} // End namespace tuscany

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/tuscany/sca/binding/SCAReferenceBindingExtension.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/tuscany/sca/binding/SCAReferenceBindingExtension.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/tuscany/sca/binding/SCAReferenceBindingExtension.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/tuscany/sca/binding/SCAReferenceBindingExtension.h?view=auto&rev=506336
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/tuscany/sca/binding/SCAReferenceBindingExtension.h (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/tuscany/sca/binding/SCAReferenceBindingExtension.h Sun Feb 11 22:59:30 2007
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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$ */
+
+#ifndef tuscany_sca_extension_binding_scareferencebindingextension_h
+#define tuscany_sca_extension_binding_scareferencebindingextension_h
+
+#include "tuscany/sca/extension/ReferenceBindingExtension.h"
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace binding
+        {
+            
+            class SCAReferenceBindingExtension : public ReferenceBindingExtension 
+            {
+            public:
+            /**
+            * Default constructor
+                */
+                SCAReferenceBindingExtension();
+                
+                /**
+                * Destructor
+                */
+                virtual ~SCAReferenceBindingExtension();            
+                
+                /**
+                * return the name of the extension
+                */
+                virtual const std::string& getExtensionName() {return extensionName;}
+                
+                /**
+                * return the QName of schema elemant for this implementation extension
+                * (e.g. "http://www.osoa.org/xmlns/sca/1.0#binding.ws")
+                */
+                virtual const std::string& getExtensionTypeQName() {return typeQName;}
+                
+                virtual tuscany::sca::model::ReferenceBinding* getReferenceBinding(
+                    tuscany::sca::model::Composite* composite,
+                    tuscany::sca::model::Reference *reference,
+                    commonj::sdo::DataObjectPtr scdlBinding);
+                
+                static void initialize();
+
+            private:
+                static const std::string extensionName;
+                static const std::string typeQName;
+                
+            };
+            
+            
+        } // End namespace binding
+    } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_extension_binding_scareferencebindingextension_h
+

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/tuscany/sca/binding/SCAReferenceBindingExtension.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/tuscany/sca/binding/SCAReferenceBindingExtension.h
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/tuscany/sca/binding/model/SCAReferenceBinding.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/tuscany/sca/binding/model/SCAReferenceBinding.cpp?view=auto&rev=506336
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/tuscany/sca/binding/model/SCAReferenceBinding.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/tuscany/sca/binding/model/SCAReferenceBinding.cpp Sun Feb 11 22:59:30 2007
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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$ */
+
+#include "tuscany/sca/util/Logging.h"
+#include "tuscany/sca/core/Exceptions.h"
+#include "tuscany/sca/binding/model/SCAReferenceBinding.h"
+#include "tuscany/sca/core/ServiceProxy.h"
+
+using namespace std;
+using namespace commonj::sdo;
+using namespace tuscany::sca::model;
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace binding
+        {
+
+            // Constructor
+            SCAReferenceBinding::SCAReferenceBinding(Composite* composite, Reference* reference, const string& uri, DataObjectPtr scdlBinding)
+                : ReferenceBinding(reference, uri)
+            {
+            }
+            
+            // Destructor
+            SCAReferenceBinding::~SCAReferenceBinding()
+            {
+            }
+            
+            ServiceProxy* SCAReferenceBinding::getServiceProxy()
+            {
+                throwException(SystemConfigurationException, "Not supported");
+            }
+                 
+            void SCAReferenceBinding::configure(ServiceBinding* serviceBinding)
+            {
+                throwException(SystemConfigurationException, "Not supported");
+            }
+                                
+            void SCAReferenceBinding::configure(const std::string& uri)
+            {
+                throwException(SystemConfigurationException, "Not supported");
+            }
+                                
+        } // End namespace binding
+    } // End namespace sca
+} // End namespace tuscany

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/tuscany/sca/binding/model/SCAReferenceBinding.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/tuscany/sca/binding/model/SCAReferenceBinding.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/tuscany/sca/binding/model/SCAReferenceBinding.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/tuscany/sca/binding/model/SCAReferenceBinding.h?view=auto&rev=506336
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/tuscany/sca/binding/model/SCAReferenceBinding.h (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/tuscany/sca/binding/model/SCAReferenceBinding.h Sun Feb 11 22:59:30 2007
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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$ */
+
+#ifndef tuscany_sca_extension_binding_model_scareferencebinding_h
+#define tuscany_sca_extension_binding_model_scareferencebinding_h
+
+#include <string>
+
+#include "tuscany/sca/model/Composite.h"
+#include "tuscany/sca/model/ReferenceBinding.h"
+#include "tuscany/sca/model/ServiceBinding.h"
+#include "tuscany/sca/core/ServiceProxy.h"
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace binding
+        {
+            /**
+             * Information about a web service binding for service or a reference.
+             */
+            class SCAReferenceBinding : public tuscany::sca::model::ReferenceBinding
+            {    
+            public:
+
+                /**
+                 * Constructor.
+                 * @param uri The uri of the binding.
+                 */
+                SCAReferenceBinding(tuscany::sca::model::Composite* composite, tuscany::sca::model::Reference* reference, const std::string&uri, commonj::sdo::DataObjectPtr scdlBinding);  
+
+                /**
+                 * Destructor.
+                 */
+                virtual ~SCAReferenceBinding();
+                            
+                /**
+                 * Returns the type of binding.
+                 */                
+                virtual std::string getType() { return "http://www.osoa.org/xmlns/sca/1.0#SCABinding"; };
+                            
+                /**
+                 * Create a proxy representing the reference to the
+                 * client component.
+                 */
+                 virtual tuscany::sca::ServiceProxy* getServiceProxy();
+                 
+                 /**
+                  * Configure this binding from a service binding.
+                  */
+                  virtual void configure(tuscany::sca::model::ServiceBinding* serviceBinding);
+                                
+                 /**
+                  * Configure this binding from a URI.
+                  */
+                  virtual void configure(const std::string& uri);
+                                
+            private:
+            
+            };
+            
+        } // End namespace binding
+    } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_extension_binding_model_scareferencebinding_h

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/tuscany/sca/binding/model/SCAReferenceBinding.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/sca/service/src/tuscany/sca/binding/model/SCAReferenceBinding.h
------------------------------------------------------------------------------
    svn:keywords = Rev Date



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