From a1a3b2928198f75ef6609d582d2b814bb894f4fa Mon Sep 17 00:00:00 2001 From: lresende Date: Thu, 19 Nov 2009 17:58:53 +0000 Subject: Removing obsolete release candidate tag git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@882227 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/runtime/extensions/Makefile.am | 44 - .../sca/runtime/extensions/cpp/Makefile.am | 24 - .../sca/runtime/extensions/cpp/deploy.bat | 74 -- .../sca/runtime/extensions/cpp/src/Makefile.am | 48 -- .../cpp/src/osoa/sca/ComponentContext.cpp | 139 --- .../extensions/cpp/src/osoa/sca/ComponentContext.h | 114 --- .../cpp/src/osoa/sca/CompositeContext.cpp | 113 --- .../extensions/cpp/src/osoa/sca/CompositeContext.h | 98 --- .../cpp/src/osoa/sca/ServiceRuntimeException.h | 101 --- .../runtime/extensions/cpp/src/osoa/sca/export.h | 42 - .../sca/runtime/extensions/cpp/src/osoa/sca/sca.h | 31 - .../cpp/src/tuscany/sca/cpp/CPPExtension.cpp | 74 -- .../cpp/src/tuscany/sca/cpp/CPPExtension.h | 57 -- .../tuscany/sca/cpp/CPPImplementationExtension.cpp | 105 --- .../tuscany/sca/cpp/CPPImplementationExtension.h | 72 -- .../src/tuscany/sca/cpp/CPPInterfaceExtension.cpp | 74 -- .../src/tuscany/sca/cpp/CPPInterfaceExtension.h | 72 -- .../cpp/src/tuscany/sca/cpp/CPPServiceProxy.cpp | 193 ----- .../cpp/src/tuscany/sca/cpp/CPPServiceProxy.h | 116 --- .../cpp/src/tuscany/sca/cpp/CPPServiceWrapper.cpp | 198 ----- .../cpp/src/tuscany/sca/cpp/CPPServiceWrapper.h | 162 ---- .../src/tuscany/sca/cpp/ComponentContextImpl.cpp | 163 ---- .../cpp/src/tuscany/sca/cpp/ComponentContextImpl.h | 123 --- .../src/tuscany/sca/cpp/CompositeContextImpl.cpp | 106 --- .../cpp/src/tuscany/sca/cpp/CompositeContextImpl.h | 93 -- .../tuscany/sca/cpp/model/CPPImplementation.cpp | 82 -- .../src/tuscany/sca/cpp/model/CPPImplementation.h | 150 ---- .../cpp/src/tuscany/sca/cpp/model/CPPInterface.cpp | 62 -- .../cpp/src/tuscany/sca/cpp/model/CPPInterface.h | 121 --- .../tuscany/sca/cpp/model/CPPReferenceBinding.cpp | 59 -- .../tuscany/sca/cpp/model/CPPReferenceBinding.h | 99 --- .../tuscany/sca/cpp/model/CPPServiceBinding.cpp | 52 -- .../src/tuscany/sca/cpp/model/CPPServiceBinding.h | 81 -- .../extensions/cpp/xsd/sca-implementation-cpp.xsd | 49 -- .../extensions/cpp/xsd/sca-interface-cpp.xsd | 43 - .../sca/runtime/extensions/php/Makefile.am | 24 - .../sca/runtime/extensions/php/src/Makefile.am | 45 - .../php/src/osoa/sca/ServiceRuntimeException.h | 115 --- .../runtime/extensions/php/src/osoa/sca/export.h | 42 - .../php/src/tuscany/sca/php/PHPExtension.cpp | 73 -- .../php/src/tuscany/sca/php/PHPExtension.h | 57 -- .../tuscany/sca/php/PHPImplementationExtension.cpp | 78 -- .../tuscany/sca/php/PHPImplementationExtension.h | 72 -- .../php/src/tuscany/sca/php/PHPServiceWrapper.cpp | 405 --------- .../php/src/tuscany/sca/php/PHPServiceWrapper.h | 110 --- .../tuscany/sca/php/model/PHPImplementation.cpp | 87 -- .../src/tuscany/sca/php/model/PHPImplementation.h | 98 --- .../tuscany/sca/php/model/PHPServiceBinding.cpp | 58 -- .../src/tuscany/sca/php/model/PHPServiceBinding.h | 81 -- .../extensions/php/xsd/sca-implementation-php.xsd | 39 - .../sca/runtime/extensions/python/Makefile.am | 24 - .../sca/runtime/extensions/python/deploy.bat | 77 -- .../sca/runtime/extensions/python/src/Makefile.am | 62 -- .../sca/runtime/extensions/python/src/deploy.cmd | 28 - .../sca/runtime/extensions/python/src/deploy.sh | 26 - .../src/tuscany/sca/python/PythonExtension.cpp | 75 -- .../src/tuscany/sca/python/PythonExtension.h | 57 -- .../sca/python/PythonImplementationExtension.cpp | 91 -- .../sca/python/PythonImplementationExtension.h | 73 -- .../sca/python/PythonInterfaceExtension.cpp | 122 --- .../tuscany/sca/python/PythonInterfaceExtension.h | 72 -- .../src/tuscany/sca/python/PythonServiceProxy.cpp | 99 --- .../src/tuscany/sca/python/PythonServiceProxy.h | 86 -- .../sca/python/PythonServiceRuntimeException.h | 100 --- .../tuscany/sca/python/PythonServiceWrapper.cpp | 950 --------------------- .../src/tuscany/sca/python/PythonServiceWrapper.h | 143 ---- .../python/src/tuscany/sca/python/export.h | 41 - .../sca/python/model/PythonImplementation.cpp | 87 -- .../sca/python/model/PythonImplementation.h | 129 --- .../tuscany/sca/python/model/PythonInterface.cpp | 52 -- .../src/tuscany/sca/python/model/PythonInterface.h | 84 -- .../sca/python/model/PythonReferenceBinding.cpp | 59 -- .../sca/python/model/PythonReferenceBinding.h | 95 --- .../sca/python/model/PythonServiceBinding.cpp | 58 -- .../sca/python/model/PythonServiceBinding.h | 82 -- .../python/src/tuscany/sca/python/sca_module.cpp | 380 --------- .../python/src/tuscany/sca/python/sca_proxy.py | 56 -- .../python/src/tuscany/sca/python/sca_setup.py | 60 -- .../python/xsd/sca-implementation-python.xsd | 49 -- .../extensions/python/xsd/sca-interface-python.xsd | 62 -- .../sca/runtime/extensions/ruby/Makefile.am | 24 - .../sca/runtime/extensions/ruby/deploy.bat | 64 -- .../sca/runtime/extensions/ruby/src/Makefile.am | 54 -- .../sca/runtime/extensions/ruby/src/deploy.cmd | 28 - .../sca/runtime/extensions/ruby/src/deploy.sh | 26 - .../extensions/ruby/src/tuscany/sca/ruby/Ruby.h | 39 - .../src/tuscany/sca/ruby/RubyCompositeContext.cpp | 77 -- .../ruby/src/tuscany/sca/ruby/RubyExtension.cpp | 72 -- .../ruby/src/tuscany/sca/ruby/RubyExtension.h | 58 -- .../sca/ruby/RubyImplementationExtension.cpp | 79 -- .../tuscany/sca/ruby/RubyImplementationExtension.h | 72 -- .../ruby/src/tuscany/sca/ruby/RubyServiceProxy.cpp | 374 -------- .../ruby/src/tuscany/sca/ruby/RubyServiceProxy.h | 117 --- .../src/tuscany/sca/ruby/RubyServiceWrapper.cpp | 724 ---------------- .../ruby/src/tuscany/sca/ruby/RubyServiceWrapper.h | 96 --- .../extensions/ruby/src/tuscany/sca/ruby/export.h | 38 - .../tuscany/sca/ruby/model/RubyImplementation.cpp | 154 ---- .../tuscany/sca/ruby/model/RubyImplementation.h | 140 --- .../sca/ruby/model/RubyReferenceBinding.cpp | 59 -- .../tuscany/sca/ruby/model/RubyReferenceBinding.h | 96 --- .../tuscany/sca/ruby/model/RubyServiceBinding.cpp | 52 -- .../tuscany/sca/ruby/model/RubyServiceBinding.h | 78 -- .../ruby/xsd/sca-implementation-ruby.xsd | 39 - .../sca/runtime/extensions/sca/Makefile.am | 23 - .../runtime/extensions/sca/reference/Makefile.am | 18 - .../extensions/sca/reference/axis2c/Makefile.am | 18 - .../sca/reference/axis2c/src/Makefile.am | 38 - .../sca/binding/SCAServiceBindingExtension.cpp | 97 --- .../sca/binding/SCAServiceBindingExtension.h | 74 -- .../sca/binding/model/SCAServiceBinding.cpp | 46 - .../tuscany/sca/binding/model/SCAServiceBinding.h | 72 -- .../sca/runtime/extensions/sca/service/Makefile.am | 18 - .../extensions/sca/service/axis2c/Makefile.am | 18 - .../extensions/sca/service/axis2c/src/Makefile.am | 38 - .../sca/binding/SCAReferenceBindingExtension.cpp | 97 --- .../sca/binding/SCAReferenceBindingExtension.h | 74 -- .../sca/binding/model/SCAReferenceBinding.cpp | 47 - .../sca/binding/model/SCAReferenceBinding.h | 71 -- .../runtime/extensions/sca/xsd/sca-binding-sca.xsd | 37 - .../sca/runtime/extensions/ws/Makefile.am | 23 - .../sca/runtime/extensions/ws/deploy.bat | 45 - .../runtime/extensions/ws/reference/Makefile.am | 18 - .../extensions/ws/reference/axis2c/Makefile.am | 18 - .../extensions/ws/reference/axis2c/src/Makefile.am | 49 -- .../axis2c/src/tuscany/sca/ws/Axis2Client.cpp | 717 ---------------- .../axis2c/src/tuscany/sca/ws/Axis2Client.h | 67 -- .../tuscany/sca/ws/WSServiceBindingExtension.cpp | 108 --- .../src/tuscany/sca/ws/WSServiceBindingExtension.h | 75 -- .../axis2c/src/tuscany/sca/ws/WSServiceWrapper.cpp | 110 --- .../axis2c/src/tuscany/sca/ws/WSServiceWrapper.h | 67 -- .../src/tuscany/sca/ws/model/WSServiceBinding.cpp | 134 --- .../src/tuscany/sca/ws/model/WSServiceBinding.h | 137 --- .../sca/runtime/extensions/ws/reference/deploy.bat | 65 -- .../sca/runtime/extensions/ws/service/Makefile.am | 18 - .../extensions/ws/service/axis2c/Makefile.am | 18 - .../extensions/ws/service/axis2c/src/Makefile.am | 86 -- .../extensions/ws/service/axis2c/src/axis2.xml | 181 ---- .../extensions/ws/service/axis2c/src/deploy.cmd | 39 - .../extensions/ws/service/axis2c/src/deploy.sh | 47 - .../extensions/ws/service/axis2c/src/module.xml | 25 - .../extensions/ws/service/axis2c/src/services.xml | 25 - .../axis2c/src/tuscany/sca/ws/Axis2Dispatcher.cpp | 176 ---- .../src/tuscany/sca/ws/Axis2DispatcherModule.cpp | 149 ---- .../axis2c/src/tuscany/sca/ws/Axis2Service.cpp | 506 ----------- .../axis2c/src/tuscany/sca/ws/Axis2Utils.cpp | 72 -- .../service/axis2c/src/tuscany/sca/ws/Axis2Utils.h | 46 - .../tuscany/sca/ws/WSReferenceBindingExtension.cpp | 108 --- .../tuscany/sca/ws/WSReferenceBindingExtension.h | 74 -- .../axis2c/src/tuscany/sca/ws/WSServiceProxy.cpp | 587 ------------- .../axis2c/src/tuscany/sca/ws/WSServiceProxy.h | 96 --- .../tuscany/sca/ws/model/WSReferenceBinding.cpp | 139 --- .../src/tuscany/sca/ws/model/WSReferenceBinding.h | 153 ---- .../sca/runtime/extensions/ws/service/deploy.bat | 73 -- .../runtime/extensions/ws/service/deploymodule.bat | 69 -- .../extensions/ws/xsd/sca-binding-webservice.xsd | 55 -- 155 files changed, 15718 deletions(-) delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/Makefile.am delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/Makefile.am delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/deploy.bat delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/Makefile.am delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/osoa/sca/ComponentContext.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/osoa/sca/ComponentContext.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/osoa/sca/CompositeContext.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/osoa/sca/CompositeContext.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/osoa/sca/ServiceRuntimeException.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/osoa/sca/export.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/osoa/sca/sca.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPExtension.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPExtension.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPInterfaceExtension.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPInterfaceExtension.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceProxy.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceProxy.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/ComponentContextImpl.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/ComponentContextImpl.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CompositeContextImpl.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CompositeContextImpl.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPReferenceBinding.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPReferenceBinding.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPServiceBinding.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPServiceBinding.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/xsd/sca-implementation-cpp.xsd delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/xsd/sca-interface-cpp.xsd delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/Makefile.am delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/Makefile.am delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/osoa/sca/ServiceRuntimeException.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/osoa/sca/export.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/PHPExtension.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/PHPExtension.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/PHPImplementationExtension.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/PHPImplementationExtension.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/model/PHPImplementation.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/model/PHPImplementation.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/model/PHPServiceBinding.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/model/PHPServiceBinding.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/xsd/sca-implementation-php.xsd delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/Makefile.am delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/deploy.bat delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/Makefile.am delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/deploy.cmd delete mode 100755 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/deploy.sh delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonExtension.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonExtension.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonImplementationExtension.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonImplementationExtension.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonInterfaceExtension.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonInterfaceExtension.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceProxy.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceProxy.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceRuntimeException.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/export.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonInterface.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonInterface.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonReferenceBinding.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonReferenceBinding.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonServiceBinding.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonServiceBinding.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/sca_module.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/sca_proxy.py delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/sca_setup.py delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/xsd/sca-implementation-python.xsd delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/xsd/sca-interface-python.xsd delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/Makefile.am delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/deploy.bat delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/Makefile.am delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/deploy.cmd delete mode 100755 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/deploy.sh delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/Ruby.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyCompositeContext.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyExtension.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyExtension.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyImplementationExtension.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyImplementationExtension.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/export.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyImplementation.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyImplementation.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyReferenceBinding.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyReferenceBinding.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyServiceBinding.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyServiceBinding.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/xsd/sca-implementation-ruby.xsd delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/Makefile.am delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/reference/Makefile.am delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/reference/axis2c/Makefile.am delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/reference/axis2c/src/Makefile.am delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/reference/axis2c/src/tuscany/sca/binding/SCAServiceBindingExtension.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/reference/axis2c/src/tuscany/sca/binding/SCAServiceBindingExtension.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/reference/axis2c/src/tuscany/sca/binding/model/SCAServiceBinding.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/reference/axis2c/src/tuscany/sca/binding/model/SCAServiceBinding.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/service/Makefile.am delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/service/axis2c/Makefile.am delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/service/axis2c/src/Makefile.am delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/service/axis2c/src/tuscany/sca/binding/SCAReferenceBindingExtension.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/service/axis2c/src/tuscany/sca/binding/SCAReferenceBindingExtension.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/service/axis2c/src/tuscany/sca/binding/model/SCAReferenceBinding.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/service/axis2c/src/tuscany/sca/binding/model/SCAReferenceBinding.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/xsd/sca-binding-sca.xsd delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/Makefile.am delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/deploy.bat delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/Makefile.am delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/Makefile.am delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/Makefile.am delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/Axis2Client.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/Axis2Client.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceBindingExtension.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceBindingExtension.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceWrapper.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceWrapper.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/model/WSServiceBinding.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/model/WSServiceBinding.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/deploy.bat delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/Makefile.am delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/Makefile.am delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/Makefile.am delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/axis2.xml delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/deploy.cmd delete mode 100755 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/deploy.sh delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/module.xml delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/services.xml delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Dispatcher.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2DispatcherModule.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Service.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Utils.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Utils.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSReferenceBindingExtension.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSReferenceBindingExtension.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSServiceProxy.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSServiceProxy.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/model/WSReferenceBinding.cpp delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/model/WSReferenceBinding.h delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/deploy.bat delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/deploymodule.bat delete mode 100644 tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/xsd/sca-binding-webservice.xsd (limited to 'tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions') diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/Makefile.am b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/Makefile.am deleted file mode 100644 index d3499698ce..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -# 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. - -if WANT_ALL - CPP_EXTENSION = cpp - PYTHON_EXTENSION = python - RUBY_EXTENSION = ruby - PHP_EXTENSION = php - WSBINDING_EXTENSION = ws - SCABINDING_EXTENSION = sca -endif -if WANT_CPP - CPP_EXTENSION = cpp -endif -if WANT_PYTHON - PYTHON_EXTENSION = python -endif -if WANT_RUBY - RUBY_EXTENSION = ruby -endif -if WANT_PHP - PHP_EXTENSION = php -endif -if WANT_WSBINDING - WSBINDING_EXTENSION = ws -endif -if WANT_SCABINDING - SCABINDING_EXTENSION = sca -endif -SUBDIRS = ${CPP_EXTENSION} ${WSBINDING_EXTENSION} ${SCABINDING_EXTENSION} ${PYTHON_EXTENSION} ${RUBY_EXTENSION} ${PHP_EXTENSION} diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/Makefile.am b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/Makefile.am deleted file mode 100644 index 7fac33118a..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/Makefile.am +++ /dev/null @@ -1,24 +0,0 @@ -# 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. - -SUBDIRS = src - -datadir=$(prefix)/extensions/cpp - -nobase_data_DATA = xsd/*.xsd - -EXTRA_DIST = xsd \ No newline at end of file diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/deploy.bat b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/deploy.bat deleted file mode 100644 index e87f3b4dd6..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/deploy.bat +++ /dev/null @@ -1,74 +0,0 @@ -@echo off - -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. - - -setlocal - -if . == .%1 ( -echo sca root not specified -goto usage -) -set rootdir=%1 -set deploydir=%rootdir%\deploy -set extdir=%deploydir%\extensions -set cppextdir=%extdir%\cpp -set srcdir=%rootdir%\runtime\extensions\cpp\src - -if . == .%2 ( -echo input directory not specified -goto usage -) -set inpath=%2 -echo %inpath% - - -if not exist %deploydir% mkdir %deploydir% -if not exist %extdir% mkdir %extdir% -if not exist %cppextdir% mkdir %cppextdir% -if not exist %cppextdir%\bin mkdir %cppextdir%\bin -if not exist %cppextdir%\lib mkdir %cppextdir%\lib -if not exist %cppextdir%\include mkdir %cppextdir%\include -if not exist %cppextdir%\include\osoa mkdir %cppextdir%\include\osoa -if not exist %cppextdir%\include\osoa\sca mkdir %cppextdir%\include\osoa\sca -if not exist %cppextdir%\include\tuscany mkdir %cppextdir%\include\tuscany -if not exist %cppextdir%\include\tuscany\sca mkdir %cppextdir%\include\tuscany\sca -if not exist %cppextdir%\include\tuscany\sca\cpp mkdir %cppextdir%\include\tuscany\sca\cpp -if not exist %cppextdir%\include\tuscany\sca\cpp\model mkdir %cppextdir%\include\tuscany\sca\cpp\model -if not exist %cppextdir%\xsd mkdir %cppextdir%\xsd - -del %cppextdir%\bin\tuscany_sca_cpp.* -del %cppextdir%\lib\*.lib - -copy %srcdir%\osoa\sca\*.h %cppextdir%\include\osoa\sca -copy %srcdir%\tuscany\sca\cpp\*.h %cppextdir%\include\tuscany\sca\cpp -copy %srcdir%\tuscany\sca\cpp\model\*.h %cppextdir%\include\tuscany\sca\cpp\model - -copy %srcdir%\..\xsd\*.* %cppextdir%\xsd - -copy %inpath%\tuscany_sca_cpp.lib %cppextdir%\lib -copy %inpath%\tuscany_sca_cpp.dll %cppextdir%\bin - -if exist %inpath%\tuscany_sca_cpp.pdb copy %inpath%\tuscany_sca_cpp.pdb %cppextdir%\bin - -goto end -:usage -echo Usage: deploy -:end - -endlocal diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/Makefile.am b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/Makefile.am deleted file mode 100644 index c579dd2598..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/Makefile.am +++ /dev/null @@ -1,48 +0,0 @@ -# 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/cpp/lib -lib_LTLIBRARIES = libtuscany_sca_cpp.la -includedir=$(prefix)/extensions/cpp/include -nobase_include_HEADERS = \ -osoa/sca/*.h \ -tuscany/sca/cpp/*.h \ -tuscany/sca/cpp/model/*.h - -libtuscany_sca_cpp_la_SOURCES = \ -osoa/sca/ComponentContext.cpp \ -osoa/sca/CompositeContext.cpp \ -tuscany/sca/cpp/ComponentContextImpl.cpp \ -tuscany/sca/cpp/CompositeContextImpl.cpp \ -tuscany/sca/cpp/CPPExtension.cpp \ -tuscany/sca/cpp/CPPImplementationExtension.cpp \ -tuscany/sca/cpp/CPPInterfaceExtension.cpp \ -tuscany/sca/cpp/CPPServiceProxy.cpp \ -tuscany/sca/cpp/CPPServiceWrapper.cpp \ -tuscany/sca/cpp/model/CPPImplementation.cpp \ -tuscany/sca/cpp/model/CPPInterface.cpp \ -tuscany/sca/cpp/model/CPPReferenceBinding.cpp \ -tuscany/sca/cpp/model/CPPServiceBinding.cpp - -libtuscany_sca_cpp_la_LIBADD = -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo \ - -L$(top_builddir)/runtime/core/src -ltuscany_sca - -INCLUDES = -Imodel -I$(top_builddir)/runtime/core/src \ - -I${TUSCANY_SDOCPP}/include - -AM_CPPFLAGS = $(CPPFLAGS) -D_DEBUG - \ No newline at end of file diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/osoa/sca/ComponentContext.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/osoa/sca/ComponentContext.cpp deleted file mode 100644 index bd0a6c39db..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/osoa/sca/ComponentContext.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/* - * 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 "osoa/sca/ComponentContext.h" -#include "tuscany/sca/util/Logging.h" -#include "osoa/sca/ServiceRuntimeException.h" -#include "tuscany/sca/cpp/ComponentContextImpl.h" -#include "tuscany/sca/core/SCARuntime.h" -#include "commonj/sdo/SDO.h" -using commonj::sdo::DataFactoryPtr; - -using namespace tuscany::sca; -using namespace tuscany::sca::cpp; - -namespace osoa -{ - namespace sca - { - - // ======================================================= - // getCurrent: create a context from the current component - // ======================================================= - ComponentContext ComponentContext::getCurrent() - { - LOGENTRY(1, "ComponentContext::getCurrent"); - Component* component = tuscany::sca::SCARuntime::getInstance()->getCurrentComponent(); - if (!component) - { - throw ComponentContextException("No current component"); - } - ComponentContext* cci = new ComponentContextImpl(component); - LOGEXIT(1, "ComponentContext::constructor"); - return ComponentContext(cci); - } - - // =========== - // Constructor - // =========== - ComponentContext::ComponentContext(ComponentContext* implementation) - : impl(implementation) - { - LOGENTRY(1, "ComponentContext::constructor"); - LOGEXIT(1, "ComponentContext::constructor"); - } - - // ========== - // Destructor - // ========== - ComponentContext::~ComponentContext() - { - LOGENTRY(1, "ComponentContext::destructor"); - delete impl; - LOGEXIT(1, "ComponentContext::destructor"); - } - - // =================================== - // Copy constructor: create a new impl - // =================================== - ComponentContext::ComponentContext(const ComponentContext& ctx) - { - Component* component = ((ComponentContextImpl*)impl)->getComponent(); - impl = new ComponentContextImpl(component); - } - - // ============================= - // operator= : create a new impl - // ============================= - ComponentContext& ComponentContext::operator=(const ComponentContext& ctx) - { - if (this != &ctx) - { - Component* component = ((ComponentContextImpl*)impl)->getComponent(); - impl = new ComponentContextImpl(component); - } - return *this; - } - - // ========== - // getService - // ========== - void* ComponentContext::getService(const std::string& referenceName) - { - LOGENTRY(1, "ComponentContext::getService"); - void* service = impl->getService(referenceName); - LOGEXIT(1, "ComponentContext::getService"); - return service; - } - - // =========== - // getServices - // =========== - std::list ComponentContext::getServices(const std::string& referenceName) - { - return impl->getServices(referenceName); - } - - // ============ - // getProperties - // ============= - DataObjectPtr ComponentContext::getProperties() - { - LOGENTRY(1, "ComponentContext::getProperties"); - DataObjectPtr properties = impl->getProperties(); - LOGEXIT(1, "ComponentContext::getProperties"); - return properties; - } - - // ============ - // getDataFactory - // ============= - DataFactoryPtr ComponentContext::getDataFactory() - { - LOGENTRY(1, "ComponentContext::getDataFactory"); - DataFactoryPtr dataFactory = impl->getDataFactory(); - LOGEXIT(1, "ComponentContext::getDataFactory"); - return dataFactory; - } - - - } // End namespace sca -} // End namespace osoa diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/osoa/sca/ComponentContext.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/osoa/sca/ComponentContext.h deleted file mode 100644 index fae62062b2..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/osoa/sca/ComponentContext.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - * 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 osoa_sca_componentcontext_h -#define osoa_sca_componentcontext_h - -#include "osoa/sca/export.h" -#include "commonj/sdo/SDO.h" -#include -#include -namespace osoa -{ - namespace sca - { - - /** - * An SCA component implementation uses the ComponentContext class to - * retrieve information about the configured SCA component. - */ - class SCA_CPP_API ComponentContext - { - - public: - /** - * Return a new ComponentContext for the current Component. - */ - static ComponentContext getCurrent(); - - /** - * Resolve a reference name into a single configured service. - * If the component's reference is wired to more than one service - * then theis method will return an exception. - * @param referenceName The reference to be resolved. This must match - * the name of a reference configured in the component type file for - * this component. - */ - virtual void* getService(const std::string& referenceName); - - /** - * Resolve a reference name into a list of configured services. - * @param referenceName The reference to be resolved. This must match - * the name of a reference configured in the component type file for - * this component. - */ - virtual std::list getServices(const std::string& referenceName); - - /** - * Get the configured properties for the component. - * @return A data object representing all the properties that - * are configured for this component. - */ - virtual commonj::sdo::DataObjectPtr getProperties(); - - /** - * Get an SDO data factory which will allow the component to - * create data objects for all the types configured for this - * component. - * @return A data factory to be used by the component to create - * new data objects. - */ - virtual commonj::sdo::DataFactoryPtr getDataFactory(); - - /** - * Destructor - */ - virtual ~ComponentContext(); - - /** - * Constructor - */ - ComponentContext(const ComponentContext&); - - /** - * Copy operator - */ - ComponentContext& operator=(const ComponentContext&); - - /** - * Constructor to create an interface class from the contained - * implementation. - * @param implementation the actual implementation class - */ - ComponentContext(ComponentContext* implementation); - - private: - - /** - * Pointer to the class which provides the actual implementation. - */ - ComponentContext* impl; - - }; - } // End namespace sca -} // End namespace osoa - -#endif // osoa_sca_componentcontext_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/osoa/sca/CompositeContext.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/osoa/sca/CompositeContext.cpp deleted file mode 100644 index 43e5e6806e..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/osoa/sca/CompositeContext.cpp +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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 "osoa/sca/CompositeContext.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/cpp/CompositeContextImpl.h" -#include "tuscany/sca/core/SCARuntime.h" -#include "commonj/sdo/SDO.h" - -using commonj::sdo::DataFactoryPtr; -using namespace tuscany::sca; -using namespace tuscany::sca::cpp; - - -namespace osoa -{ - namespace sca - { - // =========== - // Constructor - // =========== - CompositeContext::CompositeContext(CompositeContext* implementation) - : impl(implementation) - { - } - - // =================================== - // Copy constructor: create a new impl - // =================================== - CompositeContext::CompositeContext(const CompositeContext& ctx) - { - impl = new CompositeContextImpl( - tuscany::sca::SCARuntime::getInstance()->getDefaultComponent()); - } - - // ============================= - // operator= : create a new impl - // ============================= - CompositeContext& CompositeContext::operator=(const CompositeContext& ctx) - { - if (this != &ctx) - { - impl = new CompositeContextImpl( - tuscany::sca::SCARuntime::getInstance()->getDefaultComponent()); - } - return *this; - } - - // ========== - // Destructor - // ========== - CompositeContext::~CompositeContext() - { - LOGENTRY(1, "CompositeContext::destructor"); - delete impl; - LOGEXIT(1, "CompositeContext::destructor"); - } - - // ==================================================== - // getCurrent: create a context from the current composite - // ==================================================== - CompositeContext CompositeContext::getCurrent() - { - LOGENTRY(1, "CompositeContext::getCurrent"); - CompositeContext* cci = new CompositeContextImpl( - tuscany::sca::SCARuntime::getInstance()->getDefaultComponent()); - LOGEXIT(1, "CompositeContext::getCurrent"); - return CompositeContext(cci); - } - - // ============= - // locateService - // ============= - void* CompositeContext::locateService(const std::string& serviceName) - { - LOGENTRY(1, "CompositeContext::locateService"); - void* sp = impl->locateService(serviceName); - LOGEXIT(1, "CompositeContext::locateService"); - return sp; - } - - // ============= - // getDataFactory - // ============= - DataFactoryPtr CompositeContext::getDataFactory() - { - LOGENTRY(1, "CompositeContext::getDataFactory"); - DataFactoryPtr df = impl->getDataFactory(); - LOGEXIT(1, "CompositeContext::getDataFactory"); - return df; - } - - - } // End namespace sca -} // End namespace osoa diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/osoa/sca/CompositeContext.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/osoa/sca/CompositeContext.h deleted file mode 100644 index ac13ed875e..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/osoa/sca/CompositeContext.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * 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 osoa_sca_compositecontext_h -#define osoa_sca_compositecontext_h - -#include "osoa/sca/export.h" -#include "commonj/sdo/SDO.h" - -namespace osoa -{ - namespace sca - { - /** - * An SCA component implementation, or a non-SCA client, uses the - * CompositeContext class to retrieve information about the configured - * SCA composite. - */ - class SCA_CPP_API CompositeContext - { - - public: - /** - * Return a new CompositeContext for the current Component. - */ - static CompositeContext getCurrent(); - - /** - * Resolve a service name into a single component service. - * @param serviceName The name of the service in the form - * "component name"/"service name". The service name is - * optional in the component has one service. - * @return A pointer to an object which can be cast to the - * business interface of the target service. - */ - virtual void* locateService(const std::string& serviceName); - - /** - * Get an SDO data factory which will allow the component to - * create data objects for all the types configured for this - * component. - * @return A data factory to be used by the component to create - * new data objects. - */ - virtual commonj::sdo::DataFactoryPtr getDataFactory(); - - /** - * Destructor. - */ - virtual ~CompositeContext(); - - /** - * Constructor - */ - CompositeContext(const CompositeContext&); - - /** - * Copy operator - */ - CompositeContext& operator=(const CompositeContext&); - - /** - * Constructor to create an interface class from the contained - * implementation. - * @param implementation The actual implementation class. - */ - CompositeContext(CompositeContext* implementation); - - private: - - /** - * Pointer to the class which provides the actual implementation. - */ - CompositeContext* impl; - - }; - } // End namespace sca -} // End namespace osoa - -#endif // osoa_sca_compositecontext_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/osoa/sca/ServiceRuntimeException.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/osoa/sca/ServiceRuntimeException.h deleted file mode 100644 index 7bf8800242..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/osoa/sca/ServiceRuntimeException.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * 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 osoa_sca_serviceruntimeexception_h -#define osoa_sca_serviceruntimeexception_h - -#include "osoa/sca/export.h" - -#include "tuscany/sca/util/Exceptions.h" -using tuscany::sca::TuscanyRuntimeException; -namespace osoa -{ - namespace sca - { - /** - * Top level exception to represent all the exceptions that may be - * thrown by an SCA runtime implementation. - */ - class SCA_CPP_API ServiceRuntimeException : public TuscanyRuntimeException - { - public: - ServiceRuntimeException( - const char *name="ServiceRuntimeException", - severity_level sev=Severe, - const char* msg_text="") - : TuscanyRuntimeException(name, sev, msg_text) - { - } - }; // End ServiceRuntimeException class definition - - - /** - * A remotable service is currently unavailable. It is possible that a retry - * may resolve this exception. - */ - class SCA_CPP_API ServiceUnavailableException: public ServiceRuntimeException - { - public: - ServiceUnavailableException(const char* serviceName) - : ServiceRuntimeException("ServiceUnavailableException", Warning, - serviceName) - { - } - private: - }; // End ServiceUnavailableException class definition - - - /** - * The target of a wire cannot be found, or the reference has not been - * configured. - */ - class SCA_CPP_API ServiceNotFoundException: public ServiceRuntimeException - { - public: - ServiceNotFoundException(const char* msg) - : ServiceRuntimeException("ServiceNotFoundException", Error, - msg) - { - } - private: - }; // End ServiceNotFoundException class definition - - - /** - * There is no current component (for example, if a non-SCA component - * tries to get the current ComponentContext). - */ - class SCA_CPP_API ComponentContextException: public ServiceRuntimeException - { - public: - ComponentContextException(const char* msg) - : ServiceRuntimeException("ComponentContextException", Error, - msg) - { - } - private: - }; // End ComponentContextException class definition - - - } // End namespace sca -} // End namespace osoa - -#endif // osoa_sca_serviceruntimeexception_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/osoa/sca/export.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/osoa/sca/export.h deleted file mode 100644 index 8a69913be4..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/osoa/sca/export.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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 osoa_sca_export_h -#define osoa_sca_export_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) - -#ifdef TUSCANY_SCA_CPP_EXPORTS -#define SCA_CPP_API __declspec(dllexport) -#else -#define SCA_CPP_API __declspec(dllimport) -#endif - -#else -#include -#include -#include -#define SCA_CPP_API -#endif - -#endif // osoa_sca_export_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/osoa/sca/sca.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/osoa/sca/sca.h deleted file mode 100644 index 6cce9453d7..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/osoa/sca/sca.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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 osoa_sca_sca_h -#define osoa_sca_sca_h - -#include "osoa/sca/export.h" -#include "osoa/sca/CompositeContext.h" -#include "osoa/sca/ComponentContext.h" -#include "osoa/sca/ServiceRuntimeException.h" - -#endif // osoa_sca_sca_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPExtension.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPExtension.cpp deleted file mode 100644 index b418a52425..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPExtension.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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/cpp/CPPExtension.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/core/SCARuntime.h" -#include "tuscany/sca/cpp/CPPImplementationExtension.h" -#include "tuscany/sca/cpp/CPPInterfaceExtension.h" - - -extern "C" -{ - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - void tuscany_sca_extension_initialize() - { - tuscany::sca::cpp::CPPExtension::initialize(); - } -} - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - // =================================================================== - // Constructor for the CPPExtension class. - // =================================================================== - CPPExtension::CPPExtension() - { - LOGENTRY(1, "CPPExtension::constructor"); - LOGEXIT(1, "CPPExtension::constructor"); - } - - // =================================================================== - // Destructor for the CPPExtension class. - // =================================================================== - CPPExtension::~CPPExtension() - { - LOGENTRY(1, "CPPExtension::destructor");; - LOGEXIT(1, "CPPExtension::destructor"); - } - - void CPPExtension::initialize() - { - LOGENTRY(1, "CPPExtension::initialize");; - SCARuntime::getInstance()->registerImplementationExtension(new CPPImplementationExtension()); - SCARuntime::getInstance()->registerInterfaceExtension(new CPPInterfaceExtension()); - LOGEXIT(1, "CPPExtension::initialize");; - } - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPExtension.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPExtension.h deleted file mode 100644 index d6c872629d..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPExtension.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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_cpp_cppextension_h -#define tuscany_sca_cpp_cppextension_h - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - - class CPPExtension - { - public: - /** - * Default constructor - */ - CPPExtension(); - - /** - * Destructor - */ - virtual ~CPPExtension(); - - static void initialize(); - - private: - - }; - - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_cpp_cppextension_h - diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.cpp deleted file mode 100644 index 5ddf4b1113..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/* - * 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/cpp/CPPImplementationExtension.h" -#include "tuscany/sca/cpp/model/CPPImplementation.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/util/Utils.h" - - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - // =================================================================== - // Constructor for the CPPImplementationExtension class. - // =================================================================== - CPPImplementationExtension::CPPImplementationExtension() - { - LOGENTRY(1, "CPPImplementationExtension::constructor"); - LOGEXIT(1, "CPPImplementationExtension::constructor"); - } - - // =================================================================== - // Destructor for the CPPImplementationExtension class. - // =================================================================== - CPPImplementationExtension::~CPPImplementationExtension() - { - LOGENTRY(1, "CPPImplementationExtension::destructor");; - LOGEXIT(1, "CPPImplementationExtension::destructor"); - } - - const string CPPImplementationExtension::extensionName("cpp"); - const string CPPImplementationExtension::typeQName("http://www.osoa.org/xmlns/sca/1.0#CPPImplementation"); - - // =================================================================== - // loadModelElement - load the info from implementation.cpp - // =================================================================== - ComponentType* CPPImplementationExtension::getImplementation(Composite *composite, DataObjectPtr scdlImplementation) - { - string implType = scdlImplementation->getType().getName(); - if (implType == "CPPImplementation") - { - string library = scdlImplementation->getCString("library"); - string header = scdlImplementation->getCString("header"); - string className = scdlImplementation->getCString("class"); - string scopeName = scdlImplementation->getCString("scope"); - - CPPImplementation::Scope scope; - if (scopeName == "composite") - { - scope = CPPImplementation::COMPOSITE; - } - else - { - scope = CPPImplementation::STATELESS; - } - - string headerPath; - string headerStub; - - // Separate any path element - Utils::rTokeniseString("/", header, headerPath, headerStub); - if (headerPath != "") - { - headerPath += "/"; - } - - // Determine the header stub name - string tmp; - Utils::rTokeniseString(".h", headerStub, headerStub, tmp); - - CPPImplementation* cppImpl = new CPPImplementation( - composite, library, header, headerPath, headerStub, className, scope); - - return cppImpl; - } - else - { - return NULL; - } - } - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.h deleted file mode 100644 index 8548a208e9..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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_cpp_cppimplementationextension_h -#define tuscany_sca_cpp_cppimplementationextension_h - -#include "tuscany/sca/extension/ImplementationExtension.h" - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - - class CPPImplementationExtension : public ImplementationExtension - { - public: - /** - * Default constructor - */ - CPPImplementationExtension(); - - /** - * Destructor - */ - virtual ~CPPImplementationExtension(); - - /** - * return the name of the extension - */ - virtual const string& getExtensionName() {return extensionName;} - - /** - * return the QName of schema type for this implementation extension - * (e.g. "http://www.osoa.org/xmlns/sca/1.0#implementation.cpp") - */ - virtual const string& getExtensionTypeQName() {return typeQName;} - - virtual ComponentType* getImplementation(Composite* composite, DataObjectPtr scdlImplementation); - - private: - static const string extensionName; - static const string typeQName; - - }; - - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_cpp_cppimplementationextension_h - diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPInterfaceExtension.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPInterfaceExtension.cpp deleted file mode 100644 index d470949746..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPInterfaceExtension.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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/cpp/CPPInterfaceExtension.h" -#include "tuscany/sca/cpp/model/CPPInterface.h" -#include "tuscany/sca/util/Logging.h" - - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - // =================================================================== - // Constructor for the CPPInterfaceExtension class. - // =================================================================== - CPPInterfaceExtension::CPPInterfaceExtension() - { - LOGENTRY(1, "CPPInterfaceExtension::constructor"); - LOGEXIT(1, "CPPInterfaceExtension::constructor"); - } - - // =================================================================== - // Destructor for the CPPInterfaceExtension class. - // =================================================================== - CPPInterfaceExtension::~CPPInterfaceExtension() - { - LOGENTRY(1, "CPPInterfaceExtension::destructor");; - LOGEXIT(1, "CPPInterfaceExtension::destructor"); - } - - const string CPPInterfaceExtension::extensionName("cpp"); - const string CPPInterfaceExtension::typeQName("http://www.osoa.org/xmlns/sca/1.0#CPPInterface"); - - // =================================================================== - // loadModelElement - load the info from interface.cpp - // =================================================================== - tuscany::sca::model::Interface* CPPInterfaceExtension::getInterface(Composite* composite, DataObjectPtr scdlInterface) - { - // Determine the type - string ifType = scdlInterface->getType().getName(); - if (ifType == "CPPInterface") - { - string header = scdlInterface->getCString("header"); - string className = scdlInterface->getCString("class"); - bool remotable = scdlInterface->getBoolean("remotable"); - - return new CPPInterface(header, className, remotable, false); - } - return 0; - } - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPInterfaceExtension.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPInterfaceExtension.h deleted file mode 100644 index 62c3b9854b..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPInterfaceExtension.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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_cpp_cppinterfaceextension_h -#define tuscany_sca_cpp_cppinterfaceextension_h - -#include "tuscany/sca/extension/InterfaceExtension.h" - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - - class CPPInterfaceExtension : public InterfaceExtension - { - public: - /** - * Default constructor - */ - CPPInterfaceExtension(); - - /** - * Destructor - */ - virtual ~CPPInterfaceExtension(); - - /** - * return the name of the extension - */ - virtual const string& getExtensionName() {return extensionName;} - - /** - * return the QName of schema type for this interface extension - * (e.g. "http://www.osoa.org/xmlns/sca/1.0#interface.cpp") - */ - virtual const string& getExtensionTypeQName() {return typeQName;} - - virtual tuscany::sca::model::Interface* getInterface(Composite* composite, DataObjectPtr scdlInterface); - - private: - static const string extensionName; - static const string typeQName; - - }; - - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_cpp_cppinterfaceextension_h - diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceProxy.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceProxy.cpp deleted file mode 100644 index 56511fc9e6..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceProxy.cpp +++ /dev/null @@ -1,193 +0,0 @@ -/* - * 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/cpp/CPPServiceProxy.h" -#include "tuscany/sca/util/Logging.h" -#include "osoa/sca/ServiceRuntimeException.h" -#include "tuscany/sca/core/SCARuntime.h" -#include "tuscany/sca/model/Reference.h" -#include "tuscany/sca/model/ReferenceType.h" -#include "tuscany/sca/model/Service.h" -#include "tuscany/sca/model/ServiceType.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/ComponentType.h" -#include "tuscany/sca/core/ServiceWrapper.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/ServiceBinding.h" -#include "tuscany/sca/cpp/model/CPPImplementation.h" -#include "tuscany/sca/cpp/model/CPPReferenceBinding.h" - -using namespace osoa::sca; - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - - // ============================ - // Constructor: Create a proxy - // ============================ - CPPServiceProxy::CPPServiceProxy(Reference* reference) - : ServiceProxy(reference) - { - LOGENTRY(1,"CPPServiceProxy::constructor"); - - // ---------------------- - // Get the component - // ---------------------- - Component* component = reference->getComponent(); - string name = reference->getType()->getName(); - - // Get the service wrapper - CPPReferenceBinding* referenceBinding = (CPPReferenceBinding*)reference->getBinding(); - - ServiceWrapper* serviceWrapper = referenceBinding->getTargetServiceBinding()->getServiceWrapper(); - - createProxy(component, name, serviceWrapper); - - LOGEXIT(1,"CPPServiceProxy::constructor"); - } - - // ============================ - // Constructor: Create a proxy - // ============================ - CPPServiceProxy::CPPServiceProxy(Service* service) - : ServiceProxy(0) - { - LOGENTRY(1,"CPPServiceProxy::constructor"); - - // ---------------------- - // Get the component - // ---------------------- - Component* component = service->getComponent(); - string name = service->getType()->getName(); - - // Get the service wrapper - ServiceWrapper* serviceWrapper = service->getBinding()->getServiceWrapper(); - - createProxy(component, name, serviceWrapper); - - LOGEXIT(1,"CPPServiceProxy::constructor"); - } - - void CPPServiceProxy::createProxy(Component* component, const string& name, ServiceWrapper* serviceWrapper) - { - LOGENTRY(1,"CPPServiceProxy::createProxy"); - - ComponentType* componentType = component->getType(); - if (!componentType) - { - string msg = "Component " + component->getName() + " has no implementation defined"; - throw ServiceNotFoundException(msg.c_str()); - } - - // If we got here we have a CPP implementation - CPPImplementation* impl = (CPPImplementation *)componentType; - - // ---------------------------------------------------- - // Get implementation dll name and service factory name - // ---------------------------------------------------- - string library = impl->getLibrary(); - string headerStub = impl->getHeaderStub(); - - string fullLibraryName = component->getComposite()->getRoot() + "/" + library; - string proxyFactoryName = headerStub + "_" + name + "_Proxy_Factory"; - string proxyDestructorName = headerStub + "_" + name + "_Proxy_Destructor"; - typedef void* (* PROXYFACTORY) (ServiceWrapper*); - - // ------------ - // Load the dll - // ------------ - proxyLibrary = Library(fullLibraryName); - - // ------------------------- - // Locate the factory method - // ------------------------- - PROXYFACTORY proxyFactory = (PROXYFACTORY)proxyLibrary.getSymbol(proxyFactoryName); - if (!proxyFactory) - { - LOGERROR_2(1, "CPPServiceProxy::createProxy: Unable to locate %s in library %s", - proxyFactoryName.c_str(), fullLibraryName.c_str()); - string msg = "Unable to locate " + proxyFactoryName + " in library " + fullLibraryName; - throw ServiceNotFoundException(msg.c_str()); - } - - // ----------------------------------- - // Now create an instance of the proxy - // ----------------------------------- - void* proxy = proxyFactory(serviceWrapper); - if (!proxy) - { - LOGERROR_2(1, "CPPServiceProxy::createProxy: Factory method %s in library %s returned null", - proxyFactoryName.c_str(), fullLibraryName.c_str()); - string msg = "Factory method " + proxyFactoryName + " in library " + fullLibraryName + " returned null"; - throw ServiceNotFoundException(msg.c_str()); - } - else - { - proxies.push_back(proxy); - } - - // ------------------------- - // Get the destructor method - // ------------------------- - destructor = (PROXYDESTRUCTOR)proxyLibrary.getSymbol(proxyDestructorName); - - LOGEXIT(1,"CPPServiceProxy::createProxy"); - } - - // ========== - // Destructor - // ========== - CPPServiceProxy::~CPPServiceProxy() - { - LOGENTRY(1,"CPPServiceProxy::destructor"); - - // Delete the proxies - if (destructor != NULL && proxies.size() != 0) - { - destructor(*proxies.begin()); - } - LOGEXIT(1,"CPPServiceProxy::destructor"); - } - - CPPServiceProxy::PROXIES CPPServiceProxy::getProxies() - { - return proxies; - } - - void* CPPServiceProxy::getProxy() - { - if (proxies.size() != 0) - { - return *proxies.begin(); - } - else - { - return NULL; - } - } - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceProxy.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceProxy.h deleted file mode 100644 index 77a20d08b8..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceProxy.h +++ /dev/null @@ -1,116 +0,0 @@ -/* - * 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_cpp_cppserviceproxy_h -#define tuscany_sca_cpp_cppserviceproxy_h - -#include "osoa/sca/export.h" -#include "tuscany/sca/core/ServiceProxy.h" -#include "tuscany/sca/core/ServiceWrapper.h" -#include "tuscany/sca/util/Library.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Reference.h" -#include "tuscany/sca/model/Service.h" - -using namespace tuscany::sca::model; - - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - - /** - * 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 CPPServiceProxy : public ServiceProxy - { - public: - /** - * Create a new service proxy for a reference. The proxy will contain a pointer to - * the target ServiceWrapper. - * @param reference The reference on the source component. - * @param target The wrapper of the service which is wired to this reference. - */ - CPPServiceProxy(Reference* reference); - - /** - * Create a new service proxy for a service. The proxy will contain a pointer to - * the target ServiceWrapper. - * @param reference The service on the target component. - * @param target The wrapper of the target service. - */ - CPPServiceProxy(Service* service); - - /** - * Destructor. - */ - virtual ~CPPServiceProxy(); - - /** - * Return an instance of the proxy created for this particular component and reference. - * @return The proxy. - */ - virtual void* getProxy(); - - /** - * Return the proxies created for this particular component and reference. - * @return The proxies. - */ - typedef std::list PROXIES; - virtual PROXIES getProxies(); - - private: - - /** - * Create the proxy - */ - void createProxy(Component* component, const string& name, ServiceWrapper* serviceWrapper); - - /** - * Holds the instances of the code generated proxies. - */ - PROXIES proxies; - - /** - * A function pointer to the destructor of the proxy. - */ - typedef void (* PROXYDESTRUCTOR) (void*); - PROXYDESTRUCTOR destructor; - - /** - * The library which contains the code for the proxy. - */ - Library proxyLibrary; - - }; - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_cpp_cppserviceproxy_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.cpp deleted file mode 100644 index 3d7df2d44d..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.cpp +++ /dev/null @@ -1,198 +0,0 @@ -/* - * 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/cpp/CPPServiceWrapper.h" - -#include "osoa/sca/ServiceRuntimeException.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/util/Library.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/Service.h" -#include "tuscany/sca/model/ServiceType.h" -#include "tuscany/sca/core/SCARuntime.h" -#include "tuscany/sca/cpp/model/CPPImplementation.h" -#include "tuscany/sca/model/Interface.h" - -using namespace osoa::sca; - - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - - // =================== - // Static data members - // =================== - void* CPPServiceWrapper::staticImpl = 0; - - // =========== - // Constructor - // =========== - CPPServiceWrapper::CPPServiceWrapper(Service* service) - : ServiceWrapper(service) - { - LOGENTRY(1,"CPPServiceWrapper::constructor"); - - component = service->getComponent(); - interf = service->getType()->getInterface(); - implementation = (CPPImplementation*)component->getType(); - - LOGEXIT(1,"CPPServiceWrapper::constructor"); - - } - - // ========== - // Destructor - // ========== - CPPServiceWrapper::~CPPServiceWrapper() - { - LOGENTRY(1,"CPPServiceWrapper::destructor"); - LOGEXIT(1,"CPPServiceWrapper::destructor"); - } - - - // ====================================================================== - // getImplementation: get an implementation for this scope - // ====================================================================== - void* CPPServiceWrapper::getImplementation() - { - if (implementation->getScope() == CPPImplementation::COMPOSITE) - { - if (!staticImpl) - { - staticImpl = newImplementation(); - } - return staticImpl; - } - else // (scope == CPPInterface::STATELESS) - { - return newImplementation(); - } - } - - // ====================================================================== - // releaseImplementation: release the implementation for this scope - // ====================================================================== - void CPPServiceWrapper::releaseImplementation() - { - if (implementation->getScope() == CPPImplementation::STATELESS) - { - deleteImplementation(); - } - } - - // ====================================================================== - // invoke: wrapper call to service with setting the component context - // ====================================================================== - void CPPServiceWrapper::invoke(Operation& operation) - { - LOGENTRY(1,"CPPServiceWrapper::invoke"); - - SCARuntime* runtime = SCARuntime::getInstance(); - runtime->setCurrentComponent(component); - - try - { - invokeService(operation); - } - catch (...) - { - runtime->unsetCurrentComponent(); - throw; - } - runtime->unsetCurrentComponent(); - LOGEXIT(1,"CPPServiceWrapper::invoke"); - - } - - void CPPServiceWrapper::setLibrary(Library* lib) - { - wrapperLibrary = lib; - } - - // ====================================================================== - // getServiceWrapper: create a wrapper for the target ComponentService - // ====================================================================== - CPPServiceWrapper* CPPServiceWrapper::getServiceWrapper(Service* service) - { - CPPServiceWrapper* serviceWrapper = 0; - - // ----------------------------------------------- - // Get the implementation for the target component - // ----------------------------------------------- - Component* component = service->getComponent(); - CPPImplementation* impl = (CPPImplementation*)component->getType(); - if (!impl) - { - string msg = "Component " + component->getName() + " has no implementation defined"; - throw ServiceNotFoundException(msg.c_str()); - } - - // ---------------------------------------------------- - // Get implementation dll name and wrapper factory name - // ---------------------------------------------------- - string libraryName = impl->getLibrary(); - string wrapperFactoryName = impl->getHeaderStub() - + "_" + service->getType()->getName() + "_Wrapper_Factory"; - - // ------------ - // Load the dll - // ------------ - string fullLibraryName = component->getComposite()->getRoot() + "/" + libraryName; - typedef CPPServiceWrapper* (* WRAPPERFACTORY) (Service*); - Library* wrapperLib = new Library(fullLibraryName); - - // ------------------------- - // Locate the factory method - // ------------------------- - WRAPPERFACTORY wrapperFactory = (WRAPPERFACTORY)wrapperLib->getSymbol(wrapperFactoryName); - if (!wrapperFactory) - { - LOGERROR_2(1, "CPPServiceWrapper::getServiceWrapper: Unable to locate %s in library %s", - wrapperFactoryName.c_str(), fullLibraryName.c_str()); - string msg = "Unable to locate " + wrapperFactoryName + " in library " + fullLibraryName; - throw ServiceNotFoundException(msg.c_str()); - } - - // ------------------------------------- - // Now create an instance of the wrapper - // ------------------------------------- - serviceWrapper = wrapperFactory(service); - if (!serviceWrapper) - { - LOGERROR_2(1, "CPPServiceWrapper::getServiceWrapper: Factory method %s in library %s returned null", - wrapperFactoryName.c_str(), fullLibraryName.c_str()); - string msg = "Factory method " + wrapperFactoryName + " in library " + fullLibraryName + " returned null"; - throw ServiceNotFoundException(msg.c_str()); - } - serviceWrapper->setLibrary(wrapperLib); - - return serviceWrapper; - } - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.h deleted file mode 100644 index eeeb9cdb82..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - * 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_cpp_cppservicewrapper_h -#define tuscany_sca_cpp_cppservicewrapper_h - -#include "osoa/sca/export.h" -#include "tuscany/sca/core/ServiceWrapper.h" -#include "tuscany/sca/core/Operation.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Interface.h" -#include "tuscany/sca/cpp/model/CPPImplementation.h" -#include "tuscany/sca/util/Library.h" - -using namespace tuscany::sca::model; - - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - - /** - * Wraps the service on a component implementation. - * This abstract class is extended by generated code which provides - * the implementation of some of the methods. - * An instance of this class wraps the actual component implementation which - * has been written by a developer of an SCA application. - */ - class SCA_CPP_API CPPServiceWrapper : public ServiceWrapper - { - public: - /** - * Factory method to create a new CPPServiceWrapper for a given target - * service. This method will provide all the loading of dlls required to - * create the target component. - * @param target The service on the component for which this wrapper is to be - * created. - * @return A wrapper that references the given target. - */ - static CPPServiceWrapper* getServiceWrapper(Service* service); - - /** - * Constructor. - * @param target The component service to which this wrapper refers. - */ - CPPServiceWrapper(Service* service); - - /** - * Destructor. - */ - virtual ~CPPServiceWrapper(); - - /** - * All business method calls to the target component go through the invoke method. - * @param operation The details of the method, paramaters and return value for the - * business method to be called on the target component. - */ - virtual void invoke(Operation& operation); - - /** - * Return the loaded shared library for the target component. - */ - Library* getLibrary() const { return wrapperLibrary; } - - protected: - - /** - * Delegated method to invoke the correct method on the target component. - * Implemented by the subtype. - */ - virtual void invokeService(Operation& operation) = 0; - - /** - * Delegated method to create a new component implementation. - * Implemented by the subtype. - * @return A pointer to an instance of the component implementation class. - */ - virtual void* newImplementation() = 0; - - /** - * Delegated method to delete the current instance of the component - * implementation. - * Implemented by the subtype. - */ - virtual void deleteImplementation() = 0; - - /** - * Return the current instance of the component implementation. - * @return A pointer to an instance of the component implementation class. - */ - virtual void* getImplementation(); - - /** - * Indicates that the current instance of the component implementation - * has been finished with. - * Will call CPPServiceWrapper#deleteImplementation if the - * implementation is stateless (so that a new instance is returned - * for each call). - */ - virtual void releaseImplementation(); - - private: - /** - * Holds an implementation instance if the scope is set to composite. - */ - static void* staticImpl; - - /** - * The component to which this wrapper refers. - */ - Component* component; - - /** - * A pointer to the interface which the service exposes. - */ - Interface* interf; - - /** - * The component implementation - */ - CPPImplementation* implementation; - - /** - * Pointer to the loaded library which contains the component - * implementation. - */ - Library* wrapperLibrary; - - /** - * Set the loaded library which contains the component - * implementation. - * @param lib The library. - */ - void setLibrary(Library* lib); - }; - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_cpp_cppservicewrapper_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/ComponentContextImpl.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/ComponentContextImpl.cpp deleted file mode 100644 index 76d6bbc5f6..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/ComponentContextImpl.cpp +++ /dev/null @@ -1,163 +0,0 @@ -/* - * 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 "osoa/sca/ServiceRuntimeException.h" -#include "tuscany/sca/cpp/ComponentContextImpl.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/ReferenceBinding.h" -#include "tuscany/sca/model/ReferenceType.h" -#include "tuscany/sca/model/ServiceBinding.h" - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - - // =========== - // Constructor - // =========== - ComponentContextImpl::ComponentContextImpl(Component* comp) - : ComponentContext(0), component(comp) - { - LOGENTRY(1, "ComponentContextImpl::constructor"); - LOGEXIT(1, "ComponentContextImpl::constructor"); - } - - // ========== - // Destructor - // ========== - ComponentContextImpl::~ComponentContextImpl() - { - } - - - // ========================================================================== - // getServices: return a list of Proxies for services wired to this reference - // ========================================================================== - std::list ComponentContextImpl::getServices(const std::string& referenceName) - { - LOGENTRY(1, "ComponentContextImpl::getServices"); - - // -------------------------------------------------------------- - // locate reference in the current component and determine target - // -------------------------------------------------------------- - Reference* reference = component->findReference(referenceName); - if (!reference) - { - string message = "Reference not defined: "; - message = message + referenceName; - throw ServiceNotFoundException(message.c_str()); - } - - // Get a service proxy from the binding configured on the reference - CPPServiceProxy* serviceProxy = (CPPServiceProxy*)reference->getBinding()->getServiceProxy(); - if (serviceProxy == NULL) - { - string message = "Reference "; - message = message + referenceName + " not wired"; - throw ServiceNotFoundException(message.c_str()); - } - - return serviceProxy->getProxies(); - - } // End getServices() - - - // =================================================================== - // getService: return a Proxy for the services wired to this reference - // =================================================================== - void* ComponentContextImpl::getService(const std::string& referenceName) - { - LOGENTRY(1, "ComponentContextImpl::getService"); - - // -------------------------------------------------------------- - // locate reference in the current component and determine target - // -------------------------------------------------------------- - Reference* reference = component->findReference(referenceName); - if (!reference) - { - string message = "Reference not defined: "; - message = message + referenceName; - throw ServiceNotFoundException(message.c_str()); - } - - // -------------------- - // Validate the request - // -------------------- - switch (reference->getType()->getMultiplicity()) - { - case ReferenceType::ZERO_MANY: - case ReferenceType::ONE_MANY: - { - string message = "getService() called for reference with multiplicity >1 :"; - message = message + referenceName; - throw ServiceNotFoundException(message.c_str()); - } - default: - { - } - } // end switch - - // Get a service proxy from the binding configured on the reference - CPPServiceProxy* serviceProxy = (CPPServiceProxy*)reference->getBinding()->getServiceProxy(); - if (serviceProxy == NULL) - { - string message = "Reference "; - message = message + referenceName + " not wired"; - throw ServiceNotFoundException(message.c_str()); - } - - void* service = serviceProxy->getProxy(); - return service; - - } // End getService() - - // ============================================== - // getProperties: return the component properties - // ============================================== - DataObjectPtr ComponentContextImpl::getProperties() - { - LOGENTRY(1, "ComponentContextImpl::getProperties"); - DataObjectPtr properties = component->getProperties(); - - LOGEXIT(1, "ComponentContextImpl::getProperties"); - return properties; - } - - // ============================================== - // getDataFactory: return the data factory for the composite in which - // this component resides - // ============================================== - commonj::sdo::DataFactoryPtr ComponentContextImpl::getDataFactory() - { - LOGENTRY(1, "ComponentContextImpl::getProperties"); - commonj::sdo::DataFactoryPtr dataFactory = component->getComposite()->getDataFactory(); - - LOGEXIT(1, "ComponentContextImpl::getDataFactory"); - return dataFactory; - } - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/ComponentContextImpl.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/ComponentContextImpl.h deleted file mode 100644 index 6d9b76feeb..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/ComponentContextImpl.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * 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_cpp_componentcontextimpl_h -#define tuscany_sca_cpp_componentcontextimpl_h - -#include -using std::vector; - -#include "osoa/sca/ComponentContext.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Service.h" -#include "tuscany/sca/model/Reference.h" -#include "tuscany/sca/core/ServiceWrapper.h" -#include "tuscany/sca/cpp/CPPServiceProxy.h" - -using namespace osoa::sca; - - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - - /** - * Contains the actual implementation of a ComponentContext interface. - */ - class ComponentContextImpl : public ComponentContext - { - - public: - /** - * Constructor that takes a Component which represents the runtime - * model for this context. - */ - ComponentContextImpl(Component* component); - - /** - * Default constructor. - */ - virtual ~ComponentContextImpl(); - - /** - * See ComponentContext. - */ - virtual void* getService(const std::string& referenceName); - - /** - * See ComponentContext. - */ - virtual std::list getServices(const std::string& referenceName); - - /** - * See ComponentContext. - */ - virtual DataObjectPtr getProperties(); - - /** - * See ComponentContext. - */ - virtual commonj::sdo::DataFactoryPtr getDataFactory(); - - /** - * Returns the contained Component. - * @return The Component to which this context refers. - */ - virtual Component* getComponent() {return component;} - - private: - ComponentContextImpl(const ComponentContextImpl&); - ComponentContextImpl& operator=(const ComponentContextImpl&); - - /** - * Pointer to the runtime model Component to which this - * context refers. - */ - Component* component; - - /** - * Helper method to return a proxy to a service. - * @param serviceReference The source reference. - * @param target The target to which this source reference is wired. - * @return A pointer to an object which can be cast to the business - * class representing the target. - */ - void* getServiceProxy( - Reference* serviceReference, - Service* target); - - /** - * Helper method to return a wrapper for a target service. - * @param target The target for which this wrapper is to be created. - * @return The service wrapper. - */ - ServiceWrapper* getServiceWrapper(Service* target); - - }; - - } // End namespaca cpp - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_cpp_componentcontextimpl_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CompositeContextImpl.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CompositeContextImpl.cpp deleted file mode 100644 index 009e0ed765..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CompositeContextImpl.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/* - * 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 "osoa/sca/ServiceRuntimeException.h" -#include "tuscany/sca/cpp/CompositeContextImpl.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/Service.h" -#include "tuscany/sca/model/ServiceBinding.h" -#include "tuscany/sca/model/ServiceType.h" -#include "tuscany/sca/core/ServiceProxy.h" -#include "tuscany/sca/core/ServiceWrapper.h" -#include "tuscany/sca/cpp/CPPServiceProxy.h" -#include "commonj/sdo/SDO.h" - -using namespace tuscany::sca::model; -using namespace osoa::sca; -using namespace commonj::sdo; - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - - // =========== - // Constructor - // =========== - CompositeContextImpl::CompositeContextImpl(Component* component) - : CompositeContext(0), component(component), composite((Composite*)component->getType()) - { - } - - // ========== - // Destructor - // ========== - CompositeContextImpl::~CompositeContextImpl() - { - } - - // =========================================================================== - // locateService: return a proxy connected to a wrapper for the target service - // =========================================================================== - void* CompositeContextImpl::locateService(const std::string& serviceName) - { - LOGENTRY(1, "CompositeContextImpl::locateService"); - - // ---------------------------- - // Locate the component service - // ---------------------------- - Service* service = composite->findComponentService(serviceName); - string msg; - if (!service) - { - msg = "Service not found: "; - msg = msg + serviceName; - throw ServiceNotFoundException(msg.c_str()); - } - - // ---------------------------- - // Get a Proxy for this service - // ---------------------------- - - // The locate service API is used from CPP clients so we are using - // our default service proxy here - CPPServiceProxy* serviceProxy = new CPPServiceProxy(service); - LOGEXIT(1, "CompositeContextImpl::locateService"); - return serviceProxy->getProxy(); - - } - - // ============================================== - // getDataFactory: return the data factory for the current composite - // ============================================== - DataFactoryPtr CompositeContextImpl::getDataFactory() - { - LOGENTRY(1, "CompositeContextImpl::getDataFactory"); - DataFactoryPtr dataFactory = composite->getDataFactory(); - - LOGEXIT(1, "CompositeContextImpl::getDataFactory"); - return dataFactory; - } - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CompositeContextImpl.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CompositeContextImpl.h deleted file mode 100644 index c11af16848..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CompositeContextImpl.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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_cpp_compositecontextimpl_h -#define tuscany_sca_cpp_compositecontextimpl_h - -#include -using std::vector; - -#include "osoa/sca/CompositeContext.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/cpp/CPPServiceProxy.h" - -using namespace osoa::sca; - -namespace tuscany -{ - namespace sca - { - - namespace cpp - { - - /** - * Contains the actual implementation of a CompositeContext interface. - */ - class CompositeContextImpl : public CompositeContext - { - - public: - /** - * Constructor that takes a Composite which represents the runtime - * model for this context. - */ - CompositeContextImpl(Component* component); - - /** - * See CompositeContext#locateService. - */ - virtual void* locateService(const std::string& serviceName); - - /** - * See CompositeContext. - */ - virtual commonj::sdo::DataFactoryPtr getDataFactory(); - - /** - * Destructor. - */ - virtual ~CompositeContextImpl(); - - private: - CompositeContextImpl(const CompositeContextImpl&); - CompositeContextImpl& operator=(const CompositeContextImpl&); - - /** - * Pointer to the runtime model Composite object to which this - * context refers. - */ - Composite* composite; - - /** - * Pointer to the runtime model Component object to which this - * context refers. - */ - Component* component; - - }; - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_cpp_compositecontextimpl_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.cpp deleted file mode 100644 index 4fb7c7cfd5..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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/cpp/model/CPPImplementation.h" -#include "tuscany/sca/cpp/model/CPPServiceBinding.h" -#include "tuscany/sca/cpp/model/CPPReferenceBinding.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/Service.h" -#include "tuscany/sca/model/Reference.h" -#include "tuscany/sca/util/Utils.h" - -namespace tuscany -{ - namespace sca - { - - namespace cpp - { - - // Constructor - CPPImplementation::CPPImplementation(Composite* composite, const string& library, const string& header, - const string&headerPath, const string& headerStub, const string& className, Scope scope) - : ComponentType(composite, headerPath + headerStub), - library(library), header(header), headerPath(headerPath), - headerStub(headerStub), className(className), scope(scope) - { - } - - CPPImplementation::~CPPImplementation() - { - } - - void CPPImplementation::initializeComponent(Component* component) - { - ComponentType::initializeComponent(component); - - // Create CPP bindings for all the services - const Component::SERVICE_MAP& services = component->getServices(); - Component::SERVICE_MAP::const_iterator iter = services.begin(); - for (int i=0; i< services.size(); i++) - { - Service *service = iter->second; - CPPServiceBinding* binding = new CPPServiceBinding(service); - service->setBinding(binding); - iter++; - } - - // Create CPP bindings for all the references - const Component::REFERENCE_MAP& references = component->getReferences(); - Component::REFERENCE_MAP::const_iterator refiter = references.begin(); - for (int ri=0; ri< references.size(); ri++) - { - Reference *reference = refiter->second; - CPPReferenceBinding* binding = new CPPReferenceBinding(reference); - reference->setBinding(binding); - refiter++; - } - } - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.h deleted file mode 100644 index 20636df884..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.h +++ /dev/null @@ -1,150 +0,0 @@ -/* - * 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_cpp_model_cppimplementation_h -#define tuscany_sca_cpp_model_cppimplementation_h -#include "tuscany/sca/model/ComponentType.h" - -#include -using std::map; -#include -using std::string; - -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - /** - * Holds information about an SCA implementation written in C++ - */ - class CPPImplementation : public ComponentType - { - - public: - /** - * Scope of the component implementation. - */ - enum Scope - { - COMPOSITE, - STATELESS - }; - - /** - * Constructor. - * @param dllName Name of the shared library. - * @param header Name of the header file that contains the class declaring the - * implementation class. - * @param className Name of the class in the header file (could be a blank string - * if this is not specified). - */ - CPPImplementation(Composite* composite, const string& library, const string& header, const string&headerPath, - const string& headerStub, const string& className, Scope scope); - - /** - * Destructor - */ - virtual ~CPPImplementation(); - - /** - * Initialize a component of this type. - * @param component The component to initialize. - */ - virtual void initializeComponent(Component* component); - - /** - * Returns the name of the shared library. - * @return The name of the shared library. - */ - const string& getLibrary() const { return library; } - - /** - * Get the name of the header file. - * @return Name of the header file. - */ - const string& getHeader() const { return header; } - - /** - * Get the header file name without the extension. - * @return The name of the header file without any extension. - */ - const string& getHeaderStub() const { return headerStub; } - - /** - * Get the header path. - * @return The pathe element of the header. - */ - const string& getHeaderPath() const { return headerPath; } - - /** - * Get the name of the class. - * @return The class name if specified. - */ - const string& getClass() const { return className; } - - /** - * Returns the implementation scope - */ - Scope getScope() { return scope; } - - private: - - /** - * Name of the shared library. - */ - string library; - - /** - * Name of the header file describing the interface. - */ - string header; - - /** - * Name of the header file without the extension. - */ - string headerStub; - - /** - * Path element of the header. - */ - string headerPath; - - /** - * 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; - - /** - * Scope of the implementation - */ - Scope scope; - }; - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_cpp_model_cppimplementation_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.cpp deleted file mode 100644 index a728880e32..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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/util/Utils.h" -#include "tuscany/sca/cpp/model/CPPInterface.h" - - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - - const string CPPInterface::typeQName("http://www.osoa.org/xmlns/sca/1.0#CPPInterface"); - - // Constructor - CPPInterface::CPPInterface( - const string& header, - const string& className, - bool remotable, - bool conversational) - : Interface(remotable, conversational), header(header), className(className) - { - string::size_type dot = header.rfind(".h"); // this will also find .hpp - if (dot != string::npos) - { - headerStub = header.substr(0, dot); - } - else - { - headerStub = header; - } - - } - - CPPInterface::~CPPInterface() - { - } - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.h deleted file mode 100644 index d50d2f9485..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * 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_cpp_model_cppinterface_h -#define tuscany_sca_cpp_model_cppinterface_h - -#include "tuscany/sca/model/Interface.h" - -#include -using std::map; -#include -using std::string; - -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - /** - * 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 composite). - * @param remotable True if the interface is remotable. - */ - CPPInterface( - const string& header, - const string& className, - bool remotable, - bool conversational); - - /** - * Destructor. - */ - virtual ~CPPInterface(); - - /** - * 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; } - - /** - * return the QName of the schema type for this interface type - * (e.g. "http://www.osoa.org/xmlns/sca/1.0#interface.cpp") - */ - virtual const string& getInterfaceTypeQName() { return typeQName; }; - - 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; - - /** - * The QName of the schema type for this interface type. - */ - static const string typeQName; - }; - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_cpp_model_cppinterface_h - diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPReferenceBinding.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPReferenceBinding.cpp deleted file mode 100644 index 3c87560445..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPReferenceBinding.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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/cpp/model/CPPReferenceBinding.h" -#include "tuscany/sca/cpp/CPPServiceProxy.h" - - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - - // Constructor - CPPReferenceBinding::CPPReferenceBinding(Reference* reference) - : ReferenceBinding(reference, ""), serviceProxy(NULL), targetServiceBinding(NULL) - { - } - - // Destructor - CPPReferenceBinding::~CPPReferenceBinding() - { - } - - ServiceProxy* CPPReferenceBinding::getServiceProxy() - { - return serviceProxy; - } - - void CPPReferenceBinding::configure(ServiceBinding* binding) - { - targetServiceBinding = binding; - - serviceProxy = new CPPServiceProxy(getReference()); - } - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPReferenceBinding.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPReferenceBinding.h deleted file mode 100644 index 81ba88940d..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPReferenceBinding.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - * 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_cpp_model_cppreferencebinding_h -#define tuscany_sca_cpp_model_cppreferencebinding_h - -#include "tuscany/sca/model/ReferenceBinding.h" - - -#include -using std::string; - -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - /** - * Information about a CPP service binding for service or a reference. - */ - class CPPReferenceBinding : public ReferenceBinding - { - public: - - /** - * Constructor. - * @param uri The uri of the binding. - * @param port The definition of the port to which the entrypoint - * or external service is to be bound. This is of the form - * "namespace"#endpoint("service"/"port") - */ - CPPReferenceBinding(Reference* reference); - - /** - * Destructor. - */ - virtual ~CPPReferenceBinding(); - - /** - * Returns the type of binding. - */ - virtual string getType() { return "http://www.osoa.org/xmlns/sca/1.0#CPPImplementationBinding"; }; - - /** - * Create a proxy representing the reference to the - * client component. - */ - virtual ServiceProxy* getServiceProxy(); - - /** - * Configure this binding from a service binding. - */ - virtual void configure(ServiceBinding* serviceBinding); - - /** - * Returns the target service binding. - */ - ServiceBinding* getTargetServiceBinding() const { return targetServiceBinding; }; - - private: - - /** - * The proxy representing the reference to the client - * component. - */ - ServiceProxy* serviceProxy; - - /** - * The service binding of the target - */ - ServiceBinding* targetServiceBinding; - }; - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_cpp_model_cppreferencebinding_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPServiceBinding.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPServiceBinding.cpp deleted file mode 100644 index 641d9452f8..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPServiceBinding.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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/cpp/model/CPPServiceBinding.h" -#include "tuscany/sca/cpp/CPPServiceWrapper.h" - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - - // Constructor - CPPServiceBinding::CPPServiceBinding(Service* service) - : ServiceBinding(service, "") - { - serviceWrapper = CPPServiceWrapper::getServiceWrapper(service); - } - - // Destructor - CPPServiceBinding::~CPPServiceBinding() - { - } - - ServiceWrapper* CPPServiceBinding::getServiceWrapper() - { - return (ServiceWrapper*)serviceWrapper; - } - - } // End namespace ws - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPServiceBinding.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPServiceBinding.h deleted file mode 100644 index f7db3065b3..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPServiceBinding.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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_cpp_model_cppservicebinding_h -#define tuscany_sca_cpp_model_cppservicebinding_h - -#include "tuscany/sca/model/ServiceBinding.h" -using namespace tuscany::sca::model; -#include -using std::string; - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - /** - * Information about a CPP service binding for service or a reference. - */ - class CPPServiceBinding : public ServiceBinding - { - public: - - /** - * Constructor. - * @param uri The uri of the binding. - * @param port The definition of the port to which the entrypoint - * or external service is to be bound. This is of the form - * "namespace"#endpoint("service"/"port") - */ - CPPServiceBinding(Service* service); - - /** - * Destructor. - */ - virtual ~CPPServiceBinding(); - - /** - * Returns the type of binding. - */ - virtual string getType() { return "http://www.osoa.org/xmlns/sca/1.0#CPPImplementationBinding"; }; - - /** - * Create a wrapper for the service configured by this - * binding. - */ - virtual ServiceWrapper* getServiceWrapper(); - - private: - - /** - * The wrapper for the service configured by this binding. - */ - ServiceWrapper* serviceWrapper; - - }; - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_cpp_model_cppservicebinding_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/xsd/sca-implementation-cpp.xsd b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/xsd/sca-implementation-cpp.xsd deleted file mode 100644 index 7292f747b8..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/xsd/sca-implementation-cpp.xsd +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/xsd/sca-interface-cpp.xsd b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/xsd/sca-interface-cpp.xsd deleted file mode 100644 index 585bac0dc4..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/cpp/xsd/sca-interface-cpp.xsd +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/Makefile.am b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/Makefile.am deleted file mode 100644 index b8c2a91db2..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/Makefile.am +++ /dev/null @@ -1,24 +0,0 @@ -# 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. - -SUBDIRS = src - -datadir=$(prefix)/extensions/php - -nobase_data_DATA = xsd/*.xsd - -EXTRA_DIST = xsd \ No newline at end of file diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/Makefile.am b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/Makefile.am deleted file mode 100644 index a8c2762484..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -# 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/php/lib -lib_LTLIBRARIES = libtuscany_sca_php.la - -noinst_HEADERS = \ -tuscany/sca/php/*.h \ -tuscany/sca/php/model/*.h - -libtuscany_sca_php_la_SOURCES = \ -tuscany/sca/php/PHPExtension.cpp \ -tuscany/sca/php/PHPImplementationExtension.cpp \ -tuscany/sca/php/PHPServiceWrapper.cpp \ -tuscany/sca/php/model/PHPImplementation.cpp \ -tuscany/sca/php/model/PHPServiceBinding.cpp - -libtuscany_sca_php_la_LIBADD = -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo \ - -L$(top_builddir)/runtime/core/src -ltuscany_sca \ - -L${PHP_LIB} -lphp5 - -INCLUDES = -Imodel -I$(top_builddir)/runtime/core/src \ - -I${TUSCANY_SDOCPP}/include \ - -I${PHP_INCLUDE} \ - -I${PHP_INCLUDE}/main \ - -I${PHP_INCLUDE}/Zend \ - -I${PHP_INCLUDE}/TSRM \ - -I${PHP_INCLUDE}/sapi/embed - -AM_CPPFLAGS = $(CPPFLAGS) -D_DEBUG - \ No newline at end of file diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/osoa/sca/ServiceRuntimeException.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/osoa/sca/ServiceRuntimeException.h deleted file mode 100644 index d31679b994..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/osoa/sca/ServiceRuntimeException.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - * 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 osoa_sca_serviceruntimeexception_h -#define osoa_sca_serviceruntimeexception_h - -#include "osoa/sca/export.h" - -#include "tuscany/sca/util/Exceptions.h" -using tuscany::sca::TuscanyRuntimeException; -namespace osoa -{ - namespace sca - { - /** - * Top level exception to represent all the exceptions that may be - * thrown by an SCA runtime implementation. - */ - class SCA_PHP_API ServiceRuntimeException : public TuscanyRuntimeException - { - public: - ServiceRuntimeException( - const char *name="ServiceRuntimeException", - severity_level sev=Severe, - const char* msg_text="") - : TuscanyRuntimeException(name, sev, msg_text) - { - } - }; // End ServiceRuntimeException class definition - - - /** - * A remotable service is currently unavailable. It is possible that a retry - * may resolve this exception. - */ - class SCA_PHP_API ServiceUnavailableException: public ServiceRuntimeException - { - public: - ServiceUnavailableException(const char* serviceName) - : ServiceRuntimeException("ServiceUnavailableException", Warning, - serviceName) - { - } - private: - }; // End ServiceUnavailableException class definition - - - /** - * The target of a wire cannot be found, or the reference has not been - * configured. - */ - class SCA_PHP_API ServiceNotFoundException: public ServiceRuntimeException - { - public: - ServiceNotFoundException(const char* msg) - : ServiceRuntimeException("ServiceNotFoundException", Error, - msg) - { - } - private: - }; // End ServiceNotFoundException class definition - - - /** - * There is no current component (for example, if a non-SCA component - * tries to get the current ComponentContext). - */ - class SCA_PHP_API ComponentContextException: public ServiceRuntimeException - { - public: - ComponentContextException(const char* msg) - : ServiceRuntimeException("ComponentContextException", Error, - msg) - { - } - private: - }; // End ComponentContextException class definition - - /** - * There is an error whilst trying to invoke a component. - */ - class SCA_PHP_API ComponentInvocationException: public ServiceRuntimeException - { - public: - ComponentInvocationException(const char* msg) - : ServiceRuntimeException("ComponentInvocationException", Error, - msg) - { - } - private: - }; // End ComponentInvocationException class definition - - - } // End namespace sca -} // End namespace osoa - -#endif // osoa_sca_serviceruntimeexception_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/osoa/sca/export.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/osoa/sca/export.h deleted file mode 100644 index 99794a3352..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/osoa/sca/export.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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 osoa_sca_export_h -#define osoa_sca_export_h -#include "tuscany/sca/export.h" - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) - -#ifdef TUSCANY_SCA_PHP_EXPORTS -#define SCA_PHP_API __declspec(dllexport) -#else -#define SCA_PHP_API __declspec(dllimport) -#endif - -#else -#include -#include -#include -#define SCA_PHP_API -#endif - -#endif // osoa_sca_export_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/PHPExtension.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/PHPExtension.cpp deleted file mode 100644 index f8768738e9..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/PHPExtension.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/* - * 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/php/PHPExtension.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/core/SCARuntime.h" -#include "tuscany/sca/php/PHPImplementationExtension.h" - - -extern "C" -{ - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - void tuscany_sca_extension_initialize() - { - tuscany::sca::php::PHPExtension::initialize(); - } -} - -namespace tuscany -{ - namespace sca - { - namespace php - { - // =================================================================== - // Constructor for the PHPExtension class. - // =================================================================== - PHPExtension::PHPExtension() - { - LOGENTRY(1, "PHPExtension::constructor"); - LOGEXIT(1, "PHPExtension::constructor"); - } - - // =================================================================== - // Destructor for the PHPExtension class. - // =================================================================== - PHPExtension::~PHPExtension() - { - LOGENTRY(1, "PHPExtension::destructor");; - LOGEXIT(1, "PHPExtension::destructor"); - } - - void PHPExtension::initialize() - { - LOGENTRY(1, "PHPExtension::initialize");; - SCARuntime::getInstance()->registerImplementationExtension(new PHPImplementationExtension()); - //SCARuntime::getInstance()->registerInterfaceExtension(new PHPInterfaceExtension()); - LOGEXIT(1, "PHPExtension::initialize");; - } - - } // End namespace php - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/PHPExtension.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/PHPExtension.h deleted file mode 100644 index 971ed93c86..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/PHPExtension.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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_php_phpextension_h -#define tuscany_sca_php_phpextension_h - -namespace tuscany -{ - namespace sca - { - namespace php - { - - class PHPExtension - { - public: - /** - * Default constructor - */ - PHPExtension(); - - /** - * Destructor - */ - virtual ~PHPExtension(); - - static void initialize(); - - private: - - }; - - - } // End namespace php - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_php_phpextension_h - diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/PHPImplementationExtension.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/PHPImplementationExtension.cpp deleted file mode 100644 index 7f204b0ce9..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/PHPImplementationExtension.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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/php/PHPImplementationExtension.h" -#include "tuscany/sca/php/model/PHPImplementation.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/util/Utils.h" - - -namespace tuscany -{ - namespace sca - { - namespace php - { - // =================================================================== - // Constructor for the PHPImplementationExtension class. - // =================================================================== - PHPImplementationExtension::PHPImplementationExtension() - { - LOGENTRY(1, "PHPImplementationExtension::constructor"); - LOGEXIT(1, "PHPImplementationExtension::constructor"); - } - - // =================================================================== - // Destructor for the PHPImplementationExtension class. - // =================================================================== - PHPImplementationExtension::~PHPImplementationExtension() - { - LOGENTRY(1, "PHPImplementationExtension::destructor");; - LOGEXIT(1, "PHPImplementationExtension::destructor"); - } - - const string PHPImplementationExtension::extensionName("php"); - const string PHPImplementationExtension::typeQName("http://www.osoa.org/xmlns/sca/1.0#PHPImplementation"); - - // =================================================================== - // loadModelElement - load the info from implementation.php - // =================================================================== - ComponentType* PHPImplementationExtension::getImplementation(Composite *composite, DataObjectPtr scdlImplementation) - { - string implType = scdlImplementation->getType().getName(); - if (implType == "PHPImplementation") - { - string module = scdlImplementation->getCString("module"); - string className = scdlImplementation->getCString("class"); - - PHPImplementation* phpImpl = new PHPImplementation(composite, module, className); - - return phpImpl; - } - else - { - return NULL; - } - } - - } // End namespace php - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/PHPImplementationExtension.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/PHPImplementationExtension.h deleted file mode 100644 index 9aa4aea969..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/PHPImplementationExtension.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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_php_phpimplementationextension_h -#define tuscany_sca_php_phpimplementationextension_h - -#include "tuscany/sca/extension/ImplementationExtension.h" - -namespace tuscany -{ - namespace sca - { - namespace php - { - - class PHPImplementationExtension : public ImplementationExtension - { - public: - /** - * Default constructor - */ - PHPImplementationExtension(); - - /** - * Destructor - */ - virtual ~PHPImplementationExtension(); - - /** - * return the name of the extension - */ - virtual const string& getExtensionName() {return extensionName;} - - /** - * return the QName of schema element for this implementation extension - * (e.g. "http://www.osoa.org/xmlns/sca/1.0#implementation.phpn") - */ - virtual const string& getExtensionTypeQName() {return typeQName;} - - virtual ComponentType* getImplementation(Composite* composite, DataObjectPtr scdlImplementation); - - private: - static const string extensionName; - static const string typeQName; - - }; - - - } // End namespace php - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_php_phpimplementationextension_h - diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.cpp deleted file mode 100644 index 1b11e660c6..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.cpp +++ /dev/null @@ -1,405 +0,0 @@ -/* - * 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$ */ - - -// some strangeness in the build that causes -// WinSock.h and WinSock2.h to be included leading to redefinitions -#define _WINSOCKAPI_ - -#include "tuscany/sca/php/PHPServiceWrapper.h" - -#include "osoa/sca/ServiceRuntimeException.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/ServiceType.h" -#include "tuscany/sca/model/Interface.h" -#include "tuscany/sca/core/SCARuntime.h" -#include "tuscany/sca/php/model/PHPImplementation.h" - -#include - -using namespace osoa::sca; - -namespace tuscany -{ - namespace sca - { - namespace php - { - // a global!! place to put the response - // as I can't get the PHP return value - // processing to work. Need to be - // removed when the proper PHP SAPI is used - // The variable is only valid between the PHP engine call and - // the results processing. It stores the last thing that - // the script echoed - string scriptResponse; - - // Global callbacks used by the PHP engine - - // Callback for log messages - void php_log_message(char *message) - { - LOGINFO_1(5, "PHP Log (%s)", message); - } - - // Callback for unbuffered writes (echo, print etc.) - int php_ub_write(const char *str, unsigned int str_length TSRMLS_DC) - { - LOGINFO_1(5, "PHP Write (%s)", str); - scriptResponse = str; - return str_length; - } - - // Callback for errors - void php_error_cb(int type, - const char *error_filename, - const uint error_lineno, - const char *format, va_list args) - { - char buffer[2048]; - int len; - - len = snprintf(buffer, 2048, "Error on line %d: ", error_lineno); - vsnprintf(buffer + len, (2048 - len), format, args); - LOGINFO_1(5, "PHP Unformatted Error (%s)", buffer); - zend_bailout(); - } - - // Callback for flush (could be used to do something with the scriptResponse) - void php_flush(void *server_context) - { - LOGINFO(5, "Flush"); - } - - // =========== - // Constructor - // =========== - PHPServiceWrapper::PHPServiceWrapper(Service* service) - : ServiceWrapper(service) - { - LOGENTRY(1,"PHPServiceWrapper::constructor"); - - component = service->getComponent(); - interf = service->getType()->getInterface(); - remotable = interf->isRemotable(); - - // ----------------------------------------------- - // Get the implementation for the target component - // ----------------------------------------------- - PHPImplementation* impl = (PHPImplementation*)component->getType(); - if (!impl) - { - string msg = "Component " + component->getName() + " has no implementation defined"; - throw ServiceNotFoundException(msg.c_str()); - } - - LOGINFO_1(3,"PHPServiceWrapper::getServiceWrapper module %s", impl->getModule().c_str()); - LOGINFO_1(3,"PHPServiceWrapper::getServiceWrapper class %s", impl->getClass().c_str()); - - LOGEXIT(1,"PHPServiceWrapper::constructor"); - - } - - // ========== - // Destructor - // ========== - PHPServiceWrapper::~PHPServiceWrapper() - { - LOGENTRY(1,"PHPServiceWrapper::destructor"); - LOGEXIT(1,"PHPServiceWrapper::destructor"); - } - - - // ====================================================================== - // invoke: wrapper call to service with setting the component context - // ====================================================================== - void PHPServiceWrapper::invoke(Operation& operation) - { - LOGENTRY(1,"PHPServiceWrapper::invoke"); - - SCARuntime* runtime = SCARuntime::getInstance(); - runtime->setCurrentComponent(component); - - try - { - LOGINFO_1(4, "PHPServiceWrapper::invoke called with operation name: %s", operation.getName().c_str()); - - // create a temporary script which - // - includes the named script - // - creates a class instance if required - // - calls the named method with the provided arguments - - // get the component type information - PHPImplementation* impl = (PHPImplementation*)component->getType(); - - // first create the temporay script and include the module - string script = "include '" + impl->getModule() + ".php';"; - - // if we have a class create an instance - string className = impl->getClass(); - if( &className != NULL && className.size() > 0) - { - script += "$anobject = new " + className + "();"; - } - - // construct the call to the function - script += "$response = "; - - if( &className != NULL && className.size() > 0) - { - script += " $anobject->"; - } - - script += operation.getName().c_str(); - script += "("; - - char tempString [32]; - - // add the parameters to the call - for(unsigned int i = 0; i < operation.getNParms(); i++) - { - const Operation::Parameter& parm = operation.getParameter(i); - switch(parm.getType()) - { - case Operation::BOOL: - { - if( *(bool*)parm.getValue()) - { - //boolean true - script += "true"; - } - else - { - script += "false"; - } - break; - } - case Operation::SHORT: - { - sprintf ( tempString, "%d", *(short*)parm.getValue() ); - script += tempString; - break; - } - case Operation::USHORT: - { - sprintf ( tempString, "%d", *(unsigned short*)parm.getValue() ); - script += tempString; - break; - } - case Operation::LONG: - { - sprintf ( tempString, "%d", *(long*)parm.getValue() ); - script += tempString; - break; - } - case Operation::ULONG: - { - sprintf ( tempString, "%d", *(unsigned long*)parm.getValue() ); - script += tempString; - break; - } - case Operation::FLOAT: - { - sprintf ( tempString, "%g", *(float*)parm.getValue() ); - script += tempString; - break; - } - case Operation::DOUBLE: - { - sprintf ( tempString, "%g", *(double*)parm.getValue() ); - script += tempString; - break; - } - case Operation::LONGDOUBLE: - { - sprintf ( tempString, "%g", *(long double*)parm.getValue() ); - script += tempString; - break; - } - case Operation::CHARS: - { - script += *(char**)parm.getValue(); - break; - } - case Operation::STRING: - { - script += (*(string*)parm.getValue()).c_str(); - break; - } - default: - { - throw new ComponentInvocationException("Operation parameter type not supported"); - } - } - - if ( ( i + 1 ) < operation.getNParms() ) - { - script += ", "; - } - } - - - // the closing bracket of the call - script += ");echo $response;return $response;"; - - // we now have the temporary script to make the call - LOGINFO_1(5, "Executing PHP script \n%s", script.c_str()); - - // load the PHP logging and error callback methods - php_embed_module.log_message = php_log_message; - php_embed_module.ub_write = php_ub_write; - php_embed_module.flush = php_flush; - - //PHP_EMBED_START_BLOCK(/* argc */ 0, /* argv */ NULL) - void ***tsrm_ls; - int status = php_embed_init(0, NULL PTSRMLS_CC); - LOGINFO_1(5, "Engine startup status %d", status); - - zend_first_try { - // set error handler - zend_error_cb = php_error_cb; - - // call the dynamically created script - //zval retval; - zend_eval_string((char *) script.c_str(), - NULL,//&retval, - "PHP Component" TSRMLS_CC); - - // get the response - // This doesn't want to work for some reason - // so have chaced the last echo that the script - // returns in the global scriptResponse variable - // This is a bit of a rubbish way of doing things so - // needs replacing when proper SAPI is used - //convert_to_string(&retval); - //LOGINFO_1(5, "Script returned %s", Z_STRVAL(retval)); - //zval_dtor(&retval); - - //PHP_EMBED_END_BLOCK() - } zend_catch { - int exit_status = EG(exit_status); - LOGINFO_1(5, "In catch %d", exit_status); - } zend_end_try(); - - //clean up - php_embed_shutdown(TSRMLS_C); - LOGINFO(5, "Engine shutdown"); - - // get the response values - LOGINFO_1(5, "Script returned %s", scriptResponse.c_str()); - - switch(operation.getReturnType()) - { - case Operation::BOOL: - { - if(scriptResponse == "true") - { - *(bool*)operation.getReturnValue() = true; - } - break; - } - case Operation::SHORT: - { - *(short*)operation.getReturnValue() = (short) strtol(scriptResponse.c_str(), NULL,10); - break; - } - case Operation::LONG: - { - *(long*)operation.getReturnValue() = (long) strtol(scriptResponse.c_str(), NULL,10); - break; - } - case Operation::USHORT: - { - *(unsigned short*)operation.getReturnValue() = (unsigned short) strtoul(scriptResponse.c_str(), NULL,10); - break; - } - case Operation::ULONG: - { - *(unsigned long*)operation.getReturnValue() = (unsigned long) strtoul(scriptResponse.c_str(), NULL,10); - break; - } - case Operation::FLOAT: - { - *(float*)operation.getReturnValue() = (float) strtod(scriptResponse.c_str(), NULL); - break; - } - case Operation::DOUBLE: - { - *(double*)operation.getReturnValue() = (double) strtod(scriptResponse.c_str(), NULL); - break; - } - case Operation::LONGDOUBLE: - { - *(long double*)operation.getReturnValue() = (long double) strtod(scriptResponse.c_str(), NULL); - break; - } - case Operation::CHARS: - { - *(char**)operation.getReturnValue() = (char *)scriptResponse.c_str(); - break; - } - case Operation::STRING: - { - *(string*)operation.getReturnValue() = scriptResponse; - break; - } - default:; - } - } - catch (...) - { - runtime->unsetCurrentComponent(); - throw; - } - runtime->unsetCurrentComponent(); - LOGEXIT(1,"PHPServiceWrapper::invoke"); - - } - - // ====================================================================== - // getServiceWrapper: create a wrapper for the target ComponentService - // ====================================================================== - PHPServiceWrapper* PHPServiceWrapper::getServiceWrapper(Service* service) - { - LOGENTRY(1,"PHPServiceWrapper::getServiceWrapper"); - PHPServiceWrapper* serviceWrapper = 0; - - // --------------------------------- - // Create an instance of the wrapper - // --------------------------------- - serviceWrapper = new PHPServiceWrapper(service); - if (!serviceWrapper) - { - string msg = "Could not create new PHPServiceWrapper"; - LOGERROR(1, msg.c_str()); - throw ServiceNotFoundException(msg.c_str()); - } - - LOGEXIT(1,"PHPServiceWrapper::getServiceWrapper"); - return serviceWrapper; - } - - } // End namespace php - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.h deleted file mode 100644 index ef83a026a6..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * 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_php_phpservicewrapper_h -#define tuscany_sca_php_phpservicewrapper_h - - -#include "osoa/sca/export.h" -#include "tuscany/sca/core/ServiceWrapper.h" -#include "tuscany/sca/core/Operation.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Interface.h" - -using namespace tuscany::sca::model; - - -namespace tuscany -{ - namespace sca - { - namespace php - { - class PHPInterface; - - /** - * Wraps the service on a component implementation. - * This abstract class is extended by generated code which provides - * the implementation of some of the methods. - * An instance of this class wraps the actual component implementation which - * has been written by a developer of an SCA application. - */ - class SCA_PHP_API PHPServiceWrapper : public ServiceWrapper - { - public: - /** - * Factory method to create a new PHPServiceWrapper for a given target - * service. This method will provide all the loading of dlls required to - * create the target component. - * @param target The service on the component for which this wrapper is to be - * created. - * @return A wrapper that references the given target. - */ - static PHPServiceWrapper* getServiceWrapper(Service* service); - - /** - * Constructor. - * @param target The component service to which this wrapper refers. - */ - PHPServiceWrapper(Service* service); - - /** - * Destructor. - */ - virtual ~PHPServiceWrapper(); - - /** - * All business method calls to the target component go through the invoke method. - * @param operation The details of the method, paramaters and return value for the - * business method to be called on the target component. - */ - virtual void invoke(Operation& operation); - - - protected: - - - private: - - - /** - * The component to which this wrapper refers. - */ - Component* component; - - /** - * Set to true if the service is remotable. - */ - bool remotable; - - /** - * A pointer to the interface which the service exposes. - */ - Interface* interf; - - }; - - } // End namespace php - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_php_phpservicewrapper_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/model/PHPImplementation.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/model/PHPImplementation.cpp deleted file mode 100644 index f8992ed498..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/model/PHPImplementation.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/* - * 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/php/model/PHPImplementation.h" -#include "tuscany/sca/php/model/PHPServiceBinding.h" -//#include "tuscany/sca/php/model/PHPReferenceBinding.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Service.h" -#include "tuscany/sca/model/Reference.h" -#include "tuscany/sca/util/Utils.h" - -namespace tuscany -{ - namespace sca - { - - namespace php - { - - // Constructor - PHPImplementation::PHPImplementation(Composite* composite, const string& module, const string& className) - : ComponentType(composite, module), - module(module), className(className) - { - LOGENTRY(1,"PHPImplementation::constructor"); - LOGEXIT(1,"PHPImplementation::constructor"); - } - - PHPImplementation::~PHPImplementation() - { - LOGENTRY(1,"PHPImplementation::destructor"); - LOGEXIT(1,"PHPImplementation::destructor"); - } - - void PHPImplementation::initializeComponent(Component* component) - { - LOGENTRY(1,"PHPImplementation::initializeComponent"); - ComponentType::initializeComponent(component); - - // Create PHP bindings for all the services - const Component::SERVICE_MAP& services = component->getServices(); - Component::SERVICE_MAP::const_iterator iter = services.begin(); - for (unsigned int i=0; i< services.size(); i++) - { - Service *service = iter->second; - PHPServiceBinding* binding = new PHPServiceBinding(service); - service->setBinding(binding); - iter++; - } - - // References not yet supported.. - - //// Create PHP bindings for all the references - //const Component::REFERENCE_MAP& references = component->getReferences(); - //Component::REFERENCE_MAP::const_iterator refiter = references.begin(); - //for (int ri=0; ri< references.size(); ri++) - //{ - // Reference *reference = refiter->second; - // PHPReferenceBinding* binding = new PHPReferenceBinding(reference); - // reference->setBinding(binding); - // refiter++; - //} - LOGEXIT(1,"PHPImplementation::initializeComponent"); - } - - } // End namespace php - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/model/PHPImplementation.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/model/PHPImplementation.h deleted file mode 100644 index b89ba8c5c2..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/model/PHPImplementation.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * 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_php_model_phpimplementation_h -#define tuscany_sca_php_model_phpimplementation_h -#include "tuscany/sca/model/ComponentType.h" - -#include -using std::map; -#include -using std::string; - -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace php - { - /** - * Holds information about an SCA implementation written in PHP - */ - class PHPImplementation : public ComponentType - { - - public: - /** - * Constructor. - * @param composite Composite containing this implementation. - * @param module Name of the module. - * @param modulePath Path to the module (could be a blank string - * if this is not specified). - * @param className Name of the class in the module (could be a blank string - * if this is not specified). - */ - PHPImplementation(Composite* composite, const string& module, const string& className); - - /** - * Destructor - */ - virtual ~PHPImplementation(); - - /** - * Initialize a component of this type. - * @param component The component to initialize. - */ - virtual void initializeComponent(Component* component); - - /** - * Returns the name of the module. - * @return The name of the module. - */ - const string& getModule() const { return module; } - - /** - * Get the name of the class. - * @return The class name if specified. - */ - const string& getClass() const { return className; } - - private: - - /** - * Name of the module. - */ - string module; - - /** - * 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 php - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_php_model_phpimplementation_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/model/PHPServiceBinding.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/model/PHPServiceBinding.cpp deleted file mode 100644 index fa162ce8f2..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/model/PHPServiceBinding.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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/php/model/PHPServiceBinding.h" -#include "tuscany/sca/php/PHPServiceWrapper.h" - -namespace tuscany -{ - namespace sca - { - namespace php - { - - // Constructor - PHPServiceBinding::PHPServiceBinding(Service* service) - : ServiceBinding(service, "") - { - LOGENTRY(1,"PHPServiceBinding::constructor"); - serviceWrapper = PHPServiceWrapper::getServiceWrapper(service); - LOGEXIT(1,"PHPServiceBinding::constructor"); - } - - // Destructor - PHPServiceBinding::~PHPServiceBinding() - { - LOGENTRY(1,"PHPServiceBinding::destructor"); - LOGEXIT(1,"PHPServiceBinding::destructor"); - } - - ServiceWrapper* PHPServiceBinding::getServiceWrapper() - { - LOGENTRY(1,"PHPServiceBinding::getServiceWrapper"); - LOGEXIT(1,"PHPServiceBinding::getServiceWrapper"); - return (ServiceWrapper*)serviceWrapper; - } - - } // End namespace php - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/model/PHPServiceBinding.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/model/PHPServiceBinding.h deleted file mode 100644 index 6b1e694bd6..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/src/tuscany/sca/php/model/PHPServiceBinding.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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_php_model_phpservicebinding_h -#define tuscany_sca_php_model_phpservicebinding_h - -#include "tuscany/sca/model/ServiceBinding.h" -using namespace tuscany::sca::model; -#include -using std::string; - -namespace tuscany -{ - namespace sca - { - namespace php - { - /** - * Information about a PHP service binding for service or a reference. - */ - class PHPServiceBinding : public ServiceBinding - { - public: - - /** - * Constructor. - * @param uri The uri of the binding. - * @param port The definition of the port to which the entrypoint - * or external service is to be bound. This is of the form - * "namespace"#endpoint("service"/"port") - */ - PHPServiceBinding(Service* service); - - /** - * Destructor. - */ - virtual ~PHPServiceBinding(); - - /** - * Returns the type of binding. - */ - virtual string getType() { return "http://www.osoa.org/xmlns/sca/1.0#PHPImplementationBinding"; }; - - /** - * Create a wrapper for the service configured by this - * binding. - */ - virtual ServiceWrapper* getServiceWrapper(); - - private: - - /** - * The wrapper for the service configured by this binding. - */ - ServiceWrapper* serviceWrapper; - - }; - - } // End namespace php - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_php_model_phpservicebinding_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/xsd/sca-implementation-php.xsd b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/xsd/sca-implementation-php.xsd deleted file mode 100644 index 0f32f120e6..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/php/xsd/sca-implementation-php.xsd +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/Makefile.am b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/Makefile.am deleted file mode 100644 index 83e70b4b94..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/Makefile.am +++ /dev/null @@ -1,24 +0,0 @@ -# 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. - -SUBDIRS = src - -datadir=$(prefix)/extensions/python - -nobase_data_DATA = xsd/*.xsd - -EXTRA_DIST = xsd \ No newline at end of file diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/deploy.bat b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/deploy.bat deleted file mode 100644 index 94d4186eb5..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/deploy.bat +++ /dev/null @@ -1,77 +0,0 @@ -@echo off - -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. - - -setlocal - -if . == .%1 ( -echo sca root not specified -goto usage -) -set rootdir=%1 -set deploydir=%rootdir%\deploy -set extdir=%deploydir%\extensions -set pythonextdir=%extdir%\python -set srcdir=%rootdir%\runtime\extensions\python\src - -if . == .%2 ( -echo input directory not specified -goto usage -) -set inpath=%2 -echo %inpath% - - -if not exist %deploydir% mkdir %deploydir% -if not exist %extdir% mkdir %extdir% -if not exist %pythonextdir% mkdir %pythonextdir% -if not exist %pythonextdir%\bin mkdir %pythonextdir%\bin -if not exist %pythonextdir%\lib mkdir %pythonextdir%\lib -if not exist %pythonextdir%\xsd mkdir %pythonextdir%\xsd - -del %pythonextdir%\bin\tuscany_sca_python.* -del %pythonextdir%\lib\*.lib - -copy %srcdir%\deploy.cmd %pythonextdir% -copy %srcdir%\..\xsd\*.* %pythonextdir%\xsd - -copy %inpath%\tuscany_sca_python.lib %pythonextdir%\lib -copy %inpath%\tuscany_sca_python.dll %pythonextdir%\bin\tuscany_sca_python.dll.disabled - -if exist %inpath%\tuscany_sca_python.pdb copy %inpath%\tuscany_sca_python.pdb %pythonextdir%\bin - - -echo Building extension to Python -set origdir=%~d0%~p0 -set bindir=%pythonextdir%\bin -cd %srcdir%\tuscany\sca\python\ - -rem if %pythonextdir% is a relative path, it won't be found, so set %bindir% to a full path -if not exist %bindir% set bindir=%origdir%\%pythonextdir%\bin - -%PYTHON_HOME%\python sca_setup.py build -%PYTHON_HOME%\python sca_setup.py install --install-lib %bindir% -cd %origdir% - -goto end -:usage -echo Usage: deploy -:end - -endlocal diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/Makefile.am b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/Makefile.am deleted file mode 100644 index 0f221aca05..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/Makefile.am +++ /dev/null @@ -1,62 +0,0 @@ -# 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/python/lib -lib_LTLIBRARIES = libtuscany_sca_python.la - -install-exec-hook: - cd $(libdir); \ - ln -s -f libtuscany_sca_python.so sca.so; \ - for i in libtuscany_sca_python.*; do mv $$i $$i.disabled; done - -pydir=$(prefix)/extensions/python/lib -py_DATA = tuscany/sca/python/sca_proxy.py -EXTRA_DIST = tuscany/sca/python/sca_proxy.py deploy.sh - -rootdir=$(prefix)/extensions/python -root_SCRIPTS = deploy.sh - -noinst_HEADERS = \ -tuscany/sca/python/*.h \ -tuscany/sca/python/model/*.h - -libtuscany_sca_python_la_SOURCES = \ -tuscany/sca/python/PythonExtension.cpp \ -tuscany/sca/python/PythonImplementationExtension.cpp \ -tuscany/sca/python/PythonInterfaceExtension.cpp \ -tuscany/sca/python/PythonServiceWrapper.cpp \ -tuscany/sca/python/PythonServiceProxy.cpp \ -tuscany/sca/python/sca_module.cpp \ -tuscany/sca/python/model/PythonImplementation.cpp \ -tuscany/sca/python/model/PythonInterface.cpp \ -tuscany/sca/python/model/PythonReferenceBinding.cpp \ -tuscany/sca/python/model/PythonServiceBinding.cpp - -# Need python env varibles set. e.g: -# PYTHON_LIB=/usr/lib -# PYTHON_INCLUDE=/usr/include/python2.4 -# PYTHON_VERSION=python2.4 -libtuscany_sca_python_la_LIBADD = -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo \ - -L$(top_builddir)/runtime/core/src -ltuscany_sca \ - -L${PYTHON_LIB} -l${PYTHON_VERSION} - -INCLUDES = -Imodel -I$(top_builddir)/runtime/core/src \ - -I${TUSCANY_SDOCPP}/include \ - -I${PYTHON_INCLUDE} - -AM_CPPFLAGS = $(CPPFLAGS) -D_DEBUG - diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/deploy.cmd b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/deploy.cmd deleted file mode 100644 index 7cd6bb29ab..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/deploy.cmd +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. - - -setlocal -set currentPath=%~d0%~p0 - -echo Enabling the Tuscany Python extension -rename %currentPath%\bin\tuscany_sca_python.dll.disabled tuscany_sca_python.dll - -:end -echo Done -endlocal diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/deploy.sh b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/deploy.sh deleted file mode 100755 index af8ad6f422..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/deploy.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -# 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. - -APFULLDIR=`pwd` - -echo "Enabling the Tuscany Python extension" - -for i in lib/*.disabled; do x=${i%.disabled}; mv $i $x; done - -echo "Done" diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonExtension.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonExtension.cpp deleted file mode 100644 index 4744f628e0..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonExtension.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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/python/PythonExtension.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/core/SCARuntime.h" -#include "tuscany/sca/python/PythonImplementationExtension.h" -#include "tuscany/sca/python/PythonInterfaceExtension.h" - - -extern "C" -{ - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - void tuscany_sca_extension_initialize() - { - tuscany::sca::python::PythonExtension::initialize(); - } -} - -namespace tuscany -{ - namespace sca - { - namespace python - { - // =================================================================== - // Constructor for the PythonExtension class. - // =================================================================== - PythonExtension::PythonExtension() - { - LOGENTRY(1, "PythonExtension::constructor"); - LOGEXIT(1, "PythonExtension::constructor"); - } - - // =================================================================== - // Destructor for the PythonExtension class. - // =================================================================== - PythonExtension::~PythonExtension() - { - LOGENTRY(1, "PythonExtension::destructor");; - LOGEXIT(1, "PythonExtension::destructor"); - } - - void PythonExtension::initialize() - { - LOGENTRY(1, "PythonExtension::initialize");; - SCARuntime::getInstance()->registerImplementationExtension(new PythonImplementationExtension()); - SCARuntime::getInstance()->registerInterfaceExtension(new PythonInterfaceExtension()); - LOGEXIT(1, "PythonExtension::initialize");; - } - - } // End namespace python - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonExtension.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonExtension.h deleted file mode 100644 index 783f37a228..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonExtension.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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_python_pythonextension_h -#define tuscany_sca_python_pythonextension_h - -namespace tuscany -{ - namespace sca - { - namespace python - { - - class PythonExtension - { - public: - /** - * Default constructor - */ - PythonExtension(); - - /** - * Destructor - */ - virtual ~PythonExtension(); - - static void initialize(); - - private: - - }; - - - } // End namespace python - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_python_pythonextension_h - diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonImplementationExtension.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonImplementationExtension.cpp deleted file mode 100644 index 0623fb206c..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonImplementationExtension.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* - * 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/python/PythonImplementationExtension.h" -#include "tuscany/sca/python/model/PythonImplementation.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/util/Utils.h" - - -namespace tuscany -{ - namespace sca - { - namespace python - { - // =================================================================== - // Constructor for the PythonImplementationExtension class. - // =================================================================== - PythonImplementationExtension::PythonImplementationExtension() - { - LOGENTRY(1, "PythonImplementationExtension::constructor"); - LOGEXIT(1, "PythonImplementationExtension::constructor"); - } - - // =================================================================== - // Destructor for the PythonImplementationExtension class. - // =================================================================== - PythonImplementationExtension::~PythonImplementationExtension() - { - LOGENTRY(1, "PythonImplementationExtension::destructor");; - LOGEXIT(1, "PythonImplementationExtension::destructor"); - } - - const string PythonImplementationExtension::extensionName("python"); - const string PythonImplementationExtension::typeQName("http://www.osoa.org/xmlns/sca/1.0#PythonImplementation"); - - // =================================================================== - // loadModelElement - load the info from implementation.python - // =================================================================== - ComponentType* PythonImplementationExtension::getImplementation(Composite *composite, DataObjectPtr scdlImplementation) - { - string implType = scdlImplementation->getType().getName(); - if (implType == "PythonImplementation") - { - string module = scdlImplementation->getCString("module"); - string path = scdlImplementation->getCString("path"); - string className = scdlImplementation->getCString("class"); - string scopeName = scdlImplementation->getCString("scope"); - - PythonImplementation::Scope scope; - if (scopeName == "composite") - { - scope = PythonImplementation::COMPOSITE; - } - else - { - scope = PythonImplementation::STATELESS; - } - - PythonImplementation* pythonImpl = new PythonImplementation(composite, module, path, className, scope); - - return pythonImpl; - } - else - { - return NULL; - } - } - - } // End namespace python - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonImplementationExtension.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonImplementationExtension.h deleted file mode 100644 index 69414dce22..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonImplementationExtension.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * 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_python_pythonimplementationextension_h -#define tuscany_sca_python_pythonimplementationextension_h - -#include "tuscany/sca/extension/ImplementationExtension.h" - -namespace tuscany -{ - namespace sca - { - namespace python - { - - class PythonImplementationExtension : public ImplementationExtension - { - public: - /** - * Default constructor - */ - PythonImplementationExtension(); - - /** - * Destructor - */ - virtual ~PythonImplementationExtension(); - - /** - * return the name of the extension - */ - virtual const string& getExtensionName() {return extensionName;} - - /** - * return the QName of schema elemant for this implementation extension - * (e.g. "http://www.osoa.org/xmlns/sca/1.0#implementation.python") - */ - virtual const string& getExtensionTypeQName() {return typeQName;} - - virtual ComponentType* getImplementation(Composite* composite, DataObjectPtr scdlImplementation); - - private: - static const string extensionName; - static const string typeQName; - - }; - - - } // End namespace python - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_python_pythonimplementationextension_h - diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonInterfaceExtension.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonInterfaceExtension.cpp deleted file mode 100644 index 2a4c94b7af..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonInterfaceExtension.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/* - * 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/python/PythonInterfaceExtension.h" -#include "tuscany/sca/python/model/PythonInterface.h" -#include "tuscany/sca/util/Logging.h" - -//#include "commonj/sdo/SDO.h" -//using commonj::sdo::DataObjectList; - -namespace tuscany -{ - namespace sca - { - namespace python - { - // =================================================================== - // Constructor for the PythonInterfaceExtension class. - // =================================================================== - PythonInterfaceExtension::PythonInterfaceExtension() - { - LOGENTRY(1, "PythonInterfaceExtension::constructor"); - LOGEXIT(1, "PythonInterfaceExtension::constructor"); - } - - // =================================================================== - // Destructor for the PythonInterfaceExtension class. - // =================================================================== - PythonInterfaceExtension::~PythonInterfaceExtension() - { - LOGENTRY(1, "PythonInterfaceExtension::destructor");; - LOGEXIT(1, "PythonInterfaceExtension::destructor"); - } - - const string PythonInterfaceExtension::extensionName("python"); - const string PythonInterfaceExtension::typeQName("http://www.osoa.org/xmlns/sca/1.0#PythonInterface"); - - // =================================================================== - // loadModelElement - load the info from interface.python - // =================================================================== - tuscany::sca::model::Interface* PythonInterfaceExtension::getInterface(Composite* composite, DataObjectPtr scdlInterface) - { - // Determine the type - string ifType = scdlInterface->getType().getName(); - if (ifType == "PythonInterface") - { - bool remotable = scdlInterface->getBoolean("remotable"); - bool conversational = scdlInterface->getBoolean("conversational"); - - return new PythonInterface(remotable, conversational); - //DataObjectList& operationList = scdlInterface->getList("operation"); - - //for(int i=0; igetCString("name"); - - // if(operationList[i]->hasProperty("returnType")) - // { - // string returnType = operationList[i]->getCString("returnType"); - - // if(returnType == "string") - // { - // pythonInterface->addOperation(opName, PythonInterface::STRING); - // } - // else if(returnType == "int") - // { - // pythonInterface->addOperation(opName, PythonInterface::INT); - // } - // else if(returnType == "long") - // { - // pythonInterface->addOperation(opName, PythonInterface::LONG); - // } - // else if(returnType == "boolean") - // { - // pythonInterface->addOperation(opName, PythonInterface::BOOLEAN); - // } - // else if(returnType == "float") - // { - // pythonInterface->addOperation(opName, PythonInterface::FLOAT); - // } - // else if(returnType == "other") - // { - // pythonInterface->addOperation(opName, PythonInterface::OTHER); - // } - // else - // { - // pythonInterface->addOperation(opName, PythonInterface::NONE); - // } - // } - // else - // { - // // No return Type provided - set as NONE - // pythonInterface->addOperation(opName, PythonInterface::NONE); - // } - //} - // - //return pythonInterface; - } - return 0; - } - - } // End namespace python - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonInterfaceExtension.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonInterfaceExtension.h deleted file mode 100644 index 3596857c0d..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonInterfaceExtension.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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_python_pythoninterfaceextension_h -#define tuscany_sca_python_pythoninterfaceextension_h - -#include "tuscany/sca/extension/InterfaceExtension.h" - -namespace tuscany -{ - namespace sca - { - namespace python - { - - class PythonInterfaceExtension : public InterfaceExtension - { - public: - /** - * Default constructor - */ - PythonInterfaceExtension(); - - /** - * Destructor - */ - virtual ~PythonInterfaceExtension(); - - /** - * return the name of the extension - */ - virtual const string& getExtensionName() {return extensionName;} - - /** - * return the QName of schema elemant for this implementation extension - * (e.g. "http://www.osoa.org/xmlns/sca/1.0#PythonInterface") - */ - virtual const string& getExtensionTypeQName() {return typeQName;} - - virtual tuscany::sca::model::Interface* getInterface(Composite* composite, DataObjectPtr scdlInterface); - - private: - static const string extensionName; - static const string typeQName; - - }; - - - } // End namespace python - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_python_pythoninterfaceextension_h - diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceProxy.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceProxy.cpp deleted file mode 100644 index ef482f32e8..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceProxy.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/* - * 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/python/PythonServiceProxy.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/python/PythonServiceRuntimeException.h" -#include "tuscany/sca/core/SCARuntime.h" -#include "tuscany/sca/model/Reference.h" -#include "tuscany/sca/model/ReferenceType.h" -#include "tuscany/sca/model/Service.h" -#include "tuscany/sca/model/ServiceType.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/ComponentType.h" -#include "tuscany/sca/core/ServiceWrapper.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/ServiceBinding.h" -#include "tuscany/sca/python/model/PythonImplementation.h" -#include "tuscany/sca/python/model/PythonReferenceBinding.h" - -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace python - { - - // ============================================ - // Constructor: Create a proxy from a reference - // ============================================ - PythonServiceProxy::PythonServiceProxy(Reference* reference) - : ServiceProxy(reference) - { - LOGENTRY(1,"PythonServiceProxy::constructor(Reference)"); - - // Get the service wrapper - PythonReferenceBinding* referenceBinding = (PythonReferenceBinding*)reference->getBinding(); - serviceWrapper = referenceBinding->getTargetServiceBinding()->getServiceWrapper(); - - LOGEXIT(1,"PythonServiceProxy::constructor(Reference)"); - } - - // ========================================== - // Constructor: Create a proxy from a service - // ========================================== - PythonServiceProxy::PythonServiceProxy(Service* service) - : ServiceProxy(NULL) - { - LOGENTRY(1,"PythonServiceProxy::constructor(Service)"); - - // Get the service wrapper - serviceWrapper = service->getBinding()->getServiceWrapper(); - - LOGEXIT(1,"PythonServiceProxy::constructor(Service)"); - } - - // ========== - // Destructor - // ========== - PythonServiceProxy::~PythonServiceProxy() - { - LOGENTRY(1,"PythonServiceProxy::destructor"); - LOGEXIT(1,"PythonServiceProxy::destructor"); - } - - // ===================================================== - // invokeService: invoke the service wired to this proxy - // ===================================================== - void PythonServiceProxy::invokeService(Operation& operation) - { - LOGENTRY(1,"PythonServiceProxy::invokeService"); - - // Invoke the service - serviceWrapper->invoke(operation); - - LOGEXIT(1,"PythonServiceProxy::invokeService"); - } - } // End namespace python - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceProxy.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceProxy.h deleted file mode 100644 index f16cb95609..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceProxy.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * 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_python_pythonserviceproxy_h -#define tuscany_sca_python_pythonserviceproxy_h - -#include "tuscany/sca/core/ServiceProxy.h" -#include "tuscany/sca/core/ServiceWrapper.h" -#include "tuscany/sca/util/Library.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Reference.h" -#include "tuscany/sca/model/Service.h" - -#include "export.h" - -using namespace tuscany::sca::model; - - -namespace tuscany -{ - namespace sca - { - namespace python - { - - /** - * Holds a proxy for a given reference from a component implemented in Python. - */ - class PythonServiceProxy : public ServiceProxy - { - public: - /** - * Create a new service proxy for a reference. The proxy will contain a pointer to - * the target ServiceWrapper. - * @param reference The reference on the source component. - */ - PythonServiceProxy(Reference* reference); - - /** - * Create a new service proxy for a service. The proxy will contain a pointer to - * the target ServiceWrapper. - * @param service The service on the target component. - */ - SCA_PYTHON_API PythonServiceProxy(Service* service); - - /** - * Destructor. - */ - virtual ~PythonServiceProxy(); - - /** - * Invoke the wired service. - */ - virtual void invokeService(Operation& operation); - - private: - - /** - * The target service wrapper - */ - ServiceWrapper* serviceWrapper; - }; - - } // End namespace python - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_python_pythonserviceproxy_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceRuntimeException.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceRuntimeException.h deleted file mode 100644 index aa8c88d06d..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceRuntimeException.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * 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_python_pythonserviceruntimeexception_h -#define tuscany_sca_python_pythonserviceruntimeexception_h - -#include "export.h" - -#include "tuscany/sca/util/Exceptions.h" -using tuscany::sca::TuscanyRuntimeException; -namespace tuscany -{ - namespace sca - { - namespace python - { - /** - * Exception to represent a failure in a Python call. - */ - class SCA_PYTHON_API PythonServiceRuntimeException : public TuscanyRuntimeException - { - public: - PythonServiceRuntimeException( - const char *name="PythonServiceRuntimeException", - severity_level sev=Severe, - const char* msg_text="") - : TuscanyRuntimeException(name, sev, msg_text) - { - } - }; // End PythonServiceRuntimeException class definition - - /** - * The target of a wire cannot be found, or the reference has not been - * configured. - */ - class SCA_PYTHON_API PythonServiceNotFoundException: public PythonServiceRuntimeException - { - public: - PythonServiceNotFoundException(const char* msg) - : PythonServiceRuntimeException("PythonServiceNotFoundException", Error, - msg) - { - } - private: - }; // End PythonServiceNotFoundException class definition - - - /** - * There is no current component (for example, if a non-SCA component - * tries to get the current ComponentContext). - */ - class SCA_PYTHON_API PythonComponentContextException: public PythonServiceRuntimeException - { - public: - PythonComponentContextException(const char* msg) - : PythonServiceRuntimeException("PythonComponentContextException", Error, - msg) - { - } - private: - }; // End PythonComponentContextException class definition - - /** - * There is no current component (for example, if a non-SCA component - * tries to get the current ComponentContext). - */ - class SCA_PYTHON_API PythonComponentInvocationException: public PythonServiceRuntimeException - { - public: - PythonComponentInvocationException(const char* msg) - : PythonServiceRuntimeException("ComponentInvocationException", Error, - msg) - { - } - private: - }; // End PythonComponentInvocationException class definition - - } // End namespace python - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_python_pythonserviceruntimeexception_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp deleted file mode 100644 index 0223a5741d..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp +++ /dev/null @@ -1,950 +0,0 @@ -/* - * 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/python/PythonServiceRuntimeException.h" -#include "tuscany/sca/python/PythonServiceWrapper.h" - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/ServiceType.h" -#include "tuscany/sca/model/Interface.h" -#include "tuscany/sca/core/SCARuntime.h" -#include "tuscany/sca/python/model/PythonImplementation.h" - -#include "commonj/sdo/SDO.h" -using namespace commonj::sdo; - -namespace tuscany -{ - namespace sca - { - namespace python - { - - /** - * Prints out PyObject and dir(PyObject) - * for debugging purposes - */ - void printPyObject(char * name, PyObject *pObj) - { - PyObject* pObjRepr = PyObject_Repr(pObj); - LOGINFO_2(5, "PythonServiceWrapper::printPyObject %s: %s", name, PyString_AsString(pObjRepr)); - Py_DECREF(pObjRepr); - - PyObject* pObjDir = PyObject_Dir(pObj); - PyObject* pObjDirRepr = PyObject_Repr(pObjDir); - LOGINFO_2(5, "PythonServiceWrapper::printPyObject dir(%s): %s", name, PyString_AsString(pObjDirRepr)); - Py_DECREF(pObjDirRepr); - Py_DECREF(pObjDir); - } - - // =========== - // Constructor - // =========== - PythonServiceWrapper::PythonServiceWrapper(Service* service) - : ServiceWrapper(service) - { - LOGENTRY(1,"PythonServiceWrapper::constructor"); - - component = service->getComponent(); - implementation = (PythonImplementation*)component->getType(); - - pythonModule = NULL; - pythonClassInstance = NULL; - - // ----------------------------------------------- - // Get the implementation for the target component - // ----------------------------------------------- - PythonImplementation* impl = (PythonImplementation*)component->getType(); - if (!impl) - { - string msg = "Component " + component->getName() + " has no implementation defined"; - throw PythonServiceNotFoundException(msg.c_str()); - } - - LOGINFO_1(3,"PythonServiceWrapper::constructor module %s", impl->getModule().c_str()); - LOGINFO_1(3,"PythonServiceWrapper::constructor path %s", impl->getModulePath().c_str()); - LOGINFO_1(3,"PythonServiceWrapper::constructor class %s", impl->getClass().c_str()); - - // Initialize the Python environment - Py_Initialize(); - - // Add the path to the composite (+ any further path specified) to the Python sys.path - string path = component->getComposite()->getRoot() + "/" + impl->getModulePath(); - - PyObject* pSysName = PyString_FromString("sys"); - PyObject* pSys = PyImport_Import(pSysName); - Py_DECREF(pSysName); - - if(pSys != NULL) - { - PyObject* pSysPath = PyObject_GetAttrString(pSys, "path"); - - if(pSysPath != NULL && PyList_Check(pSysPath)) - { - PyObject* pPath = PyString_FromString(path.c_str()); - PyList_Append(pSysPath, pPath); - - - Py_DECREF(pPath); - Py_DECREF(pSysPath); - } - Py_DECREF(pSys); - } - - if(&(impl->getModule()) != NULL && impl->getModule().size() > 0) - { - // Now import the module - PyObject* pModuleName = PyString_FromString(impl->getModule().c_str()); - - pythonModule = PyImport_Import(pModuleName); - Py_DECREF(pModuleName); - } - - if (!pythonModule) - { - if(PyErr_Occurred()) - { - PyErr_Print(); - } - string msg = "Failed to load module named " + impl->getModule(); - LOGERROR(0, msg.c_str()); - throw PythonComponentContextException(msg.c_str()); - } - //else - //{ - // addReferences(pythonModule); - // addProperties(pythonModule); - //} - - printPyObject("pythonModule",pythonModule); - - LOGEXIT(1,"PythonServiceWrapper::constructor"); - - } - - // ========== - // Destructor - // ========== - PythonServiceWrapper::~PythonServiceWrapper() - { - LOGENTRY(1,"PythonServiceWrapper::destructor"); - Py_XDECREF(pythonClassInstance); - Py_XDECREF(pythonModule); - Py_Finalize(); - LOGEXIT(1,"PythonServiceWrapper::destructor"); - } - - // ====================================================================== - // newInstance: create a new class instance - // ====================================================================== - PyObject* PythonServiceWrapper::newInstance() - { - LOGENTRY(1,"PythonServiceWrapper::newInstance"); - PythonImplementation* impl = (PythonImplementation*)component->getType(); - string className = impl->getClass(); - - PyObject* pClassInstance = NULL; - if (pythonModule != NULL) - { - if(&className != NULL && className.size() > 0) - { - // We have a class name, so create an instance and use this to invoke the correct function - PyObject* pClass = PyObject_GetAttrString(pythonModule, (char*) className.c_str()); - - if(pClass == NULL) - { - if(PyErr_Occurred()) - { - PyErr_Print(); - } - string msg = "Cannot find class named " + className + " in Python module"; - LOGERROR(0, msg.c_str()); - throw new PythonComponentInvocationException(msg.c_str()); - } - - pClassInstance = PyInstance_New(pClass, NULL, NULL); - - if(pClassInstance == NULL || !PyInstance_Check(pClassInstance)) - { - if(PyErr_Occurred()) - { - PyErr_Print(); - } - string msg = "Could not create new instance of class named " + className + " in Python module"; - LOGERROR(0, msg.c_str()); - throw new PythonComponentInvocationException(msg.c_str()); - } - Py_XDECREF(pClass); - } - } - LOGEXIT(1,"PythonServiceWrapper::newInstance"); - return pClassInstance; - } - - // ====================================================================== - // getInstance: get a class instance for this scope - // ====================================================================== - PyObject* PythonServiceWrapper::getInstance() - { - LOGENTRY(1,"PythonServiceWrapper::getInstance"); - - PythonImplementation::Scope scope = implementation->getScope(); - if (scope == PythonImplementation::COMPOSITE) - { - if (!pythonClassInstance) - { - pythonClassInstance = newInstance(); - } - return pythonClassInstance; - } - else // (scope == PythonImplementation::STATELESS) - { - return newInstance(); - } - LOGEXIT(1,"PythonServiceWrapper::getInstance"); - } - - // ====================================================================== - // releaseImplementation: release the implementation for this scope - // ====================================================================== - void PythonServiceWrapper::releaseInstance() - { - LOGENTRY(1,"PythonServiceWrapper::releaseInstance"); - - PythonImplementation::Scope scope = implementation->getScope(); - if(scope == PythonImplementation::STATELESS) - { - // Delete the class instance if there is one - if(pythonClassInstance != NULL && PyInstance_Check(pythonClassInstance)) - { - Py_DECREF(pythonClassInstance); - pythonClassInstance = NULL; - } - - // Need to reload the module - PyObject* reloadedPythonModule = PyImport_ReloadModule(pythonModule); - - if(reloadedPythonModule != NULL) - { - // Get rid of old pythonModule and replace with the reloaded one - Py_DECREF(pythonModule); - pythonModule = reloadedPythonModule; - } - } - LOGEXIT(1,"PythonServiceWrapper::releaseInstance"); - } - - // ====================================================================== - // invoke: wrapper call to service with setting the component context - // ====================================================================== - void PythonServiceWrapper::invoke(Operation& operation) - { - LOGENTRY(1,"PythonServiceWrapper::invoke"); - - SCARuntime* runtime = SCARuntime::getInstance(); - runtime->setCurrentComponent(component); - - - // Load the references & properties into the module - addReferences(pythonModule); - addProperties(pythonModule); - - try - { - LOGINFO_1(4, "PythonServiceWrapper::invoke called with operation name: %s", operation.getName().c_str()); - - PyObject* pFunc = NULL; - pythonClassInstance = getInstance(); - - if(pythonClassInstance != NULL && PyInstance_Check(pythonClassInstance)) - { - // Get the function from the instance - pFunc = PyObject_GetAttrString(pythonClassInstance, (char*) operation.getName().c_str()); - } - if(pFunc == NULL && pythonModule != NULL) - { - // Get the function directly from the module if it could not be got from an instance - pFunc = PyObject_GetAttrString(pythonModule, (char*) operation.getName().c_str()); - } - if(pFunc == NULL) - { - // Can't get the function from the class or module - throw exception - string msg = "Python module or class instance has not been created"; - LOGERROR(0, msg.c_str()); - throw new PythonComponentInvocationException(msg.c_str()); - } - - if (pFunc && PyCallable_Check(pFunc)) - { - PyObject* pArgs = PyTuple_New(operation.getNParms()); - PyObject* pValue = NULL; - - for(unsigned int i = 0; i < operation.getNParms(); i++) - { - const Operation::Parameter& parm = operation.getParameter(i); - switch(parm.getType()) - { - case Operation::BOOL: - { - if( *(bool*)parm.getValue()) - { - //boolean true - pValue = Py_True; - } - else - { - pValue = Py_False; - } - break; - } - case Operation::SHORT: - { - pValue = PyInt_FromLong(*(short*)parm.getValue()); - break; - } - case Operation::USHORT: - { - pValue = PyInt_FromLong(*(unsigned short*)parm.getValue()); - break; - } - case Operation::INT: - { - pValue = PyInt_FromLong(*(int*)parm.getValue()); - break; - } - case Operation::UINT: - { - pValue = PyInt_FromLong(*(unsigned int*)parm.getValue()); - break; - } - case Operation::LONG: - { - pValue = PyLong_FromLong(*(long*)parm.getValue()); - break; - } - case Operation::ULONG: - { - pValue = PyLong_FromUnsignedLong(*(unsigned long*)parm.getValue()); - break; - } - case Operation::FLOAT: - { - pValue = PyFloat_FromDouble(*(float*)parm.getValue()); - break; - } - case Operation::DOUBLE: - { - pValue = PyFloat_FromDouble(*(double*)parm.getValue()); - break; - } - case Operation::LONGDOUBLE: - { - pValue = PyFloat_FromDouble(*(long double*)parm.getValue()); - break; - } - case Operation::CHARS: - { - pValue = PyString_FromString(*(char**)parm.getValue()); - break; - } - case Operation::STRING: - { - pValue = PyString_FromString((*(string*)parm.getValue()).c_str()); - break; - } - default: throw new PythonComponentInvocationException("Operation parameter type not supported"); - } - - if (!pValue) - { - Py_DECREF(pArgs); - - if(PyErr_Occurred()) - { - PyErr_Print(); - } - - string msg = "Error converting parameter into Python type"; - LOGERROR(0, msg.c_str()); - throw new PythonComponentInvocationException(msg.c_str()); - - } - //printPyObject("Param value", pValue); - - /* pValue reference stolen here: */ - PyTuple_SetItem(pArgs, i, pValue); - } - - pValue = PyObject_CallObject(pFunc, pArgs); - //printPyObject("Return value", pValue); - - Py_DECREF(pArgs); - if (pValue != NULL) - { - char buf[20]; - if(PyInt_Check(pValue) || PyLong_Check(pValue)) - { - long* data = new long; - if(PyInt_Check(pValue)) - { - LOGINFO_1(3, "PythonServiceWrapper::invoke Return value is int type: %d", PyInt_AsLong(pValue)); - *data = PyInt_AsLong(pValue); - } - else - { - LOGINFO_1(3, "PythonServiceWrapper::invoke Return value is long type: %l", PyLong_AsLong(pValue)); - *data = PyLong_AsLong(pValue); - } - - // Check if the return type has already been set (for typed languages) - switch(operation.getReturnType()) - { - case Operation::BOOL: - { - *(bool*)operation.getReturnValue() = (*data != 0); - break; - } - case Operation::SHORT: - { - *(short*)operation.getReturnValue() = (short)*data; - break; - } - case Operation::USHORT: - { - *(unsigned short*)operation.getReturnValue() = (unsigned short)*data; - break; - } - case Operation::INT: - { - *(int*)operation.getReturnValue() = (int)*data; - break; - } - case Operation::UINT: - { - *(unsigned int*)operation.getReturnValue() = (unsigned int)*data; - break; - } - case Operation::LONG: - { - *(long*)operation.getReturnValue() = (long)*data; - break; - } - case Operation::ULONG: - { - *(unsigned long*)operation.getReturnValue() = (unsigned long)*data; - break; - } - case Operation::FLOAT: - { - *(float*)operation.getReturnValue() = (float)*data; - break; - } - case Operation::DOUBLE: - { - *(double*)operation.getReturnValue() = (double)*data; - break; - } - case Operation::LONGDOUBLE: - { - *(long double*)operation.getReturnValue() = (long double)*data; - break; - } - case Operation::CHARS: - { - sprintf(buf, "%d", *data); - *(char**)operation.getReturnValue() = buf; - break; - } - case Operation::STRING: - { - sprintf(buf, "%d", *data); - *(string*)operation.getReturnValue() = buf; - break; - } - default: - { - // The type is set as something else or has not been set - operation.setReturnValue(data); - } - } - } - else if(PyBool_Check(pValue)) - { - LOGINFO_1(3, "PythonServiceWrapper::invoke Return value is bool type: %d", (pValue == Py_True)); - bool* data = new bool; - *data = (pValue == Py_True); - - // Check if the return type has already been set (for typed languages) - switch(operation.getReturnType()) - { - case Operation::BOOL: - { - *(bool*)operation.getReturnValue() = *data; - break; - } - case Operation::SHORT: - { - *(short*)operation.getReturnValue() = (short)*data; - break; - } - case Operation::USHORT: - { - *(unsigned short*)operation.getReturnValue() = (unsigned short)*data; - break; - } - case Operation::INT: - { - *(int*)operation.getReturnValue() = (int)*data; - break; - } - case Operation::UINT: - { - *(unsigned int*)operation.getReturnValue() = (unsigned int)*data; - break; - } - case Operation::LONG: - { - *(long*)operation.getReturnValue() = (long)*data; - break; - } - case Operation::ULONG: - { - *(unsigned long*)operation.getReturnValue() = (unsigned long)*data; - break; - } - case Operation::FLOAT: - { - *(float*)operation.getReturnValue() = (float)*data; - break; - } - case Operation::DOUBLE: - { - *(double*)operation.getReturnValue() = (double)*data; - break; - } - case Operation::LONGDOUBLE: - { - *(long double*)operation.getReturnValue() = (long double)*data; - break; - } - case Operation::CHARS: - { - if(*data) - { - *(char**)operation.getReturnValue() = "true"; - } - else - { - *(char**)operation.getReturnValue() = "false"; - } - break; - } - case Operation::STRING: - { - if(*data) - { - *(string*)operation.getReturnValue() = "true"; - } - else - { - *(string*)operation.getReturnValue() = "false"; - } - break; - } - default: - { - // The type is set as something else or has not been set - operation.setReturnValue(data); - } - } - } - else if(PyFloat_Check(pValue)) - { - LOGINFO_1(3, "PythonServiceWrapper::invoke Return value is float type: %f", PyFloat_AsDouble(pValue)); - - double* data = new double; - *data = PyFloat_AsDouble(pValue); - - // Check if the return type has already been set (for typed languages) - switch(operation.getReturnType()) - { - case Operation::BOOL: - { - *(bool*)operation.getReturnValue() = (*data != 0.0); - break; - } - case Operation::SHORT: - { - *(short*)operation.getReturnValue() = (short)*data; - break; - } - case Operation::USHORT: - { - *(unsigned short*)operation.getReturnValue() = (unsigned short)*data; - break; - } - case Operation::INT: - { - *(int*)operation.getReturnValue() = (int)*data; - break; - } - case Operation::UINT: - { - *(unsigned int*)operation.getReturnValue() = (unsigned int)*data; - break; - } - case Operation::LONG: - { - *(long*)operation.getReturnValue() = (long)*data; - break; - } - case Operation::ULONG: - { - *(unsigned long*)operation.getReturnValue() = (unsigned long)*data; - break; - } - case Operation::FLOAT: - { - *(float*)operation.getReturnValue() = (float)*data; - break; - } - case Operation::DOUBLE: - { - *(double*)operation.getReturnValue() = (double)*data; - break; - } - case Operation::LONGDOUBLE: - { - *(long double*)operation.getReturnValue() = (long double)*data; - break; - } - case Operation::CHARS: - { - sprintf(buf, "%f", *data); - *(char**)operation.getReturnValue() = buf; - break; - } - case Operation::STRING: - { - sprintf(buf, "%f", *data); - *(string*)operation.getReturnValue() = buf; - break; - } - default: - { - // The type is set as something else or has not been set - operation.setReturnValue(data); - } - } - } - else if(PyString_Check(pValue)) - { - LOGINFO_1(3, "PythonServiceWrapper::invoke Return value is string type: %s", PyString_AsString(pValue)); - const char** data = new const char*; - *data = PyString_AsString(pValue); - - // Check if the return type has already been set (for typed languages) - switch(operation.getReturnType()) - { - case Operation::BOOL: - { - // If the string is empty or "0" or "false" set to false, otherwise true - if(strlen(*data) == 0 || strcmp(*data, "0") == 0 || strcmp(*data, "false") == 0) - { - *(bool*)operation.getReturnValue() = false; - } - else - { - *(bool*)operation.getReturnValue() = true; - } - break; - } - case Operation::SHORT: - { - *(short*)operation.getReturnValue() = (short)atoi(*data); - break; - } - case Operation::USHORT: - { - *(unsigned short*)operation.getReturnValue() = (unsigned short)atoi(*data); - break; - } - case Operation::INT: - { - *(int*)operation.getReturnValue() = (int)atoi(*data); - break; - } - case Operation::UINT: - { - *(unsigned int*)operation.getReturnValue() = (unsigned int)atoi(*data); - break; - } - case Operation::LONG: - { - *(long*)operation.getReturnValue() = (long)atol(*data); - break; - } - case Operation::ULONG: - { - *(unsigned long*)operation.getReturnValue() = (unsigned long)atol(*data); - break; - } - case Operation::FLOAT: - { - *(float*)operation.getReturnValue() = (float)atof(*data); - break; - } - case Operation::DOUBLE: - { - *(double*)operation.getReturnValue() = (double)atof(*data); - break; - } - case Operation::LONGDOUBLE: - { - *(long double*)operation.getReturnValue() = (long double)atof(*data); - break; - } - case Operation::CHARS: - { - *(const char**)operation.getReturnValue() = *data; - break; - } - case Operation::STRING: - { - *(string*)operation.getReturnValue() = *data; - break; - } - default: - { - // The type is set as something else or has not been set - operation.setReturnValue(data); - } - } - } - else - { - PyObject* valueRepr = PyObject_Repr(pValue); - PyObject* valueType = PyObject_Type(pValue); - PyObject* valueTypeRepr = PyObject_Repr(valueType); - LOGINFO_2(3, "PythonServiceWrapper::invoke Return value is of unknown type (%s) and has repr: %s", PyString_AsString(valueTypeRepr), PyString_AsString(valueRepr)); - Py_DECREF(valueTypeRepr); - Py_DECREF(valueType); - Py_DECREF(valueRepr); - } - - Py_DECREF(pValue); - } - else - { - Py_DECREF(pFunc); - if(PyErr_Occurred()) - { - PyErr_Print(); - } - string msg = "Error whilst calling Python module"; - LOGERROR(0, msg.c_str()); - throw new PythonComponentInvocationException(msg.c_str()); - } - } - else - { - if (PyErr_Occurred()) - { - PyErr_Print(); - } - string msg = "Cannot find the operation named " + operation.getName() + " in the Python module"; - LOGERROR(0, msg.c_str()); - throw new PythonComponentInvocationException(msg.c_str()); - } - Py_XDECREF(pFunc); - - } - catch (...) - { - releaseInstance(); - runtime->unsetCurrentComponent(); - throw; - } - releaseInstance(); - runtime->unsetCurrentComponent(); - LOGEXIT(1,"PythonServiceWrapper::invoke"); - - } - - - // ========================================================================== - // Add any properties into the loaded implementation module as Python objects - // ========================================================================== - void PythonServiceWrapper::addProperties(PyObject* module) - { - // Set all the configured properties - DataObjectPtr properties = component->getProperties(); - PropertyList pl = properties->getInstanceProperties(); - - for (int i = 0; i < pl.size(); i++) - { - if (properties->isSet(pl[i])) - { - string propName = pl[i].getName(); - string propValue = properties->getCString(pl[i]); - PyObject* property; - - if(pl[i].isMany()) - { - //TODO - deal with properties that are many - } - - switch(pl[i].getTypeEnum()) - { - case Type::BooleanType: - { - if(properties->getBoolean(pl[i])) - { - property = Py_True; - } - else - { - property = Py_False; - } - Py_INCREF(property); - break; - } - case Type::BigIntegerType: - case Type::BigDecimalType: - case Type::LongType: - { - property = PyLong_FromLongLong(properties->getLong(pl[i])); - break; - } - case Type::ShortType: - case Type::IntegerType: - { - property = PyInt_FromLong(properties->getInteger(pl[i])); - break; - } - case Type::DoubleType: - case Type::FloatType: - { - property = PyFloat_FromDouble(properties->getDouble(pl[i])); - break; - } - case Type::DataObjectType: - case Type::OpenDataObjectType: - { - // Serialize a DataObject and create a python string object from the XML - DataObjectPtr data = properties->getDataObject(pl[i]); - XMLHelperPtr helper = HelperProvider::getXMLHelper(properties->getDataFactory()); - string serializedData = helper->save(data, "", propName); - property = PyString_FromString(serializedData.c_str()); - break; - } - case Type::CharacterType: - case Type::StringType: - case Type::TextType: - case Type::UriType: - default: - { - // For strings and by default create a python string object - property = PyString_FromString(propValue.c_str()); - break; - } - } - - int success = PyModule_AddObject(module, (char*)propName.c_str(), property); - - if(success == 0) - { - LOGINFO_3(3, "Successfully added property named %s with type %s and value %s to python module", propName.c_str(), pl[i].getType().getName(), propValue.c_str()); - } - else - { - LOGERROR_1(1, "Failed to add property named %s to python module", propName.c_str()); - } - } - } - } - - - // ====================================================================== - // Add any references into the loaded implementation module as class instances that look like - // the classes defined in the interface.python xml - // ====================================================================== - void PythonServiceWrapper::addReferences(PyObject* module) - { - - // Import the TuscanySCA python-extension module - PyObject* pModuleName = PyString_FromString("sca_proxy"); - PyObject* sca_proxy_module = PyImport_Import(pModuleName); - Py_DECREF(pModuleName); - - if(!sca_proxy_module) - { - if(PyErr_Occurred()) - { - PyErr_Print(); - } - string msg = "Failed to load the sca_proxy Python module - has it been successfully installed?\nReferences from Python components will not be supported"; - LOGERROR(0, msg.c_str()); - } - else - { - // Get the sca_proxy class - PyObject* sca_proxy_class = PyObject_GetAttrString(sca_proxy_module, "sca_proxy_class"); - - // Iterate through the references of the current component, adding - // each reference to the module - Component::REFERENCE_MAP references = component->getReferences(); - Component::REFERENCE_MAP::iterator pos; - for( pos = references.begin(); pos != references.end(); ++pos) - { - ReferenceType* referenceType = ((Reference*) pos->second)->getType(); - string referenceName = referenceType->getName(); - - PyObject* tuscanySCAArgs = PyTuple_New(2); - PyObject* refName = PyString_FromString(referenceType->getName().c_str()); - PyTuple_SetItem(tuscanySCAArgs, 0, refName); - Py_INCREF(Py_True); - PyTuple_SetItem(tuscanySCAArgs, 1, Py_True); - - // Create the instance of the TuscanySCAReference class - PyObject* sca_proxy_classInstance = PyInstance_New(sca_proxy_class, tuscanySCAArgs, NULL); - Py_DECREF(tuscanySCAArgs); - - int success = PyModule_AddObject(module, (char*)referenceName.c_str(), sca_proxy_classInstance); - - if(success == 0) - { - LOGINFO_1(3, "Successfully added sca_proxy_class instance as %s to pythonModule", referenceName.c_str()); - } - else - { - LOGERROR_1(1, "Failed to add sca_proxy_class instance as %s to pythonModule", referenceName.c_str()); - } - } - Py_DECREF(sca_proxy_module); - } - } - } // End namespace python - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.h deleted file mode 100644 index 51b0f1dd64..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - * 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_python_pythonservicewrapper_h -#define tuscany_sca_python_pythonservicewrapper_h - -#include "tuscany/sca/python/export.h" -#include "tuscany/sca/core/ServiceWrapper.h" -#include "tuscany/sca/core/Operation.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Interface.h" -#include "tuscany/sca/python/model/PythonImplementation.h" - -using namespace tuscany::sca::model; - -// undefine _DEBUG so Python does not need it's deebug dll -#ifdef _DEBUG -#undef _DEBUG -#define _SCA_PYTHON_DEBUG -#endif -#include -#ifdef _SCA_PYTHON_DEBUG -#define _DEBUG -#endif - - -namespace tuscany -{ - namespace sca - { - namespace python - { - class PythonInterface; - - /** - * Wraps the service on a component implementation. - * This abstract class is extended by generated code which provides - * the implementation of some of the methods. - * An instance of this class wraps the actual component implementation which - * has been written by a developer of an SCA application. - */ - class PythonServiceWrapper : public ServiceWrapper - { - public: - - /** - * Constructor. - * @param target The component service to which this wrapper refers. - */ - PythonServiceWrapper(Service* service); - - /** - * Destructor. - */ - virtual ~PythonServiceWrapper(); - - /** - * All business method calls to the target component go through the invoke method. - * @param operation The details of the method, paramaters and return value for the - * business method to be called on the target component. - */ - virtual void invoke(Operation& operation); - - - protected: - - /** - * Return the current instance of the python class. - * @return A pointer to an instance of the python class. - */ - virtual PyObject* getInstance(); - - /** - * Creates a new instance of the python class. - * @return A pointer to a new instance of the python class. - */ - virtual PyObject* newInstance(); - - /** - * Indicates that the current instance of the python module or class - * has been finished with. - */ - virtual void releaseInstance(); - - - private: - /** - * Holds a class instance if a classname is provided. - * Will be constructed each time if scope is set to STATELESS - */ - PyObject* pythonClassInstance; - - /** - * Holds the module - */ - PyObject* pythonModule; - - /** - * Adds references to the provided implementation module or class instance - */ - void addReferences(PyObject* module); - - /** - * Adds properties to the provided implementation module or class instance - */ - void addProperties(PyObject* module); - - /** - * The component to which this wrapper refers. - */ - Component* component; - - /** - * The component implementation - */ - PythonImplementation* implementation; - - }; - - } // End namespace python - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_python_pythonservicewrapper_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/export.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/export.h deleted file mode 100644 index b608a50711..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/export.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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_python_export_h -#define tuscany_sca_python_export_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) - -#ifdef TUSCANY_SCA_PYTHON_EXPORTS -#define SCA_PYTHON_API __declspec(dllexport) -#else -#define SCA_PYTHON_API __declspec(dllimport) -#endif - -#else -#include -#include -#include -#define SCA_PYTHON_API -#endif - -#endif // tuscany_sca_export_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.cpp deleted file mode 100644 index 413d87173d..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/* - * 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/python/model/PythonImplementation.h" -#include "tuscany/sca/python/model/PythonServiceBinding.h" -#include "tuscany/sca/python/model/PythonReferenceBinding.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Service.h" -#include "tuscany/sca/model/Reference.h" -#include "tuscany/sca/util/Utils.h" - -namespace tuscany -{ - namespace sca - { - - namespace python - { - - // Constructor - PythonImplementation::PythonImplementation( - Composite* composite, const string& module, const string& modulePath, const string& className, Scope scope) - : ComponentType(composite, modulePath + "/" + module), - module(module), modulePath(modulePath), className(className), scope(scope) - { - LOGENTRY(1,"PythonImplementation::constructor"); - LOGEXIT(1,"PythonImplementation::constructor"); - } - - PythonImplementation::~PythonImplementation() - { - LOGENTRY(1,"PythonImplementation::destructor"); - LOGEXIT(1,"PythonImplementation::destructor"); - } - - void PythonImplementation::initializeComponent(Component* component) - { - LOGENTRY(1,"PythonImplementation::initializeComponent"); - ComponentType::initializeComponent(component); - - // Create Python bindings for all the services - const Component::SERVICE_MAP& services = component->getServices(); - Component::SERVICE_MAP::const_iterator iter = services.begin(); - for (unsigned int i=0; i< services.size(); i++) - { - Service *service = iter->second; - PythonServiceBinding* binding = new PythonServiceBinding(service); - service->setBinding(binding); - iter++; - } - - // Create Python bindings for all the references - const Component::REFERENCE_MAP& references = component->getReferences(); - Component::REFERENCE_MAP::const_iterator refiter = references.begin(); - for (int ri=0; ri< references.size(); ri++) - { - Reference *reference = refiter->second; - PythonReferenceBinding* binding = new PythonReferenceBinding(reference); - reference->setBinding(binding); - refiter++; - } - - LOGEXIT(1,"PythonImplementation::initializeComponent"); - } - - } // End namespace python - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.h deleted file mode 100644 index 6d4cece5fd..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.h +++ /dev/null @@ -1,129 +0,0 @@ -/* - * 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_python_model_pythonimplementation_h -#define tuscany_sca_python_model_pythonimplementation_h -#include "tuscany/sca/model/ComponentType.h" - -#include -using std::map; -#include -using std::string; - -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace python - { - /** - * Holds information about an SCA implementation written in Python - */ - class PythonImplementation : public ComponentType - { - - public: - /** - * Scope of the component implementation. - */ - enum Scope - { - COMPOSITE, - STATELESS - }; - - /** - * Constructor. - * @param composite The composite containing this implementation. - * @param module Name of the module. - * @param modulePath Path to the module (could be a blank string - * if this is not specified). - * @param className Name of the class in the module (could be a blank string - * if this is not specified). - */ - PythonImplementation(Composite* composite, const string& module, const string& modulePath, const string& className, Scope scope); - - /** - * Destructor - */ - virtual ~PythonImplementation(); - - /** - * Initialize a component of this type. - * @param component The component to initialize. - */ - virtual void initializeComponent(Component* component); - - /** - * Returns the name of the module. - * @return The name of the module. - */ - const string& getModule() const { return module; } - - /** - * Get the header path. - * @return The pathe element of the header. - */ - const string& getModulePath() const { return modulePath; } - - /** - * Get the name of the class. - * @return The class name if specified. - */ - const string& getClass() const { return className; } - - /** - * Returns the implementation scope - */ - Scope getScope() const { return scope; } - - private: - - /** - * Name of the module. - */ - string module; - - /** - * Path to the module. - */ - string modulePath; - - /** - * 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; - - /** - * The implementation scope - */ - Scope scope; - }; - - } // End namespace python - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_python_model_pythonimplementation_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonInterface.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonInterface.cpp deleted file mode 100644 index 6836158e0d..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonInterface.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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/python/export.h" -#include "tuscany/sca/python/model/PythonInterface.h" - - -namespace tuscany -{ - namespace sca - { - namespace python - { - const string PythonInterface::typeQName("http://www.osoa.org/xmlns/sca/1.0#PythonInterface"); - - // Constructor - PythonInterface::PythonInterface( - bool remotable, - bool conversational) - : Interface(remotable, conversational) - { - LOGENTRY(1, "PythonInterface::constructor"); - LOGEXIT(1, "PythonInterface::constructor"); - } - - PythonInterface::~PythonInterface() - { - } - - } // End namespace python - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonInterface.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonInterface.h deleted file mode 100644 index ed42a3920d..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonInterface.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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_python_model_pythoninterface_h -#define tuscany_sca_python_model_pythoninterface_h - -#include "tuscany/sca/python/export.h" -#include "tuscany/sca/model/Interface.h" - -#include -using std::map; -#include -using std::vector; -#include -using std::string; - -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace python - { - /** - * Holds information about an interface described using a C++ - * header file. - */ - class PythonInterface : public Interface - { - - public: - /** - * Constuctor. - * @param scope The scope of the interface (stateless or composite). - * @param remotable True if the interface is remotable. - */ - PythonInterface( - bool remotable, - bool conversational); - - /** - * Destructor. - */ - virtual ~PythonInterface(); - - /** - * return the QName of the schema type for this interface type - * (e.g. "http://www.osoa.org/xmlns/sca/1.0#interface.cpp") - */ - const string& getInterfaceTypeQName() { return typeQName; }; - - /** - * The QName of the schema type for this interface type. - */ - SCA_PYTHON_API static const string typeQName; - - }; - - } // End namespace python - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_python_model_pythoninterface_h - diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonReferenceBinding.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonReferenceBinding.cpp deleted file mode 100644 index 82f5811203..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonReferenceBinding.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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/python/model/PythonReferenceBinding.h" -#include "tuscany/sca/python/PythonServiceProxy.h" - - -namespace tuscany -{ - namespace sca - { - namespace python - { - - // Constructor - PythonReferenceBinding::PythonReferenceBinding(Reference* reference) - : ReferenceBinding(reference, ""), serviceProxy(NULL) - { - } - - // Destructor - PythonReferenceBinding::~PythonReferenceBinding() - { - } - - ServiceProxy* PythonReferenceBinding::getServiceProxy() - { - return serviceProxy; - } - - void PythonReferenceBinding::configure(ServiceBinding* binding) - { - targetServiceBinding = binding; - - serviceProxy = new PythonServiceProxy(getReference()); - } - - } // End namespace python - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonReferenceBinding.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonReferenceBinding.h deleted file mode 100644 index b37d261416..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonReferenceBinding.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * 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_python_model_pythonreferencebinding_h -#define tuscany_sca_python_model_pythonreferencebinding_h - -#include "tuscany/sca/model/ReferenceBinding.h" - - -#include -using std::string; - -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace python - { - /** - * Information about a Python service binding for service or a reference. - */ - class PythonReferenceBinding : public ReferenceBinding - { - public: - - /** - * Constructor. - */ - PythonReferenceBinding(Reference* reference); - - /** - * Destructor. - */ - virtual ~PythonReferenceBinding(); - - /** - * Returns the type of binding. - */ - virtual string getType() { return "http://www.osoa.org/xmlns/sca/1.0#PythonImplementationBinding"; }; - - /** - * Create a proxy representing the reference to the - * client component. - */ - virtual ServiceProxy* getServiceProxy(); - - /** - * Configure this binding from a service binding. - */ - virtual void configure(ServiceBinding* serviceBinding); - - /** - * Returns the target service binding. - */ - ServiceBinding* getTargetServiceBinding() const { return targetServiceBinding; }; - - private: - - /** - * The proxy representing the reference to the client - * component. - */ - ServiceProxy* serviceProxy; - - /** - * The service binding of the target - */ - ServiceBinding* targetServiceBinding; - }; - - } // End namespace python - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_python_model_pythonreferencebinding_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonServiceBinding.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonServiceBinding.cpp deleted file mode 100644 index 544682c18e..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonServiceBinding.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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/python/model/PythonServiceBinding.h" -#include "tuscany/sca/python/PythonServiceWrapper.h" - -namespace tuscany -{ - namespace sca - { - namespace python - { - - // Constructor - PythonServiceBinding::PythonServiceBinding(Service* service) - : ServiceBinding(service, "") - { - LOGENTRY(1,"PythonServiceBinding::constructor"); - serviceWrapper = new PythonServiceWrapper(service); - LOGEXIT(1,"PythonServiceBinding::constructor"); - } - - // Destructor - PythonServiceBinding::~PythonServiceBinding() - { - LOGENTRY(1,"PythonServiceBinding::destructor"); - LOGEXIT(1,"PythonServiceBinding::destructor"); - } - - ServiceWrapper* PythonServiceBinding::getServiceWrapper() - { - LOGENTRY(1,"PythonServiceBinding::getServiceWrapper"); - LOGEXIT(1,"PythonServiceBinding::getServiceWrapper"); - return (ServiceWrapper*)serviceWrapper; - } - - } // End namespace ws - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonServiceBinding.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonServiceBinding.h deleted file mode 100644 index f2d64b3edc..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonServiceBinding.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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_python_model_pythonservicebinding_h -#define tuscany_sca_python_model_pythonservicebinding_h - -#include "tuscany/sca/model/ServiceBinding.h" -using namespace tuscany::sca::model; -#include -using std::string; - -namespace tuscany -{ - namespace sca - { - namespace python - { - /** - * Information about a Python service binding for service or a reference. - */ - class PythonServiceBinding : public ServiceBinding - { - public: - - /** - * Constructor. - * @param uri The uri of the binding. - * @param port The definition of the port to which the entrypoint - * or external service is to be bound. This is of the form - * "namespace"#endpoint("service"/"port") - */ - PythonServiceBinding(Service* service); - - /** - * Destructor. - */ - virtual ~PythonServiceBinding(); - - /** - * Returns the type of binding. - */ - virtual string getType() { return "http://www.osoa.org/xmlns/sca/1.0#PythonImplementationBinding"; }; - - /** - * Create a wrapper for the service configured by this - * binding. - */ - virtual ServiceWrapper* getServiceWrapper(); - - private: - - /** - * The wrapper for the service configured by this binding. - */ - ServiceWrapper* serviceWrapper; - - }; - - } // End namespace python - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_python_model_pythonservicebinding_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/sca_module.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/sca_module.cpp deleted file mode 100644 index d3a92ba57b..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/sca_module.cpp +++ /dev/null @@ -1,380 +0,0 @@ -/* - * 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 - -#include "tuscany/sca/core/SCARuntime.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Reference.h" -#include "tuscany/sca/model/ReferenceType.h" -#include "tuscany/sca/model/ServiceBinding.h" -#include "tuscany/sca/core/Operation.h" -using namespace tuscany::sca; -using namespace tuscany::sca::model; - -#include "PythonServiceProxy.h" -using namespace tuscany::sca::python; - -#include "tuscany/sca/util/Logging.h" - -#include -#include -using namespace std; - -static PyObject* scaError; - -/** -* Prints out PyObject and dir(PyObject) -* for debugging purposes -*/ -static void printPyObject(char* prefix, char* name, PyObject* pObj) -{ - LOGINFO(4, "Entering printPyObject"); - PyObject* pObjRepr = PyObject_Repr(pObj); - LOGINFO_3(4, "%s printPyObject %s: %s", prefix, name, PyString_AsString(pObjRepr)); - Py_XDECREF(pObjRepr); - - if(pObj != NULL) - { - PyObject* pObjDir = PyObject_Dir(pObj); - PyObject* pObjDirRepr = PyObject_Repr(pObjDir); - LOGINFO_3(4, "%s printPyObject dir(%s): %s", prefix, name, PyString_AsString(pObjDirRepr)); - Py_DECREF(pObjDirRepr); - Py_DECREF(pObjDir); - } - LOGINFO(4, "Returning from printPyObject"); -} - -static PyObject* sca_locateservice(PyObject *self, PyObject *args) -{ - // Get the service name - PyObject* pServiceName = PyTuple_GetItem(args, 0); - - // Import the SCA python-extension module - PyObject* pModuleName = PyString_FromString("sca_proxy"); - PyObject* sca_proxy_module = PyImport_Import(pModuleName); - Py_DECREF(pModuleName); - - if(!sca_proxy_module) - { - if(PyErr_Occurred()) - { - PyErr_Print(); - } - string msg = "Failed to load the sca_proxy Python module - has it been successfully installed?\nReferences from Python components will not be supported"; - LOGERROR(0, msg.c_str()); - } - else - { - // Get the sca_proxy class - PyObject* sca_proxy_class = PyObject_GetAttrString(sca_proxy_module, "sca_proxy_class"); - - PyObject* scaArgs = PyTuple_New(2); - PyTuple_SetItem(scaArgs, 0, pServiceName); - Py_INCREF(Py_True); - PyTuple_SetItem(scaArgs, 1, Py_False); - - // Create the instance of the scaReference class - PyObject* sca_proxy_classInstance = PyInstance_New(sca_proxy_class, scaArgs, NULL); - Py_DECREF(scaArgs); - - return sca_proxy_classInstance; - } - - Py_INCREF(Py_None); - return Py_None; -} - - -static PythonServiceProxy* getServiceProxy(PyObject *args) -{ - LOGENTRY(1, "sca_module getPythonServiceProxy"); - - PythonServiceProxy* serviceProxy = NULL; - SCARuntime* runtime = SCARuntime::getInstance(); - - // The first argument holds the name - string name; - PyObject* pName = PyTuple_GetItem(args, 0); - if(pName && PyString_Check(pName)) - { - name = PyString_AsString(pName); - } - if(name.size() > 0) - { - LOGINFO_1(3, "sca_invoke Service/Reference name is %s", name.c_str()); - } - else - { - string msg = "sca_invoke Service/Reference name has not been set"; - LOGERROR(1, msg.c_str()); - PyErr_SetString(scaError, msg.c_str()); - return NULL; - } - - // The second argument is a boolean - PyObject* isReference = PyTuple_GetItem(args, 1); - - // Get the serviceProxy from the reference or service name provided - if(PyObject_IsTrue(isReference)) - { - Component* component = runtime->getCurrentComponent(); - Reference* ref = component->findReference(name); - if(!ref) - { - string msg = "sca_invoke Could not find the reference named "+name; - LOGERROR(1, msg.c_str()); - PyErr_SetString(scaError, msg.c_str()); - - return NULL; - } - - ReferenceBinding* refBinding = ref->getBinding(); - serviceProxy = (PythonServiceProxy*) refBinding->getServiceProxy(); - } - else - { - Component* component = runtime->getDefaultComponent(); - Composite* composite = (Composite*)component->getType(); - Service* service = composite->findComponentService(name); - - if(!service) - { - string msg = "sca_invoke Could not find the service named "+name; - LOGERROR(1, msg.c_str()); - PyErr_SetString(scaError, msg.c_str()); - return NULL; - } - - serviceProxy = new PythonServiceProxy(service); - } - - return serviceProxy; -} - - -static PyObject* sca_invoke(PyObject *self, PyObject *args) -{ - LOGENTRY(1, "sca_invoke"); - - PythonServiceProxy* pythonServiceProxy = getServiceProxy(args); - if(!pythonServiceProxy) - { - return NULL; - } - - // Get the name of the operation to invoke - string operationName; - PyObject* opName = PyTuple_GetItem(args, 2); - if(opName && PyString_Check(opName)) - { - operationName = PyString_AsString(opName); - } - - if(operationName.size() > 0) - { - LOGINFO_1(3, "sca_invoke Operation name is %s", operationName.c_str()); - } - else - { - string msg = "sca_invoke Operation name has not been set"; - LOGERROR(1, msg.c_str()); - PyErr_SetString(scaError, msg.c_str()); - return NULL; - } - - // Create the Operation object - Operation operation(operationName.c_str()); - - // Parameters are the fourth argument - PyObject* paramTuple = PyTuple_GetItem(args, 3); - - // Go through the supplied parameters - for(int i=0; i < PyTuple_Size(paramTuple); i++) - { - PyObject* param = PyTuple_GetItem(paramTuple, i); - - if(PyInt_Check(param)) - { - LOGINFO_2(3, "sca_invoke Param %d is int type: %d", i, PyInt_AsLong(param)); - long* intData = new long; - *intData = PyInt_AsLong(param); - operation.addParameter(intData); - } - else if(PyBool_Check(param)) - { - LOGINFO_2(3, "sca_invoke Param %d is bool type: %d", i, (param == Py_True)); - bool* boolData = new bool; - *boolData = (param == Py_True); - operation.addParameter(boolData); - } - else if(PyLong_Check(param)) - { - LOGINFO_2(3, "sca_invoke Param %d is long type: %l", i, PyLong_AsLong(param)); - long* longData = new long; - *longData = PyLong_AsLong(param); - operation.addParameter(longData); - } - else if(PyFloat_Check(param)) - { - LOGINFO_2(3, "sca_invoke Param %d is float type: %f", i, PyFloat_AsDouble(param)); - double* doubleData = new double; - *doubleData = PyFloat_AsDouble(param); - operation.addParameter(doubleData); - } - else if(PyString_Check(param)) - { - LOGINFO_2(3, "sca_invoke %d is string type: %s", i, PyString_AsString(param)); - const char** stringData = new const char*; - *stringData = PyString_AsString(param); - operation.addParameter(stringData); - } - else - { - PyObject* paramRepr = PyObject_Repr(param); - PyObject* paramType = PyObject_Type(param); - PyObject* paramTypeRepr = PyObject_Repr(paramType); - - string msg = "sca_invoke Param "; - msg += i; - msg += "is of unknown type ("; - msg += PyString_AsString(paramTypeRepr); - msg += ") and has repr: "; - msg += PyString_AsString(paramRepr); - - LOGERROR(1, msg.c_str()); - PyErr_SetString(scaError, msg.c_str()); - - Py_DECREF(paramTypeRepr); - Py_DECREF(paramType); - Py_DECREF(paramRepr); - - return NULL; - } - } - - PyObject* returnValue = NULL; - - try - { - // Invoke the wired service - pythonServiceProxy->invokeService(operation); - } - catch(...) - { - string msg = "sca_invoke Exception thrown whilst invoking the service"; - LOGERROR(1, msg.c_str()); - PyErr_SetString(scaError, msg.c_str()); - return NULL; - } - - - switch(operation.getReturnType()) - { - case Operation::BOOL: - { - if(*(bool*)operation.getReturnValue()) - { - returnValue = Py_True; - } - else - { - returnValue = Py_False; - } - break; - } - case Operation::SHORT: - { - returnValue = PyInt_FromLong(*(short*)operation.getReturnValue()); - break; - } - case Operation::LONG: - { - returnValue = PyLong_FromLong(*(long*)operation.getReturnValue()); - break; - } - case Operation::USHORT: - { - returnValue = PyInt_FromLong(*(unsigned short*)operation.getReturnValue()); - break; - } - case Operation::ULONG: - { - returnValue = PyLong_FromLong(*(unsigned long*)operation.getReturnValue()); - break; - } - case Operation::FLOAT: - { - returnValue = PyFloat_FromDouble(*(float*)operation.getReturnValue()); - break; - } - case Operation::DOUBLE: - { - returnValue = PyFloat_FromDouble(*(double*)operation.getReturnValue()); - break; - } - case Operation::LONGDOUBLE: - { - returnValue = PyFloat_FromDouble(*(long double*)operation.getReturnValue()); - break; - } - case Operation::CHARS: - { - returnValue = PyString_FromString(*(char**)operation.getReturnValue()); - break; - } - case Operation::STRING: - { - returnValue = PyString_FromString((*(string*)operation.getReturnValue()).c_str()); - break; - } - default: - { - Py_INCREF(Py_None); - returnValue = Py_None; - } - - } - - LOGEXIT(1, "sca_invoke"); - return returnValue; -} -static PyMethodDef ModuleMethods[] = -{ - {"locateservice", sca_locateservice, METH_VARARGS, "Locates an SCA service & returns an sca_proxy_class instance"}, - {"invoke", sca_invoke, METH_VARARGS, "Invoke an operation on an SCA service or reference"}, - {NULL, NULL, 0, NULL} /* Sentinel */ -}; - -PyMODINIT_FUNC initsca(void) -{ - LOGENTRY(1, "initsca"); - - // Create a new module - PyObject* module = Py_InitModule("sca", ModuleMethods); - - scaError = PyErr_NewException("sca.error", NULL, NULL); - Py_INCREF(scaError); - PyModule_AddObject(module, "error", scaError); - - LOGEXIT(1, "initsca"); -} diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/sca_proxy.py b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/sca_proxy.py deleted file mode 100644 index 1846bf994d..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/sca_proxy.py +++ /dev/null @@ -1,56 +0,0 @@ -# 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. -# -# -# -# -# This Python code is used in the SCA package and -# provides the proxy objects to a Python SCA component or SCA -# client. -# -# This is done by overloading the __getattr__ method which makes -# calls to myProxy.anyMethod go to __getattr__ which will return -# the invokeFunction defined inside the invoke method - -import sca - -class sca_proxy_class: - - sca_proxy_name = '' - sca_proxy_is_reference = 1 - - def __init__(self, name, isReference): - self.sca_proxy_name = name - self.sca_proxy_is_reference = isReference - return - - def invoke(self, operationName): - - def invokeFunction(*args,**kwargs): - return sca.invoke(self.sca_proxy_name, self.sca_proxy_is_reference, operationName, args) - - return invokeFunction - - def __getattr__(self, operationName): - return self.invoke(operationName) - - def __str__(self): - return '' - - def __repr__(self): - return '' - diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/sca_setup.py b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/sca_setup.py deleted file mode 100644 index 9363d5533f..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/src/tuscany/sca/python/sca_setup.py +++ /dev/null @@ -1,60 +0,0 @@ -# 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. -# -# -# -# -# This Python code builds and/or installs the sca and -# sca_proxy extension modules -# -# Build/install with the following comands: -# python scaSetup.py build -# python scaSetup.py install -# -# - -from distutils.core import setup, Extension, os - -TUSCANY_SCACPP = os.environ.get("TUSCANY_SCACPP") -print 'Using TUSCANY_SCACPP at ' + TUSCANY_SCACPP - -TUSCANY_SDOCPP = os.environ.get("TUSCANY_SDOCPP") -print 'Using TUSCANY_SDOCPP at ' + TUSCANY_SDOCPP - -macros = [] -if os.name == 'nt': - macros = [ ('WIN32',None) ] - -module1 = Extension('sca', - define_macros = macros, - sources = ['sca_module.cpp'], - include_dirs = [ TUSCANY_SCACPP + '/include', - TUSCANY_SCACPP + '/extensions/python/include', - TUSCANY_SDOCPP + '/include'], - libraries = ['tuscany_sca', - 'tuscany_sdo', - 'tuscany_sca_python'], - library_dirs = [ TUSCANY_SCACPP + '/lib', - TUSCANY_SCACPP + '/extensions/python/lib', - TUSCANY_SDOCPP + '/lib']) - -setup (name = 'sca', - version = '1.0', - description = 'The Tuscany SCA package', - url='http://incubator.apache.org/tuscany/', - ext_modules = [module1], - py_modules = ['sca_proxy']) diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/xsd/sca-implementation-python.xsd b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/xsd/sca-implementation-python.xsd deleted file mode 100644 index e1c7247992..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/xsd/sca-implementation-python.xsd +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/xsd/sca-interface-python.xsd b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/xsd/sca-interface-python.xsd deleted file mode 100644 index dd9075c7fb..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/python/xsd/sca-interface-python.xsd +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/Makefile.am b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/Makefile.am deleted file mode 100644 index ac176d8811..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/Makefile.am +++ /dev/null @@ -1,24 +0,0 @@ -# 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. - -SUBDIRS = src - -datadir=$(prefix)/extensions/ruby - -nobase_data_DATA = xsd/*.xsd - -EXTRA_DIST = xsd \ No newline at end of file diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/deploy.bat b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/deploy.bat deleted file mode 100644 index e53a8780cf..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/deploy.bat +++ /dev/null @@ -1,64 +0,0 @@ -@echo off - -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. - - -setlocal - -if . == .%1 ( -echo sca root not specified -goto usage -) -set rootdir=%1 -set deploydir=%rootdir%\deploy -set extdir=%deploydir%\extensions -set rubyextdir=%extdir%\ruby -set srcdir=%rootdir%\runtime\extensions\ruby\src - -if . == .%2 ( -echo input directory not specified -goto usage -) -set inpath=%2 -echo %inpath% - - -if not exist %deploydir% mkdir %deploydir% -if not exist %extdir% mkdir %extdir% -if not exist %rubyextdir% mkdir %rubyextdir% -if not exist %rubyextdir%\bin mkdir %rubyextdir%\bin -if not exist %rubyextdir%\lib mkdir %rubyextdir%\lib -if not exist %rubyextdir%\xsd mkdir %rubyextdir%\xsd - -del %rubyextdir%\bin\tuscany_sca_ruby.* -del %rubyextdir%\lib\*.lib - -copy %srcdir%\deploy.cmd %rubyextdir% -copy %srcdir%\..\xsd\*.* %rubyextdir%\xsd - -copy %inpath%\tuscany_sca_ruby.lib %rubyextdir%\lib -copy %inpath%\tuscany_sca_ruby.dll %rubyextdir%\bin\tuscany_sca_ruby.dll.disabled - -if exist %inpath%\tuscany_sca_ruby.pdb copy %inpath%\tuscany_sca_ruby.pdb %rubyextdir%\bin - -goto end -:usage -echo Usage: deploy -:end - -endlocal diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/Makefile.am b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/Makefile.am deleted file mode 100644 index d73ac1f90c..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/Makefile.am +++ /dev/null @@ -1,54 +0,0 @@ -# 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/ruby/lib -lib_LTLIBRARIES = libtuscany_sca_ruby.la - -install-exec-hook: - cd $(libdir); \ - ln -s -f libtuscany_sca_ruby.so tuscany_sca_ruby.so; \ - for i in libtuscany_sca_ruby.*; do mv $$i $$i.disabled; done - -rootdir=$(prefix)/extensions/ruby -root_SCRIPTS = deploy.sh - -noinst_HEADERS = \ -tuscany/sca/ruby/*.h \ -tuscany/sca/ruby/model/*.h - -EXTRA_DIST = deploy.sh - -libtuscany_sca_ruby_la_SOURCES = \ -tuscany/sca/ruby/RubyExtension.cpp \ -tuscany/sca/ruby/RubyImplementationExtension.cpp \ -tuscany/sca/ruby/RubyServiceProxy.cpp \ -tuscany/sca/ruby/RubyServiceWrapper.cpp \ -tuscany/sca/ruby/model/RubyImplementation.cpp \ -tuscany/sca/ruby/model/RubyReferenceBinding.cpp \ -tuscany/sca/ruby/model/RubyServiceBinding.cpp \ -tuscany/sca/ruby/RubyCompositeContext.cpp - -libtuscany_sca_ruby_la_LIBADD = -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo \ - -L$(top_builddir)/runtime/core/src -ltuscany_sca \ - -L${RUBY_LIB} -lruby - -INCLUDES = -Imodel -I$(top_builddir)/runtime/core/src \ - -I${TUSCANY_SDOCPP}/include \ - -I${RUBY_INCLUDE} - -AM_CPPFLAGS = $(CPPFLAGS) -D_DEBUG - \ No newline at end of file diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/deploy.cmd b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/deploy.cmd deleted file mode 100644 index 5baf8289e3..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/deploy.cmd +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. - - -setlocal -set currentPath=%~d0%~p0 - -echo Enabling the Tuscany Ruby extension -rename %currentPath%\bin\tuscany_sca_ruby.dll.disabled tuscany_sca_ruby.dll - -:end -echo Done -endlocal diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/deploy.sh b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/deploy.sh deleted file mode 100755 index 492b1b09d1..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/deploy.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -# 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. - -APFULLDIR=`pwd` - -echo "Enabling the Tuscany Ruby extension" - -for i in lib/*.disabled; do x=${i%.disabled}; mv $i $x; done - -echo "Done" diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/Ruby.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/Ruby.h deleted file mode 100644 index a6b8ee8ffa..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/Ruby.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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_ruby_ruby_h -#define tuscany_sca_ruby_ruby_h - -// Ruby inists on MS VC6 ... we'll see about that! -#if defined(WIN32) || defined (_WINDOWS) -#define _REAL_MSC_VER _MSC_VER -#undef _MSC_VER -#define _MSC_VER 1200 -#endif - -#include - -#if defined(WIN32) || defined (_WINDOWS) -#undef _MSC_VER -#define _MSC_VER _REAL_MSC_VER -#endif - -#endif // tuscany_sca_ruby_ruby_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyCompositeContext.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyCompositeContext.cpp deleted file mode 100644 index 148bccc025..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyCompositeContext.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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/SCARuntime.h" -#include "tuscany/sca/model/Service.h" -#include "tuscany/sca/model/ServiceType.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/ComponentType.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/ruby/RubyServiceProxy.h" - -using namespace tuscany::sca::ruby; - -extern "C" -{ - - // Implement the Sca::locateService module function - SCA_RUBY_API VALUE tuscany_sca_ruby_locateService(VALUE module, VALUE value) - { - - // Get the default component - Component* defaultComponent = tuscany::sca::SCARuntime::getInstance()->getDefaultComponent(); - Composite* composite = (Composite*)defaultComponent->getType(); - - // Locate the service - const char* serviceName = rb_string_value_cstr(&value); - Service* service = composite->findComponentService(serviceName); - string msg; - if (!service) - { - string msg = "Service not found: "; - msg = msg + serviceName; - rb_raise(rb_eRuntimeError, msg.c_str()); - } - - // Get a Proxy for this service - RubyServiceProxy* serviceProxy = new RubyServiceProxy(service); - - // Return the Ruby proxy value object - return serviceProxy->getProxyValue(); - } - - // Initialize the Ruby extension - SCA_RUBY_API void Init_tuscany_sca_ruby() - { - - // Define the Sca::locateService() function - VALUE module = rb_define_module("SCA"); - rb_define_module_function(module, "locateService", (VALUE(*)(ANYARGS))tuscany_sca_ruby_locateService, 1); - - } - - SCA_RUBY_API void Init_libtuscany_sca_ruby() - { - Init_tuscany_sca_ruby(); - } -} diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyExtension.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyExtension.cpp deleted file mode 100644 index 7153ef4fb1..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyExtension.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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/ruby/RubyExtension.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/core/SCARuntime.h" -#include "tuscany/sca/ruby/RubyImplementationExtension.h" - - -extern "C" -{ - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - void tuscany_sca_extension_initialize() - { - tuscany::sca::ruby::RubyExtension::initialize(); - } -} - -namespace tuscany -{ - namespace sca - { - namespace ruby - { - // =================================================================== - // Constructor for the RubyExtension class. - // =================================================================== - RubyExtension::RubyExtension() - { - LOGENTRY(1, "RubyExtension::constructor"); - LOGEXIT(1, "RubyExtension::constructor"); - } - - // =================================================================== - // Destructor for the RubyExtension class. - // =================================================================== - RubyExtension::~RubyExtension() - { - LOGENTRY(1, "RubyExtension::destructor");; - LOGEXIT(1, "RubyExtension::destructor"); - } - - void RubyExtension::initialize() - { - LOGENTRY(1, "RubyExtension::initialize");; - SCARuntime::getInstance()->registerImplementationExtension(new RubyImplementationExtension()); - LOGEXIT(1, "RubyExtension::initialize");; - } - - } // End namespace ruby - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyExtension.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyExtension.h deleted file mode 100644 index 232431ca1e..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyExtension.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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_ruby_rubyextension_h -#define tuscany_sca_ruby_rubyextension_h - -namespace tuscany -{ - namespace sca - { - namespace ruby - { - - class RubyExtension - { - public: - /** - * Default constructor - */ - RubyExtension(); - - /** - * Destructor - */ - virtual ~RubyExtension(); - - static void initialize(); - - private: - - }; - - - } // End namespace ruby - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_ruby_rubyextension_h - diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyImplementationExtension.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyImplementationExtension.cpp deleted file mode 100644 index 2bc5f9d0d9..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyImplementationExtension.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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/ruby/RubyImplementationExtension.h" -#include "tuscany/sca/ruby/model/RubyImplementation.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/util/Utils.h" - - -namespace tuscany -{ - namespace sca - { - namespace ruby - { - // =================================================================== - // Constructor for the RubyImplementationExtension class. - // =================================================================== - RubyImplementationExtension::RubyImplementationExtension() - { - LOGENTRY(1, "RubyImplementationExtension::constructor"); - LOGEXIT(1, "RubyImplementationExtension::constructor"); - } - - // =================================================================== - // Destructor for the RubyImplementationExtension class. - // =================================================================== - RubyImplementationExtension::~RubyImplementationExtension() - { - LOGENTRY(1, "RubyImplementationExtension::destructor");; - LOGEXIT(1, "RubyImplementationExtension::destructor"); - } - - const string RubyImplementationExtension::extensionName("ruby"); - const string RubyImplementationExtension::typeQName("http://www.osoa.org/xmlns/sca/1.0#RubyImplementation"); - - // =================================================================== - // loadModelElement - load the info from implementation.ruby - // =================================================================== - ComponentType* RubyImplementationExtension::getImplementation(Composite *composite, DataObjectPtr scdlImplementation) - { - string implType = scdlImplementation->getType().getName(); - if (implType == "RubyImplementation") - { - string module = scdlImplementation->getCString("module"); - string className = scdlImplementation->getCString("class"); - string script = scdlImplementation->getCString("script"); - - RubyImplementation* rubyImpl = new RubyImplementation(composite, module, className, script); - - return rubyImpl; - } - else - { - return NULL; - } - } - - } // End namespace ruby - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyImplementationExtension.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyImplementationExtension.h deleted file mode 100644 index a1c5f26a3e..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyImplementationExtension.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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_ruby_rubyimplementationextension_h -#define tuscany_sca_ruby_rubyimplementationextension_h - -#include "tuscany/sca/extension/ImplementationExtension.h" - -namespace tuscany -{ - namespace sca - { - namespace ruby - { - - class RubyImplementationExtension : public ImplementationExtension - { - public: - /** - * Default constructor - */ - RubyImplementationExtension(); - - /** - * Destructor - */ - virtual ~RubyImplementationExtension(); - - /** - * return the name of the extension - */ - virtual const string& getExtensionName() {return extensionName;} - - /** - * return the QName of schema elemant for this implementation extension - * (e.g. "http://www.osoa.org/xmlns/sca/1.0#implementation.ruby") - */ - virtual const string& getExtensionTypeQName() {return typeQName;} - - virtual ComponentType* getImplementation(Composite* composite, DataObjectPtr scdlImplementation); - - private: - static const string extensionName; - static const string typeQName; - - }; - - - } // End namespace ruby - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_ruby_rubyimplementationextension_h - diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.cpp deleted file mode 100644 index 228f1f8940..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.cpp +++ /dev/null @@ -1,374 +0,0 @@ -/* - * 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/ruby/RubyServiceProxy.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/core/SCARuntime.h" -#include "tuscany/sca/util/Exceptions.h" -#include "tuscany/sca/model/Reference.h" -#include "tuscany/sca/model/ReferenceType.h" -#include "tuscany/sca/model/Service.h" -#include "tuscany/sca/model/ServiceType.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/ComponentType.h" -#include "tuscany/sca/core/ServiceWrapper.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/ServiceBinding.h" -#include "tuscany/sca/ruby/model/RubyImplementation.h" -#include "tuscany/sca/ruby/model/RubyReferenceBinding.h" - -extern "C" -{ - - // Initialize a Ruby proxy - SCA_RUBY_API VALUE tuscany_sca_ruby_proxy_initialize(VALUE self, VALUE serviceProxy) - { - rb_iv_set(self, "@cppProxy", serviceProxy); - return self; - } - - // Handle a method_missing message and dispatch to - // our C++ proxy - SCA_RUBY_API VALUE tuscany_sca_ruby_proxy_method_missing(int argc, VALUE* argv, VALUE self) - { - VALUE proxy = rb_iv_get(self, "@cppProxy"); - - // Get the target service wrapper - tuscany::sca::ruby::RubyServiceProxy *serviceProxy; - Data_Get_Struct(proxy, tuscany::sca::ruby::RubyServiceProxy, serviceProxy); - - // Handle the invocation - return serviceProxy->invoke(argc, argv); - - } - -} - -namespace tuscany -{ - namespace sca - { - namespace ruby - { - - VALUE RubyServiceProxy::proxyClass = Qnil; - - // ============================ - // Constructor: Create a proxy - // ============================ - RubyServiceProxy::RubyServiceProxy(Reference* reference) - : ServiceProxy(reference) - { - LOGENTRY(1,"RubyServiceProxy::constructor"); - - // ---------------------- - // Get the component - // ---------------------- - component = reference->getComponent(); - string name = reference->getType()->getName(); - - // Get the service wrapper - RubyReferenceBinding* referenceBinding = (RubyReferenceBinding*)reference->getBinding(); - - serviceWrapper = referenceBinding->getTargetServiceBinding()->getServiceWrapper(); - - // Create the Ruby proxy - createProxy(); - - LOGEXIT(1,"RubyServiceProxy::constructor"); - } - - // ============================ - // Constructor: Create a proxy - // ============================ - RubyServiceProxy::RubyServiceProxy(Service* service) - : ServiceProxy(0) - { - LOGENTRY(1,"RubyServiceProxy::constructor"); - - // ---------------------- - // Get the component - // ---------------------- - component = service->getComponent(); - string name = service->getType()->getName(); - - // Get the service wrapper - serviceWrapper = service->getBinding()->getServiceWrapper(); - - // Create the Ruby proxy - createProxy(); - - LOGEXIT(1,"RubyServiceProxy::constructor"); - } - - // ========== - // Destructor - // ========== - RubyServiceProxy::~RubyServiceProxy() - { - LOGENTRY(1,"RubyServiceProxy::destructor"); - LOGEXIT(1,"RubyServiceProxy::destructor"); - } - - void RubyServiceProxy::createProxy() - { - // Create the Ruby proxy class - if (RubyServiceProxy::proxyClass == Qnil) - { - VALUE module = rb_define_module("Tuscany"); - proxyClass = rb_define_class_under(module, "ServiceProxy", rb_cObject); - rb_define_method(proxyClass, "initialize", (VALUE(*)(ANYARGS))tuscany_sca_ruby_proxy_initialize, 1); - rb_define_method(proxyClass, "method_missing", (VALUE(*)(ANYARGS))tuscany_sca_ruby_proxy_method_missing, -1); - } - - // Create the Ruby proxy instance, pass the service wrapper to it - VALUE* args = new VALUE[1]; - args[0] = Data_Wrap_Struct(rb_cObject, NULL, NULL, this); - proxyValue = rb_class_new_instance(1, args, proxyClass); - - // Mark proxyValue busy so that it doesn't get GC'ed by Ruby - rb_gc_register_address(&proxyValue); - } - - - VALUE RubyServiceProxy::invoke(int argc, VALUE* argv) - { - // Get the method name - char* methodName = rb_id2name(SYM2ID(argv[0])); - - // Get the block passed by the caller - VALUE block =rb_block_given_p() ? rb_block_proc() : Qnil; - - // Create new Operation object - Operation operation(methodName); - - // Convert the Ruby parameters to C++ - for (int i = 1; i < argc; i++) - { - VALUE value = argv[i]; - - int valueType = TYPE(value); - - switch (valueType) - { - case T_FLOAT: - { - float* data = new float; - *data = rb_num2dbl(value); - operation.addParameter(data); - break; - } - case T_STRING: - { - string* data = new string(rb_string_value_cstr(&value)); - const char** cdata = new const char*; - *cdata = data->c_str(); - operation.addParameter(cdata); - break; - } - case T_FIXNUM: - { - long* data = new long; - *data = rb_num2long(value); - operation.addParameter(data); - break; - } - case T_BIGNUM: - { - long double* data = new long double; - *data = rb_num2dbl(value); - operation.addParameter(data); - break; - } - case T_TRUE: - { - bool* data = new bool; - *data = true; - operation.addParameter(data); - break; - } - case T_FALSE: - { - bool* data = new bool; - *data = false; - operation.addParameter(data); - break; - } - case T_OBJECT: - { - VALUE klass = rb_obj_class(value); - if (klass == RubyImplementation::getXMLDocumentClass()) - { - // Convert a REXML::Document to a DataObject - ID to_s = rb_intern("to_s"); - VALUE vstr = rb_funcall(value, to_s, 0); - string str = string(rb_string_value_cstr(&vstr)); - - Composite* composite = getReference()->getComponent()->getComposite(); - commonj::sdo::XMLHelper* xmlHelper = composite->getXMLHelper(); - commonj::sdo::XMLDocumentPtr xmlDoc = xmlHelper->load(str.c_str()); - - DataObjectPtr dob; - if (xmlDoc != NULL) - { - dob = xmlDoc->getRootDataObject(); - } - if (dob != NULL) - { - operation.addParameter(&dob); - } - else - { - string msg = "Document could not be converted to a DataObject"; - rb_raise(rb_eTypeError, msg.c_str()); - return Qnil; - } - } - else - { - string msg = "Ruby type not supported: " + valueType; - rb_raise(rb_eTypeError, msg.c_str()); - return Qnil; - } - break; - } - default:; - string msg = "Ruby type not supported: " + valueType; - rb_raise(rb_eTypeError, msg.c_str()); - return Qnil; - } - - } - - try - { - // Call into the target service wrapper - serviceWrapper->invoke(operation); - - // Convert the result to a Ruby value - VALUE value; - Operation::ParameterType resultType = operation.getReturnType(); - switch(resultType) - { - case Operation::BOOL: - { - if( *(bool*)operation.getReturnValue()) - { - //boolean true - value = rb_int2inum(1); - } - else - { - value = rb_int2inum(0); - } - break; - } - case Operation::SHORT: - { - value = rb_int2inum(*(short*)operation.getReturnValue()); - break; - } - case Operation::USHORT: - { - value = rb_uint2inum(*(unsigned short*)operation.getReturnValue()); - break; - } - case Operation::LONG: - { - value = rb_int2inum(*(long*)operation.getReturnValue()); - break; - } - case Operation::ULONG: - { - value = rb_uint2inum(*(unsigned long*)operation.getReturnValue()); - break; - } - case Operation::FLOAT: - { - value = rb_float_new(*(float*)operation.getReturnValue()); - break; - } - case Operation::DOUBLE: - { - value = rb_float_new(*(double*)operation.getReturnValue()); - break; - } - case Operation::LONGDOUBLE: - { - value = rb_float_new(*(long double*)operation.getReturnValue()); - break; - } - case Operation::CHARS: - { - value = rb_str_new2(*(char**)operation.getReturnValue()); - break; - } - case Operation::STRING: - { - value = rb_str_new2((*(string*)operation.getReturnValue()).c_str()); - break; - } - case Operation::DATAOBJECT: - { - DataObjectPtr dob = *(DataObjectPtr*)operation.getReturnValue(); - - // Convert a DataObject to a REXML Document object - Composite* composite = component->getComposite(); - commonj::sdo::XMLHelper* xmlHelper = composite->getXMLHelper(); - char* str = xmlHelper->save( - dob, - dob->getType().getURI(), - dob->getType().getName()); - VALUE vstr[1]; - vstr[0] = rb_str_new2(str); - - value = rb_class_new_instance(1, vstr, RubyImplementation::getXMLDocumentClass()); - break; - } - default: - { - //throw new ComponentInvocationException("Operation parameter type not supported"); - string msg = "Operation parameter type not supported" + resultType; - rb_raise(rb_eRuntimeError, msg.c_str()); - return Qnil; - } - } - - return value; - - } - catch(TuscanyRuntimeException &ex) - { - string msg = "Exception while invoking a service: "; - msg += ex.getEClassName(); - msg += ": "; - msg += ex.getMessageText(); - rb_raise(rb_eRuntimeError, msg.c_str()); - return Qnil; - } - - return Qnil; - } - - } // End namespace ruby - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.h deleted file mode 100644 index f4692733f1..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * 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_ruby_rubyserviceproxy_h -#define tuscany_sca_ruby_rubyserviceproxy_h - -#include "tuscany/sca/ruby/export.h" -#include "tuscany/sca/core/ServiceProxy.h" -#include "tuscany/sca/core/ServiceWrapper.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Reference.h" -#include "tuscany/sca/model/Service.h" - -using namespace tuscany::sca::model; - -#include "tuscany/sca/ruby/Ruby.h" - - -namespace tuscany -{ - namespace sca - { - namespace ruby - { - - /** - * 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 RubyServiceProxy : public ServiceProxy - { - public: - /** - * Create a new service proxy for a reference. The proxy will contain a pointer to - * the target ServiceWrapper. - * @param reference The reference on the source component. - * @param target The wrapper of the service which is wired to this reference. - */ - RubyServiceProxy(Reference* reference); - - /** - * Create a new service proxy for a service. The proxy will contain a pointer to - * the target ServiceWrapper. - * @param reference The service on the target component. - * @param target The wrapper of the target service. - */ - RubyServiceProxy(Service* service); - - /** - * Destructor. - */ - virtual ~RubyServiceProxy(); - - /** - * Returns the Ruby value of the proxy - */ - VALUE getProxyValue() const { return proxyValue; }; - - /** - * Handles the invocation of a Ruby method. - */ - VALUE invoke(int argc, VALUE* argv); - - private: - - /** - * Create the Ruby proxy object - */ - void createProxy(); - - /** - * The target service wrapper - */ - ServiceWrapper* serviceWrapper; - - /** - * The Ruby value of the proxy - */ - VALUE proxyValue; - - /** - * The component owning the proxy - */ - Component* component; - - /** - * The Ruby proxy class - */ - static VALUE proxyClass; - - }; - - } // End namespace ruby - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_ruby_rubyserviceproxy_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.cpp deleted file mode 100644 index a0eb97142d..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.cpp +++ /dev/null @@ -1,724 +0,0 @@ -/* - * 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/ruby/RubyServiceWrapper.h" - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/util/Library.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/Service.h" -#include "tuscany/sca/model/ServiceType.h" -#include "tuscany/sca/model/Reference.h" -#include "tuscany/sca/model/ReferenceType.h" -#include "tuscany/sca/core/SCARuntime.h" -#include "tuscany/sca/ruby/model/RubyImplementation.h" -#include "tuscany/sca/ruby/model/RubyServiceBinding.h" -#include "tuscany/sca/ruby/RubyServiceProxy.h" -#include "commonj/sdo/SDO.h" - -using commonj::sdo::PropertyList; - -namespace tuscany -{ - namespace sca - { - namespace ruby - { - - // =========== - // Constructor - // =========== - RubyServiceWrapper::RubyServiceWrapper(Service* service) - : ServiceWrapper(service) - { - LOGENTRY(1,"RubyServiceWrapper::constructor"); - - component = service->getComponent(); - implementation = (RubyImplementation*)component->getType(); - interf = service->getType()->getInterface(); - - LOGEXIT(1,"RubyServiceWrapper::constructor"); - - } - - // ========== - // Destructor - // ========== - RubyServiceWrapper::~RubyServiceWrapper() - { - LOGENTRY(1,"RubyServiceWrapper::destructor"); - LOGEXIT(1,"RubyServiceWrapper::destructor"); - } - - // ====================================================================== - // invoke: wrapper call to service with setting the component context - // ====================================================================== - void RubyServiceWrapper::invoke(Operation& operation) - { - LOGENTRY(1,"RubyServiceWrapper::invoke"); - - SCARuntime* runtime = SCARuntime::getInstance(); - runtime->setCurrentComponent(component); - - try - { - - // Create a new instance of the Ruby implementation class - VALUE instance = rb_class_new_instance(0, NULL, implementation->getImplementationClass()); - - // Set all the references - const Component::REFERENCE_MAP& references = component->getReferences(); - Component::REFERENCE_MAP::const_iterator refiter = references.begin(); - for (int ri=0; ri< references.size(); ri++) - { - Reference* reference = refiter->second; - RubyServiceProxy* proxy = (RubyServiceProxy*)reference->getBinding()->getServiceProxy(); - if (proxy != NULL) - { - VALUE proxyValue = proxy->getProxyValue(); - string varName = "@" + refiter->first; - rb_iv_set(instance, varName.c_str(), proxyValue); - } - refiter++; - } - - // Set all the configured properties - DataObjectPtr properties = component->getProperties(); - PropertyList pl = properties->getInstanceProperties(); - for (int i = 0; i < pl.size(); i++) - { - if (properties->isSet(pl[i])) - { - string varName = "@"; - varName += pl[i].getName(); - string cstr = properties->getCString(pl[i]); - VALUE propertyValue; - if (cstr == "true") - { - propertyValue = Qtrue; - } - else if (cstr == "false") - { - propertyValue = Qfalse; - } - else - { - //TODO use one of the rb_str_to_inum() functions - // to convert a numeric value to a Ruby numeric - propertyValue = rb_str_new2(cstr.c_str()); - } - rb_iv_set(instance, varName.c_str(), propertyValue); - } - } - - // Get the ID of the specified method - ID method = rb_intern(operation.getName().c_str()); - - // Convert C++ parameters to Ruby parameters - VALUE *args = NULL; - int n = operation.getNParms(); - if (n != 0) - { - args=new VALUE[n]; - - for(int i = 0; i < operation.getNParms(); i++) - { - VALUE value; - - const Operation::Parameter& parm = operation.getParameter(i); - Operation::ParameterType parmType = parm.getType(); - switch(parmType) - { - case Operation::BOOL: - { - if( *(bool*)parm.getValue()) - { - //boolean true - value = rb_int2inum(1); - } - else - { - value = rb_int2inum(0); - } - break; - } - case Operation::SHORT: - { - value = rb_int2inum(*(short*)parm.getValue()); - break; - } - case Operation::USHORT: - { - value = rb_uint2inum(*(unsigned short*)parm.getValue()); - break; - } - case Operation::LONG: - { - value = rb_int2inum(*(long*)parm.getValue()); - break; - } - case Operation::ULONG: - { - value = rb_uint2inum(*(unsigned long*)parm.getValue()); - break; - } - case Operation::FLOAT: - { - value = rb_float_new(*(float*)parm.getValue()); - break; - } - case Operation::DOUBLE: - { - value = rb_float_new(*(double*)parm.getValue()); - break; - } - case Operation::LONGDOUBLE: - { - value = rb_float_new(*(long double*)parm.getValue()); - break; - } - case Operation::CHARS: - { - value = rb_str_new2(*(char**)parm.getValue()); - break; - } - case Operation::STRING: - { - value = rb_str_new2((*(string*)parm.getValue()).c_str()); - break; - } - case Operation::DATAOBJECT: - { - DataObjectPtr dob = *(DataObjectPtr*)parm.getValue(); - - // Convert a DataObject to a REXML Document object - Composite* composite = component->getComposite(); - commonj::sdo::XMLHelper* xmlHelper = composite->getXMLHelper(); - char* str = xmlHelper->save( - dob, - dob->getType().getURI(), - dob->getType().getName()); - VALUE vstr[1]; - vstr[0] = rb_str_new2(str); - - value = rb_class_new_instance(1, vstr, RubyImplementation::getXMLDocumentClass()); - break; - } - default: - { - //throw new ComponentInvocationException("Operation parameter type not supported"); - string msg = "Operation parameter type not supported" + parmType; - throw msg.c_str(); - } - } - - args[i] = value; - } - } - - - // Invoke the specified method - VALUE result; - if (n == 0) - { - result = rb_funcall(instance, method, 0); - } - else - { - result = rb_funcall2(instance, method, n, args); - } - - // Convert the Ruby result value to a C++ result - int resultType = TYPE(result); - char buf[20]; - switch(resultType) - { - case T_FLOAT: - { - float* data = new float; - *data = rb_num2dbl(result); - - // Check if the return type has already been set for typed languages - switch(operation.getReturnType()) - { - case Operation::BOOL: - { - *(bool*)operation.getReturnValue() = (*data != 0.0); - break; - } - case Operation::SHORT: - { - *(short*)operation.getReturnValue() = (short)*data; - break; - } - case Operation::USHORT: - { - *(unsigned short*)operation.getReturnValue() = (unsigned short)*data; - break; - } - case Operation::INT: - { - *(int*)operation.getReturnValue() = (int)*data; - break; - } - case Operation::UINT: - { - *(unsigned int*)operation.getReturnValue() = (unsigned int)*data; - break; - } - case Operation::LONG: - { - *(long*)operation.getReturnValue() = (long)*data; - break; - } - case Operation::ULONG: - { - *(unsigned long*)operation.getReturnValue() = (unsigned long)*data; - break; - } - case Operation::FLOAT: - { - *(float*)operation.getReturnValue() = (float)*data; - break; - } - case Operation::DOUBLE: - { - *(double*)operation.getReturnValue() = (double)*data; - break; - } - case Operation::LONGDOUBLE: - { - *(long double*)operation.getReturnValue() = (long double)*data; - break; - } - case Operation::CHARS: - { - sprintf(buf, "%f", *data); - *(char**)operation.getReturnValue() = buf; - break; - } - case Operation::STRING: - { - sprintf(buf, "%f", *data); - *(string*)operation.getReturnValue() = buf; - break; - } - default: - { - // The type is set as something else or has not been set - operation.setReturnValue(data); - } - } - break; - } - case T_STRING: - { - string* stringdata = new string(rb_string_value_cstr(&result)); - const char** data = new const char*; - *data = stringdata->c_str(); - - // Check if the return type has already been set (for typed languages) - switch(operation.getReturnType()) - { - case Operation::BOOL: - { - // If the string is empty or "0" or "false" set to false, otherwise true - if(strlen(*data) == 0 || strcmp(*data, "0") == 0 || strcmp(*data, "false") == 0) - { - *(bool*)operation.getReturnValue() = false; - } - else - { - *(bool*)operation.getReturnValue() = true; - } - break; - } - case Operation::SHORT: - { - *(short*)operation.getReturnValue() = (short)atoi(*data); - break; - } - case Operation::USHORT: - { - *(unsigned short*)operation.getReturnValue() = (unsigned short)atoi(*data); - break; - } - case Operation::INT: - { - *(int*)operation.getReturnValue() = (int)atoi(*data); - break; - } - case Operation::UINT: - { - *(unsigned int*)operation.getReturnValue() = (unsigned int)atoi(*data); - break; - } - case Operation::LONG: - { - *(long*)operation.getReturnValue() = (long)atol(*data); - break; - } - case Operation::ULONG: - { - *(unsigned long*)operation.getReturnValue() = (unsigned long)atol(*data); - break; - } - case Operation::FLOAT: - { - *(float*)operation.getReturnValue() = (float)atof(*data); - break; - } - case Operation::DOUBLE: - { - *(double*)operation.getReturnValue() = (double)atof(*data); - break; - } - case Operation::LONGDOUBLE: - { - *(long double*)operation.getReturnValue() = (long double)atof(*data); - break; - } - case Operation::CHARS: - { - *(const char**)operation.getReturnValue() = *data; - break; - } - case Operation::STRING: - { - *(string*)operation.getReturnValue() = *data; - break; - } - default: - { - // The type is set as something else or has not been set - operation.setReturnValue(data); - } - } - break; - } - case T_FIXNUM: - { - long* data = new long; - *data = rb_num2long(result); - - // Check if the return type has already been (set for typed languages) - switch(operation.getReturnType()) - { - case Operation::BOOL: - { - *(bool*)operation.getReturnValue() = (*data != 0); - break; - } - case Operation::SHORT: - { - *(short*)operation.getReturnValue() = (short)*data; - break; - } - case Operation::USHORT: - { - *(unsigned short*)operation.getReturnValue() = (unsigned short)*data; - break; - } - case Operation::INT: - { - *(int*)operation.getReturnValue() = (int)*data; - break; - } - case Operation::UINT: - { - *(unsigned int*)operation.getReturnValue() = (unsigned int)*data; - break; - } - case Operation::LONG: - { - *(long*)operation.getReturnValue() = (long)*data; - break; - } - case Operation::ULONG: - { - *(unsigned long*)operation.getReturnValue() = (unsigned long)*data; - break; - } - case Operation::FLOAT: - { - *(float*)operation.getReturnValue() = (float)*data; - break; - } - case Operation::DOUBLE: - { - *(double*)operation.getReturnValue() = (double)*data; - break; - } - case Operation::LONGDOUBLE: - { - *(long double*)operation.getReturnValue() = (long double)*data; - break; - } - case Operation::CHARS: - { - sprintf(buf, "%d", *data); - *(char**)operation.getReturnValue() = buf; - break; - } - case Operation::STRING: - { - sprintf(buf, "%d", *data); - *(string*)operation.getReturnValue() = buf; - break; - } - default: - { - // The type is set as something else or has not been set - operation.setReturnValue(data); - } - } - - break; - } - case T_BIGNUM: - { - long double* data = new long double; - *data = rb_num2dbl(result); - - // Check if the return type has already been set (for typed languages) - switch(operation.getReturnType()) - { - case Operation::BOOL: - { - *(bool*)operation.getReturnValue() = (*data != 0.0); - break; - } - case Operation::SHORT: - { - *(short*)operation.getReturnValue() = (short)*data; - break; - } - case Operation::USHORT: - { - *(unsigned short*)operation.getReturnValue() = (unsigned short)*data; - break; - } - case Operation::INT: - { - *(int*)operation.getReturnValue() = (int)*data; - break; - } - case Operation::UINT: - { - *(unsigned int*)operation.getReturnValue() = (unsigned int)*data; - break; - } - case Operation::LONG: - { - *(long*)operation.getReturnValue() = (long)*data; - break; - } - case Operation::ULONG: - { - *(unsigned long*)operation.getReturnValue() = (unsigned long)*data; - break; - } - case Operation::FLOAT: - { - *(float*)operation.getReturnValue() = (float)*data; - break; - } - case Operation::DOUBLE: - { - *(double*)operation.getReturnValue() = (double)*data; - break; - } - case Operation::LONGDOUBLE: - { - *(long double*)operation.getReturnValue() = (long double)*data; - break; - } - case Operation::CHARS: - { - sprintf(buf, "%f", *data); - *(char**)operation.getReturnValue() = buf; - break; - } - case Operation::STRING: - { - sprintf(buf, "%f", *data); - *(string*)operation.getReturnValue() = buf; - break; - } - default: - { - // The type is set as something else or has not been set - operation.setReturnValue(data); - } - } - break; - } - case T_TRUE: - case T_FALSE: - { - bool* data = new bool; - *data = (resultType == T_TRUE); - // Check if the return type has already been set (for typed languages) - switch(operation.getReturnType()) - { - case Operation::BOOL: - { - *(bool*)operation.getReturnValue() = *data; - break; - } - case Operation::SHORT: - { - *(short*)operation.getReturnValue() = (short)*data; - break; - } - case Operation::USHORT: - { - *(unsigned short*)operation.getReturnValue() = (unsigned short)*data; - break; - } - case Operation::INT: - { - *(int*)operation.getReturnValue() = (int)*data; - break; - } - case Operation::UINT: - { - *(unsigned int*)operation.getReturnValue() = (unsigned int)*data; - break; - } - case Operation::LONG: - { - *(long*)operation.getReturnValue() = (long)*data; - break; - } - case Operation::ULONG: - { - *(unsigned long*)operation.getReturnValue() = (unsigned long)*data; - break; - } - case Operation::FLOAT: - { - *(float*)operation.getReturnValue() = (float)*data; - break; - } - case Operation::DOUBLE: - { - *(double*)operation.getReturnValue() = (double)*data; - break; - } - case Operation::LONGDOUBLE: - { - *(long double*)operation.getReturnValue() = (long double)*data; - break; - } - case Operation::CHARS: - { - if(*data) - { - *(char**)operation.getReturnValue() = "true"; - } - else - { - *(char**)operation.getReturnValue() = "false"; - } - break; - } - case Operation::STRING: - { - if(*data) - { - *(string*)operation.getReturnValue() = "true"; - } - else - { - *(string*)operation.getReturnValue() = "false"; - } - break; - } - default: - { - // The type is set as something else or has not been set - operation.setReturnValue(data); - } - } - - break; - } - case T_OBJECT: - { - VALUE klass = rb_obj_class(result); - if (klass == RubyImplementation::getXMLDocumentClass()) - { - // Convert a REXML::Document to a DataObject - ID to_s = rb_intern("to_s"); - VALUE vstr = rb_funcall(result, to_s, 0); - string str = string(rb_string_value_cstr(&vstr)); - - Composite* composite = component->getComposite(); - commonj::sdo::XMLHelper* xmlHelper = composite->getXMLHelper(); - commonj::sdo::XMLDocumentPtr xmlDoc = xmlHelper->load(str.c_str()); - - DataObjectPtr dob; - if (xmlDoc != NULL) - { - dob = xmlDoc->getRootDataObject(); - } - if (dob != NULL) - { - operation.setReturnValue(&dob); - } - else - { - string msg = "Document could not be converted to a DataObject"; - throw msg.c_str(); - } - } - else - { - string msg = "Ruby type not supported: " + resultType; - throw msg.c_str(); - } - break; - } - default: - { - string msg = "Ruby type not supported: " + resultType; - throw msg.c_str(); - } - } - - } - catch (...) - { - runtime->unsetCurrentComponent(); - throw; - } - runtime->unsetCurrentComponent(); - LOGEXIT(1,"RubyServiceWrapper::invoke"); - - } - - } // End namespace ruby - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.h deleted file mode 100644 index 849bbdd33e..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * 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_ruby_rubyservicewrapper_h -#define tuscany_sca_ruby_rubyservicewrapper_h - -#include "tuscany/sca/core/ServiceWrapper.h" -#include "tuscany/sca/core/Operation.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Interface.h" -#include "tuscany/sca/ruby/model/RubyImplementation.h" -#include "tuscany/sca/ruby/export.h" - -#include "tuscany/sca/ruby/Ruby.h" - -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace ruby - { - class RubyInterface; - - /** - * Wraps the service on a component implementation. - * This abstract class is extended by generated code which provides - * the implementation of some of the methods. - * An instance of this class wraps the actual component implementation which - * has been written by a developer of an SCA application. - */ - class SCA_RUBY_API RubyServiceWrapper : public ServiceWrapper - { - public: - - /** - * Constructor. - * @param target The component service to which this wrapper refers. - */ - RubyServiceWrapper(Service* service); - - /** - * Destructor. - */ - virtual ~RubyServiceWrapper(); - - /** - * All business method calls to the target component go through the invoke method. - * @param operation The details of the method, paramaters and return value for the - * business method to be called on the target component. - */ - virtual void invoke(Operation& operation); - - private: - - /** - * The component to which this wrapper refers. - */ - Component* component; - - /** - * A pointer to the interface which the service exposes. - */ - Interface* interf; - - /** - * The Ruby implementation - */ - RubyImplementation* implementation; - - }; - - } // End namespace ruby - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_ruby_rubyservicewrapper_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/export.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/export.h deleted file mode 100644 index 21f09dddfc..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/export.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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_ruby_export_h -#define tuscany_sca_ruby_export_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) - -#ifdef TUSCANY_SCA_RUBY_EXPORTS -#define SCA_RUBY_API __declspec(dllexport) -#else -#define SCA_RUBY_API __declspec(dllimport) -#endif - -#else -#define SCA_RUBY_API -#endif - -#endif // tuscany_sca_ruby_export_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyImplementation.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyImplementation.cpp deleted file mode 100644 index 877b98e7b4..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyImplementation.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/* - * 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/ruby/model/RubyImplementation.h" -#include "tuscany/sca/ruby/model/RubyServiceBinding.h" -#include "tuscany/sca/ruby/model/RubyReferenceBinding.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/Service.h" -#include "tuscany/sca/model/ServiceType.h" -#include "tuscany/sca/model/Reference.h" -#include "tuscany/sca/model/ReferenceType.h" -#include "tuscany/sca/util/Utils.h" - -namespace tuscany -{ - namespace sca - { - - namespace ruby - { - - bool RubyImplementation::initialized = false; - VALUE RubyImplementation::xmlDocumentClass = 0; - - // Constructor - RubyImplementation::RubyImplementation(Composite* composite, const string& module, const string& className, const string& script) - : ComponentType(composite, script.substr(0, script.find_last_of('.'))), - module(module), className(className), script(script) - { - loadClass(); - } - - RubyImplementation::~RubyImplementation() - { - } - - void RubyImplementation::loadClass() - { - // Initialize the Ruby runtime - if (!initialized) - { - ruby_init(); - ruby_init_loadpath(); - - // Load the Rexml module. Rexml is used to handle XML documents. - //rb_require("rexml/document"); - // Use rb_eval_string for now as it provides better error reporting - rb_eval_string("require(\"rexml/document\")"); - - xmlDocumentClass = rb_path2class("REXML::Document"); - - initialized = true; - } - - // Load the specified Ruby script - if (script != "") - { - // Convert any windows slashes \ in the root path to unix slashes / - // otherwise the ruby interpreter throws an error - string rootpath = getComposite()->getRoot(); - int pos = 0; - while((pos = rootpath.find('\\', pos)) != string::npos) - { - rootpath = rootpath.replace(pos, 1, "/"); - } - - // Use rb_eval_string for now as it provides better error reporting - string path = "require(\"" + rootpath + "/" + script +"\")"; - //rb_require((char *)path.c_str()); - rb_eval_string(path.c_str()); - } - - // Load the Ruby implementation class - implementationClass = rb_path2class(className.c_str()); - - // Create a default service - ServiceType* defaultServiceType = new ServiceType(this, "", NULL, NULL); - addServiceType(defaultServiceType); - - // Introspect the Ruby class and create references and properties for - // all public attributes - VALUE methods = rb_class_public_instance_methods(0, NULL, implementationClass); - int n = RARRAY(methods)->len; - for (int i = 0; i 1 && methodName[s-1] == '=' && methodName[0] != '=') - { - string variableName = methodName.substr(0, s-1); - ReferenceType* referenceType = new ReferenceType( - this, variableName, NULL, NULL, ReferenceType::ONE_ONE); - addReferenceType(referenceType); - - // Create a property type as well - addPropertyType(variableName, "http://www.w3.org/2001/XMLSchema#string", false, NULL); - - } - } - } - - void RubyImplementation::initializeComponent(Component* component) - { - ComponentType::initializeComponent(component); - - // Create Ruby bindings for all the services - const Component::SERVICE_MAP& services = component->getServices(); - Component::SERVICE_MAP::const_iterator iter = services.begin(); - for (int i=0; i< services.size(); i++) - { - Service *service = iter->second; - RubyServiceBinding* binding = new RubyServiceBinding(service); - service->setBinding(binding); - iter++; - } - - // Create Ruby bindings for all the references - const Component::REFERENCE_MAP& references = component->getReferences(); - Component::REFERENCE_MAP::const_iterator refiter = references.begin(); - for (int ri=0; ri< references.size(); ri++) - { - Reference *reference = refiter->second; - RubyReferenceBinding* binding = new RubyReferenceBinding(reference); - reference->setBinding(binding); - refiter++; - } - } - - } // End namespace ruby - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyImplementation.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyImplementation.h deleted file mode 100644 index 32b5801f42..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyImplementation.h +++ /dev/null @@ -1,140 +0,0 @@ -/* - * 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_ruby_model_rubyimplementation_h -#define tuscany_sca_ruby_model_rubyimplementation_h -#include "tuscany/sca/model/ComponentType.h" - -#include -using std::map; -#include -using std::string; - -#include "tuscany/sca/ruby/Ruby.h" - -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace ruby - { - /** - * Holds information about an SCA implementation written in Ruby - */ - class RubyImplementation : public ComponentType - { - - public: - /** - * Constructor. - * @param composite The composite containing this implementation. - * @param module Name of the Ruby module. - * @param className Name of the Ruby implementation class. - * @param script Path of the Ruby script. - */ - RubyImplementation(Composite* composite, const string& module, const string& className, const string& script); - - /** - * Destructor - */ - virtual ~RubyImplementation(); - - /** - * Initialize a component of this type. - * @param component The component to initialize. - */ - virtual void initializeComponent(Component* component); - - /** - * Returns the name of the Ruby module. - * @return The name of the Ruby module. - */ - const string& getModule() const { return module; } - - /** - * Returns the name of Ruby class. - * @return Name of the Ruby class. - */ - const string& getClass() const { return className; } - - /** - * Returns the path of the Ruby script. - * @return The path of the Ruby script. - */ - const string& getScript() const { return script; } - - /** - * Returns the Ruby implementation class - */ - VALUE getImplementationClass() const { return implementationClass; } - - /** - * Returns the Ruby REXML::Document class - */ - static VALUE getXMLDocumentClass() { return xmlDocumentClass; } - - private: - - /** - * Load the Ruby implementation class - */ - void loadClass(); - - /** - * Name of the Ruby module. - */ - string module; - - /** - * Name of the Ruby class. - */ - string className; - - /** - * Path of the Ruby script. - */ - string script; - - /** - * The Ruby implementation class - */ - VALUE implementationClass; - - /** - * True if the Ruby runtime has been initialized - */ - static bool initialized; - - /** - * The Ruby REXML::Document class. - */ - static VALUE xmlDocumentClass; - - }; - - } // End namespace ruby - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_ruby_model_rubyimplementation_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyReferenceBinding.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyReferenceBinding.cpp deleted file mode 100644 index 0e813983f2..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyReferenceBinding.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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/ruby/model/RubyReferenceBinding.h" -#include "tuscany/sca/ruby/RubyServiceProxy.h" - - -namespace tuscany -{ - namespace sca - { - namespace ruby - { - - // Constructor - RubyReferenceBinding::RubyReferenceBinding(Reference* reference) - : ReferenceBinding(reference, ""), serviceProxy(NULL), targetServiceBinding(NULL) - { - } - - // Destructor - RubyReferenceBinding::~RubyReferenceBinding() - { - } - - ServiceProxy* RubyReferenceBinding::getServiceProxy() - { - return serviceProxy; - } - - void RubyReferenceBinding::configure(ServiceBinding* binding) - { - targetServiceBinding = binding; - - serviceProxy = new RubyServiceProxy(getReference()); - } - - } // End namespace ruby - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyReferenceBinding.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyReferenceBinding.h deleted file mode 100644 index cab1c22c48..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyReferenceBinding.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * 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_ruby_model_rubyreferencebinding_h -#define tuscany_sca_ruby_model_rubyreferencebinding_h - -#include "tuscany/sca/model/ReferenceBinding.h" - - -#include -using std::string; - -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace ruby - { - /** - * Information about a Ruby service binding for service or a reference. - */ - class RubyReferenceBinding : public ReferenceBinding - { - public: - - /** - * Constructor. - */ - RubyReferenceBinding(Reference* reference); - - /** - * Destructor. - */ - virtual ~RubyReferenceBinding(); - - /** - * Returns the type of binding. - */ - virtual string getType() { return "http://www.osoa.org/xmlns/sca/1.0#RubyImplementationBinding"; }; - - /** - * Create a proxy representing the reference to the - * client component. - */ - virtual ServiceProxy* getServiceProxy(); - - /** - * Configure this binding from a service binding. - */ - virtual void configure(ServiceBinding* serviceBinding); - - /** - * Returns the target service binding. - */ - ServiceBinding* getTargetServiceBinding() const { return targetServiceBinding; }; - - private: - - /** - * The proxy representing the reference to the client - * component. - */ - ServiceProxy* serviceProxy; - - /** - * The service binding of the target - */ - ServiceBinding* targetServiceBinding; - }; - - } // End namespace ruby - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_ruby_model_rubyreferencebinding_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyServiceBinding.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyServiceBinding.cpp deleted file mode 100644 index 376a4db0f7..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyServiceBinding.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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/ruby/model/RubyServiceBinding.h" -#include "tuscany/sca/ruby/RubyServiceWrapper.h" - -namespace tuscany -{ - namespace sca - { - namespace ruby - { - - // Constructor - RubyServiceBinding::RubyServiceBinding(Service* service) - : ServiceBinding(service, "") - { - serviceWrapper = new RubyServiceWrapper(service); - } - - // Destructor - RubyServiceBinding::~RubyServiceBinding() - { - } - - ServiceWrapper* RubyServiceBinding::getServiceWrapper() - { - return (ServiceWrapper*)serviceWrapper; - } - - } // End namespace ws - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyServiceBinding.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyServiceBinding.h deleted file mode 100644 index 24c0275bb9..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyServiceBinding.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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_ruby_model_rubyservicebinding_h -#define tuscany_sca_ruby_model_rubyservicebinding_h - -#include "tuscany/sca/model/ServiceBinding.h" -using namespace tuscany::sca::model; -#include -using std::string; - -namespace tuscany -{ - namespace sca - { - namespace ruby - { - /** - * Information about a Ruby service binding for service or a reference. - */ - class RubyServiceBinding : public ServiceBinding - { - public: - - /** - * Constructor. - */ - RubyServiceBinding(Service* service); - - /** - * Destructor. - */ - virtual ~RubyServiceBinding(); - - /** - * Returns the type of binding. - */ - virtual string getType() { return "http://www.osoa.org/xmlns/sca/1.0#RubyImplementationBinding"; }; - - /** - * Create a wrapper for the service configured by this - * binding. - */ - virtual ServiceWrapper* getServiceWrapper(); - - private: - - /** - * The wrapper for the service configured by this binding. - */ - ServiceWrapper* serviceWrapper; - - }; - - } // End namespace ruby - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_ruby_model_rubyservicebinding_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/xsd/sca-implementation-ruby.xsd b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/xsd/sca-implementation-ruby.xsd deleted file mode 100644 index f6598590d1..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ruby/xsd/sca-implementation-ruby.xsd +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/Makefile.am b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/Makefile.am deleted file mode 100644 index 50dfb45557..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -# 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. - -SUBDIRS = reference service -datadir=$(prefix)/extensions/sca - -nobase_data_DATA = xsd/*.xsd - -EXTRA_DIST = xsd diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/reference/Makefile.am b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/reference/Makefile.am deleted file mode 100644 index 18e9ba89b9..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/reference/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ -# 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. - -SUBDIRS = axis2c diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/reference/axis2c/Makefile.am b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/reference/axis2c/Makefile.am deleted file mode 100644 index 2b9491ec1c..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/reference/axis2c/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ -# 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. - -SUBDIRS = src diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/reference/axis2c/src/Makefile.am b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/reference/axis2c/src/Makefile.am deleted file mode 100644 index 75eba52f73..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/reference/axis2c/src/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -# 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 \ - -L$(top_builddir)/runtime/extensions/ws/reference/axis2c/src -ltuscany_sca_ws_reference - -INCLUDES = -I$(top_builddir)/runtime/core/src \ - -I${TUSCANY_SDOCPP}/include \ - -I$(top_builddir)/runtime/extensions/ws/reference/axis2c/src - -AM_CPPFLAGS = $(CPPFLAGS) -D_DEBUG diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/reference/axis2c/src/tuscany/sca/binding/SCAServiceBindingExtension.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/reference/axis2c/src/tuscany/sca/binding/SCAServiceBindingExtension.cpp deleted file mode 100644 index b12702bf43..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/reference/axis2c/src/tuscany/sca/binding/SCAServiceBindingExtension.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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 "model/SCAServiceBinding.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/core/SCARuntime.h" - -extern "C" -{ - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - void tuscany_sca_extension_initialize() - { - tuscany::sca::binding::SCAServiceBindingExtension::initialize(); - } -} - - -namespace tuscany -{ - namespace sca - { - namespace binding - { - // =================================================================== - // Constructor for the SCAServiceBinding class. - // =================================================================== - SCAServiceBindingExtension::SCAServiceBindingExtension() - { - LOGENTRY(1, "SCAServiceBindingExtension::constructor"); - LOGEXIT(1, "SCAServiceBindingExtension::constructor"); - } - - // =================================================================== - // Destructor for the SCAServiceBindingExtension class. - // =================================================================== - SCAServiceBindingExtension::~SCAServiceBindingExtension() - { - LOGENTRY(1, "SCAServiceBindingExtension::destructor");; - LOGEXIT(1, "SCAServiceBindingExtension::destructor"); - } - - 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) - { - string bindingType = scdlBinding->getType().getName(); - if (bindingType == "SCABinding") - { - string uri = scdlBinding->getCString("uri"); - - SCAServiceBinding* serviceBinding = new SCAServiceBinding(service, uri); - - return serviceBinding; - } - else - { - return NULL; - } - } - - void SCAServiceBindingExtension::initialize() - { - LOGENTRY(1, "SCAServiceBindingExtension::initialize");; - SCARuntime::getInstance()->registerServiceBindingExtension(new SCAServiceBindingExtension()); - LOGEXIT(1, "SCAServiceBindingExtension::initialize");; - } - - } // End namespace ws - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/reference/axis2c/src/tuscany/sca/binding/SCAServiceBindingExtension.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/reference/axis2c/src/tuscany/sca/binding/SCAServiceBindingExtension.h deleted file mode 100644 index 4cd05bee16..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/reference/axis2c/src/tuscany/sca/binding/SCAServiceBindingExtension.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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 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 string& getExtensionTypeQName() {return typeQName;} - - virtual ServiceBinding* getServiceBinding(Composite* composite, Service* service, DataObjectPtr scdlBinding); - - static void initialize(); - - private: - static const string extensionName; - static const string typeQName; - - }; - - - } // End namespace binding - } // End namespace sca -} // End namespace tuscany - -#endif //tuscany_sca_extension_binding_scaservicebindingextension_h - diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/reference/axis2c/src/tuscany/sca/binding/model/SCAServiceBinding.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/reference/axis2c/src/tuscany/sca/binding/model/SCAServiceBinding.cpp deleted file mode 100644 index a6b052f04f..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/reference/axis2c/src/tuscany/sca/binding/model/SCAServiceBinding.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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/binding/model/SCAServiceBinding.h" -#include "tuscany/sca/core/ServiceWrapper.h" - -namespace tuscany -{ - namespace sca - { - namespace binding - { - - // Constructor - SCAServiceBinding::SCAServiceBinding(Service* service, const string& uri) - : WSServiceBinding(service, uri, "", "") - { - } - - // Destructor - SCAServiceBinding::~SCAServiceBinding() - { - } - - } // End namespace binding - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/reference/axis2c/src/tuscany/sca/binding/model/SCAServiceBinding.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/reference/axis2c/src/tuscany/sca/binding/model/SCAServiceBinding.h deleted file mode 100644 index 90eb222b7b..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/reference/axis2c/src/tuscany/sca/binding/model/SCAServiceBinding.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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 "tuscany/sca/model/ServiceBinding.h" -#include "tuscany/sca/model/Service.h" -#include "tuscany/sca/ws/model/WSServiceBinding.h" - -#include -using std::string; - -using namespace tuscany::sca::model; -using namespace tuscany::sca::ws; - -namespace tuscany -{ - namespace sca - { - namespace binding - { - /** - * Information about an SCA service binding for service or a reference. - */ - class SCAServiceBinding : public WSServiceBinding - { - public: - - /** - * Constructor. - * @param uri The uri of the binding. - */ - SCAServiceBinding(model::Service* service, const string& uri); - - /** - * Destructor. - */ - virtual ~SCAServiceBinding(); - - /** - * Returns the type of binding. - */ - virtual string getType() { return "http://www.osoa.org/xmlns/sca/1.0#SCABinding"; }; - - private: - - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_extension_ws_model_wsservicebinding_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/service/Makefile.am b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/service/Makefile.am deleted file mode 100644 index 18e9ba89b9..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/service/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ -# 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. - -SUBDIRS = axis2c diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/service/axis2c/Makefile.am b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/service/axis2c/Makefile.am deleted file mode 100644 index feadf9e317..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/service/axis2c/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ -# 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. - -SUBDIRS = src \ No newline at end of file diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/service/axis2c/src/Makefile.am b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/service/axis2c/src/Makefile.am deleted file mode 100644 index b03e398106..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/service/axis2c/src/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -# 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 \ - -L$(top_builddir)/runtime/extensions/ws/service/axis2c/src -ltuscany_sca_ws_service - -INCLUDES = -I$(top_builddir)/runtime/core/src \ - -I${TUSCANY_SDOCPP}/include \ - -I$(top_builddir)/runtime/extensions/ws/service/axis2c/src - -AM_CPPFLAGS = $(CPPFLAGS) -D_DEBUG diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/service/axis2c/src/tuscany/sca/binding/SCAReferenceBindingExtension.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/service/axis2c/src/tuscany/sca/binding/SCAReferenceBindingExtension.cpp deleted file mode 100644 index 7fb9b4af64..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/service/axis2c/src/tuscany/sca/binding/SCAReferenceBindingExtension.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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" - - -extern "C" -{ - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - void tuscany_sca_extension_initialize() - { - tuscany::sca::binding::SCAReferenceBindingExtension::initialize(); - } -} - -namespace tuscany -{ - namespace sca - { - namespace binding - { - // =================================================================== - // Constructor for the SCAReferenceBinding class. - // =================================================================== - SCAReferenceBindingExtension::SCAReferenceBindingExtension() - { - LOGENTRY(1, "SCAReferenceBindingExtension::constructor"); - LOGEXIT(1, "SCAReferenceBindingExtension::constructor"); - } - - // =================================================================== - // Destructor for the SCAReferenceBindingExtension class. - // =================================================================== - SCAReferenceBindingExtension::~SCAReferenceBindingExtension() - { - LOGENTRY(1, "SCAReferenceBindingExtension::destructor");; - LOGEXIT(1, "SCAReferenceBindingExtension::destructor"); - } - - 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) - { - string bindingType = scdlBinding->getType().getName(); - if (bindingType == "SCABinding") - { - string uri = scdlBinding->getCString("uri"); - - SCAReferenceBinding* serviceBinding = new SCAReferenceBinding(reference, uri); - - return serviceBinding; - } - else - { - return NULL; - } - } - - void SCAReferenceBindingExtension::initialize() - { - LOGENTRY(1, "SCAReferenceBindingExtension::initialize");; - SCARuntime::getInstance()->registerReferenceBindingExtension(new SCAReferenceBindingExtension()); - LOGEXIT(1, "SCAReferenceBindingExtension::initialize");; - } - - } // End namespace binding - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/service/axis2c/src/tuscany/sca/binding/SCAReferenceBindingExtension.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/service/axis2c/src/tuscany/sca/binding/SCAReferenceBindingExtension.h deleted file mode 100644 index 9f5ddd55eb..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/service/axis2c/src/tuscany/sca/binding/SCAReferenceBindingExtension.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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 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 string& getExtensionTypeQName() {return typeQName;} - - virtual ReferenceBinding* getReferenceBinding(Composite* composite, Reference *reference, DataObjectPtr scdlBinding); - - static void initialize(); - - private: - static const string extensionName; - static const string typeQName; - - }; - - - } // End namespace binding - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_extension_binding_scareferencebindingextension_h - diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/service/axis2c/src/tuscany/sca/binding/model/SCAReferenceBinding.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/service/axis2c/src/tuscany/sca/binding/model/SCAReferenceBinding.cpp deleted file mode 100644 index 6e7b4eaccc..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/service/axis2c/src/tuscany/sca/binding/model/SCAReferenceBinding.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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/binding/model/SCAReferenceBinding.h" -#include "tuscany/sca/ws/model/WSReferenceBinding.h" -#include "tuscany/sca/core/ServiceProxy.h" - -namespace tuscany -{ - namespace sca - { - namespace binding - { - - // Constructor - SCAReferenceBinding::SCAReferenceBinding(Reference* reference, const string& uri) - : WSReferenceBinding(reference, uri, "", "") - { - } - - // Destructor - SCAReferenceBinding::~SCAReferenceBinding() - { - } - - } // End namespace binding - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/service/axis2c/src/tuscany/sca/binding/model/SCAReferenceBinding.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/service/axis2c/src/tuscany/sca/binding/model/SCAReferenceBinding.h deleted file mode 100644 index 445a00be82..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/service/axis2c/src/tuscany/sca/binding/model/SCAReferenceBinding.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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 "tuscany/sca/model/ReferenceBinding.h" -#include "tuscany/sca/ws/model/WSReferenceBinding.h" - -using namespace tuscany::sca::model; -using namespace tuscany::sca::ws; - -#include -using std::string; - -namespace tuscany -{ - namespace sca - { - namespace binding - { - /** - * Information about a web service binding for service or a reference. - */ - class SCAReferenceBinding : public WSReferenceBinding - { - public: - - /** - * Constructor. - * @param uri The uri of the binding. - */ - SCAReferenceBinding(Reference* reference, const string&uri); - - /** - * Destructor. - */ - virtual ~SCAReferenceBinding(); - - /** - * Returns the type of binding. - */ - virtual string getType() { return "http://www.osoa.org/xmlns/sca/1.0#SCABinding"; }; - - private: - - }; - - } // End namespace binding - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_extension_binding_model_scareferencebinding_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/xsd/sca-binding-sca.xsd b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/xsd/sca-binding-sca.xsd deleted file mode 100644 index 1051c3910c..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/sca/xsd/sca-binding-sca.xsd +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/Makefile.am b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/Makefile.am deleted file mode 100644 index 806786ce04..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -# 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. - -SUBDIRS = reference service -datadir=$(prefix)/extensions/ws - -nobase_data_DATA = xsd/*.xsd - -EXTRA_DIST = xsd diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/deploy.bat b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/deploy.bat deleted file mode 100644 index 567875624f..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/deploy.bat +++ /dev/null @@ -1,45 +0,0 @@ -@echo off - -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. - - -setlocal - -if . == .%1 ( -echo sca root not specified -goto usage -) -set rootdir=%1 -set deploydir=%rootdir%\deploy -set extdir=%deploydir%\extensions -set wsextdir=%extdir%\ws -set srcdir=%rootdir%\runtime\extensions\ws - -if not exist %deploydir% mkdir %deploydir% -if not exist %extdir% mkdir %extdir% -if not exist %wsextdir% mkdir %wsextdir% -if not exist %wsextdir%\xsd mkdir %wsextdir%\xsd - -copy %srcdir%\xsd\*.* %wsextdir%\xsd - -goto end -:usage -echo Usage: deploy -:end - -endlocal diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/Makefile.am b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/Makefile.am deleted file mode 100644 index 18e9ba89b9..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ -# 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. - -SUBDIRS = axis2c diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/Makefile.am b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/Makefile.am deleted file mode 100644 index 2b9491ec1c..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ -# 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. - -SUBDIRS = src diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/Makefile.am b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/Makefile.am deleted file mode 100644 index 208af0e15a..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/Makefile.am +++ /dev/null @@ -1,49 +0,0 @@ -# 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/ws/reference/lib -lib_LTLIBRARIES = libtuscany_sca_ws_reference.la - -noinst_HEADERS = tuscany/sca/ws/*.h tuscany/sca/ws/model/*.h - -libtuscany_sca_ws_reference_la_SOURCES = \ -tuscany/sca/ws/WSServiceBindingExtension.cpp \ -tuscany/sca/ws/model/WSServiceBinding.cpp \ -tuscany/sca/ws/WSServiceWrapper.cpp \ -tuscany/sca/ws/Axis2Client.cpp - -libtuscany_sca_ws_reference_la_LIBADD = \ - -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo -ltuscany_sdo_axiom \ - -L$(top_builddir)/runtime/core/src -ltuscany_sca \ - -L$(AXIS2C_HOME)/lib \ - -laxis2_util \ - -laxis2_axiom \ - -laxis2_wsdl \ - -laxis2_engine \ - -laxis2_parser \ - -laxis2_minizip \ - -lpthread \ - -lwoden \ - -laxis2_http_sender \ - -laxis2_http_receiver - -INCLUDES = -I$(top_builddir)/runtime/core/src \ - -I${TUSCANY_SDOCPP}/include \ - -I${AXIS2C_HOME}/include - -AM_CPPFLAGS = $(CPPFLAGS) -D_DEBUG - diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/Axis2Client.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/Axis2Client.cpp deleted file mode 100644 index 4dfb3e7efd..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/Axis2Client.cpp +++ /dev/null @@ -1,717 +0,0 @@ -/* - * 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$ */ - - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4091) -#pragma warning(disable: 4786) -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#include "Axis2Client.h" - -#include "tuscany/sca/core/SCARuntime.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/util/Utils.h" -#include "model/WSServiceBinding.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/util/Exceptions.h" -#include "tuscany/sca/model/Service.h" -#include "tuscany/sca/model/ServiceType.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/WSDLDefinition.h" -#include "tuscany/sca/model/WSDLInterface.h" -#include "tuscany/sca/model/WSDLOperation.h" - -#include - -using namespace tuscany::sca::ws; - - -using namespace commonj::sdo; -using namespace commonj::sdo_axiom; - -namespace tuscany -{ - namespace sca - { - namespace ws - { - - Axis2Client::Axis2Client(CompositeReference* compositeReference) - : compositeReference(compositeReference) - { - } - - Axis2Client::~Axis2Client() - { - } - - void Axis2Client::invoke(tuscany::sca::Operation& operation) - { - LOGENTRY(1, "Axis2Client::invoke"); - - // Initialize Axis2 stuff - axis2_allocator_t *allocator = axis2_allocator_init (NULL); - axis2_log_t *log = axis2_log_create(allocator, NULL, "tuscany_client.log"); - axis2_error_t *error = axis2_error_create(allocator); - axis2_env_t *env = axis2_env_create_with_error_log(allocator, error, log); - env->log->level = AXIS2_LOG_LEVEL_TRACE; - axis2_error_init(); - - // Get the WS service binding and WSDLOperation - Composite* composite=compositeReference->getComposite(); - Service* service = compositeReference->getService(); - WSServiceBinding* binding = (WSServiceBinding *)service->getBinding(); - const string& operationName = operation.getName(); - WSDLOperation wsdlOperation; - - // Get the WSDL namespace - string wsdlNamespace = binding->getWSDLNamespaceURL(); - if (wsdlNamespace != "") - { - - // Lookup the wsdl model from the composite, keyed on the namespace - // (the wsdl will have been loaded at startup) - WSDLDefinition* wsdlDefinition = composite->findWSDLDefinition(wsdlNamespace); - if (wsdlDefinition == 0) - { - AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "WSDL description %s not found\n", wsdlNamespace.c_str()); - string msg = "WSDL not found for " + wsdlNamespace; - throw SystemConfigurationException(msg.c_str()); - } - - // Match the operation in Operation to the operation in the wsdl port type. - try - { - wsdlOperation = wsdlDefinition->findOperation( - binding->getServiceName(), - binding->getEndpointName(), - operationName); - } - catch(SystemConfigurationException &ex) - { - AXIS2_LOG_ERROR((env)->log, AXIS2_LOG_SI, "SystemConfigurationException has been caught: %s\n", ex.getMessageText()); - throw; - } - - } - else - { - Interface* iface = service->getType()->getInterface(); - if (iface != NULL && - iface->getInterfaceTypeQName() == WSDLInterface::typeQName) - { - WSDLInterface* wsdlInterface = (WSDLInterface*)iface; - wsdlNamespace = wsdlInterface->getNamespaceURI(); - - if (wsdlNamespace != "") - { - - WSDLDefinition* wsdl = composite->findWSDLDefinition(wsdlNamespace); - if (wsdl == 0) - { - AXIS2_LOG_ERROR((env)->log, AXIS2_LOG_SI, "WSDL description %s not found\n", wsdlNamespace.c_str()); - string msg = "WSDL not found for " + wsdlNamespace; - throw SystemConfigurationException(msg.c_str()); - } - - try - { - wsdlOperation = wsdl->findOperation(wsdlInterface->getName(), operationName); - } - catch(SystemConfigurationException &ex) - { - AXIS2_LOG_ERROR((env)->log, AXIS2_LOG_SI, "SystemConfigurationException has been caught: %s\n", ex.getMessageText()); - throw; - } - } - } - } - - if (wsdlNamespace == "") - { - - // Create a default document literal wrapped WSDL operation - wsdlNamespace = compositeReference->getName(); - wsdlOperation = WSDLOperation(); - wsdlOperation.setOperationName(operationName); - wsdlOperation.setSoapAction(wsdlNamespace+ "#" +operationName); - wsdlOperation.setEndpoint(""); - wsdlOperation.setSoapVersion(WSDLOperation::SOAP11); - wsdlOperation.setDocumentStyle(true); - wsdlOperation.setWrappedStyle(true); - wsdlOperation.setEncoded(false); - wsdlOperation.setInputType(wsdlNamespace + "#" + operationName); - wsdlOperation.setOutputType(wsdlNamespace + "#" + operationName + "Response"); - } - - // Get the target endpoint address - // The URI specified in the binding overrides the address specified in - // the WSDL - axis2_char_t* address; - if (binding->getURI() != "") - { - address = (axis2_char_t*)binding->getURI().c_str(); - } - else - { - address = (axis2_char_t*)wsdlOperation.getEndpoint().c_str(); - } - - axis2_char_t* opName = (axis2_char_t*)operationName.c_str(); - axis2_char_t* soap_action = (axis2_char_t*)wsdlOperation.getSoapAction().c_str(); - axis2_char_t* serviceName = (axis2_char_t*)binding->getServiceName().c_str(); - - // create OM from Operation and wsdlOperation - axiom_node_t* payload = createPayload(operation, wsdlOperation, env); - - /* Create EPR with given address */ - axis2_endpoint_ref_t* endpoint_ref = axis2_endpoint_ref_create(env, address); - - /* Setup options */ - axis2_options_t* options = axis2_options_create(env); - AXIS2_OPTIONS_SET_TO(options, env, endpoint_ref); - int soap_version = AXIOM_SOAP11; - if (binding->getSOAPVersion() == "1.2") - { - soap_version = AXIOM_SOAP12; - } - else - { - if (wsdlOperation.getSoapVersion() == WSDLOperation::SOAP12) - { - soap_version = AXIOM_SOAP12; - } - } - - AXIS2_OPTIONS_SET_SOAP_VERSION(options, env, soap_version); - AXIS2_OPTIONS_SET_ACTION(options, env, soap_action); - - /* Create service client */ - - axis2_char_t* client_home = AXIS2_GETENV("AXIS2C_HOME"); - if (!client_home) - { - throw SystemConfigurationException("Environment error: AXIS2C_HOME not set"); - } - axis2_svc_client_t* svc_client = axis2_svc_client_create(env, client_home); - if (!svc_client) - { - AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "invoke FAILED: Error code:" - " %d :: %s", env->error->error_number, - AXIS2_ERROR_GET_MESSAGE(env->error)); - - throw SystemConfigurationException("Axis2Client: axis2_svc_client_create failed"); - } - - /* Set service client options */ - AXIS2_SVC_CLIENT_SET_OPTIONS(svc_client, env, options); - - /* Send request */ - axiom_node_t* ret_node = AXIS2_SVC_CLIENT_SEND_RECEIVE(svc_client, env, payload); - if(ret_node) - { - setReturn(ret_node, operation, wsdlOperation, env); - } - else - { - AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Invoke failed: Error code:" - " %d :: %s", env->error->error_number, - AXIS2_ERROR_GET_MESSAGE(env->error)); - throw SystemConfigurationException("Axis2Client: Invoke failed"); - } - - LOGINFO(2, "Warning: Have not freed Axis2C service client memory due to Jira AXIS2C-209"); - // Uncommenting this code causes crash when invoking a composite with both Axis2C ws.binding - // service and reference. See Jiras TUSCANY-536 and AXIS2C-209 - //if (svc_client) - //{ - // AXIS2_SVC_CLIENT_FREE(svc_client, env); - // svc_client = NULL; - //} - - LOGEXIT(1, "Axis2Client::invoke"); - } - - axiom_node_t* Axis2Client::createPayload(Operation& operation, - const WSDLOperation& wsdlOperation, - axis2_env_t* env) - { - LOGENTRY(1, "Axis2Client::createPayload"); - axiom_node_t* request_node = NULL; - - // map the operation request to the wsdl - if (wsdlOperation.isDocumentStyle()) - { - // Document style - // only support single part messages - WS-I compliant - - // Build up the payload as an SDO - - // Get the data factory for the composite (it will already have the typecreates loaded for the xsds) - DataFactoryPtr dataFactory = compositeReference->getComposite()->getDataFactory(); - - DataObjectPtr inputDataObject; - try - { - - // Create the input wrapper - const Type& rootType = dataFactory->getType(wsdlOperation.getInputTypeUri().c_str(), "RootType"); - const Property& prop = rootType.getProperty(wsdlOperation.getInputTypeName().c_str()); - const Type& inputType = prop.getType(); - inputDataObject = dataFactory->create(inputType); - } - catch (SDORuntimeException e) - { - try - { - // Create the input wrapper - const Type& inputType = dataFactory->getType(wsdlOperation.getInputTypeUri().c_str(), - wsdlOperation.getInputTypeName().c_str()); - inputDataObject = dataFactory->create(inputType); - } - catch (SDORuntimeException e2) - { - - // The input wrapper type is not known, create an open DataObject - inputDataObject = dataFactory->create(Type::SDOTypeNamespaceURI, "OpenDataObject"); - } - } - - // Go through data object to set the input parameters - PropertyList pl = inputDataObject->getType().getProperties(); - - if(pl.size() == 0) - { - if(inputDataObject->getType().isOpenType() && inputDataObject->getType().isDataObjectType()) - { - /* - * This code deals with sending xsd:any elements - */ - for (int i=0; igetList(pname.str()); - - const Operation::Parameter& parm = operation.getParameter(i); - switch(parm.getType()) - { - case Operation::BOOL: - { - l.append(*(bool*)parm.getValue()); - break; - } - case Operation::SHORT: - { - l.append(*(short*)parm.getValue()); - break; - } - case Operation::INT: - { - l.append(*(long*)parm.getValue()); - break; - } - case Operation::LONG: - { - l.append(*(long*)parm.getValue()); - break; - } - case Operation::USHORT: - { - l.append(*(short*)parm.getValue()); - break; - } - case Operation::UINT: - { - l.append(*(long*)parm.getValue()); - break; - } - case Operation::ULONG: - { - l.append(*(long*)parm.getValue()); - break; - } - case Operation::FLOAT: - { - l.append(*(float*)parm.getValue()); - break; - } - case Operation::DOUBLE: - { - l.append(*(long double*)parm.getValue()); - break; - } - case Operation::LONGDOUBLE: - { - l.append(*(long double*)parm.getValue()); - break; - } - case Operation::CHARS: - { - l.append(*(char**)parm.getValue()); - break; - } - case Operation::STRING: - { - l.append((*(string*)parm.getValue()).c_str()); - break; - } - case Operation::DATAOBJECT: - { - l.append(*(DataObjectPtr*)parm.getValue()); - break; - } - default: throw "unsupported parameter type"; - } - } - } - } - else { - - // Each parameter in the operation should be a property on the request dataobject - for (int i=0; isetBoolean(i, *(bool*)parm.getValue()); - break; - } - case Operation::SHORT: - { - inputDataObject->setShort(i, *(short*)parm.getValue()); - break; - } - case Operation::INT: - { - inputDataObject->setInteger(i, *(int*)parm.getValue()); - break; - } - case Operation::LONG: - { - inputDataObject->setLong(i, *(long*)parm.getValue()); - break; - } - case Operation::USHORT: - { - inputDataObject->setInteger(i, *(unsigned short*)parm.getValue()); - break; - } - case Operation::UINT: - { - inputDataObject->setInteger(i, *(unsigned int*)parm.getValue()); - break; - } - case Operation::ULONG: - { - inputDataObject->setInteger(i, *(unsigned long*)parm.getValue()); - break; - } - case Operation::FLOAT: - { - inputDataObject->setFloat(i, *(float*)parm.getValue()); - break; - } - case Operation::DOUBLE: - { - inputDataObject->setDouble(i, *(double*)parm.getValue()); - break; - } - case Operation::LONGDOUBLE: - { - inputDataObject->setDouble(i, *(long double*)parm.getValue()); - break; - } - case Operation::CHARS: - { - inputDataObject->setCString(i, *(char**)parm.getValue()); - break; - } - case Operation::STRING: - { - inputDataObject->setCString(i, (*(string*)parm.getValue()).c_str()); - break; - } - case Operation::DATAOBJECT: - { - inputDataObject->setDataObject(i, *(DataObjectPtr*)parm.getValue()); - break; - } - default: throw "unsupported parameter type"; - } - } - } - - // Create the Axiom object from the request dataobject - AxiomHelper* axiomHelper = AxiomHelper::getHelper(); - request_node = axiomHelper->toAxiomNode(inputDataObject, - wsdlOperation.getInputTypeUri().c_str(), wsdlOperation.getInputTypeName().c_str()); - AxiomHelper::releaseHelper(axiomHelper); - } - else - { - // RPC - } - - char* str = AXIOM_NODE_TO_STRING(request_node, env); - LOGINFO_1(3, "Sending this OM node in XML : %s \n", str); - - LOGEXIT(1, "Axis2Client::createPayload"); - return request_node; - } - - void Axis2Client::setReturn(axiom_node_t* ret_node, - Operation& operation, - const WSDLOperation& wsdlOperation, - axis2_env_t* env) - { - LOGENTRY(1, "Axis2Client::setReturn"); - - if (wsdlOperation.isDocumentStyle()) - { - // Document style - DataFactoryPtr dataFactory = compositeReference->getComposite()->getDataFactory(); - - // Get the AXIOM node representing the SOAP Body - axiom_node_t* body = AXIOM_NODE_GET_PARENT(ret_node, env); - - // Convert the AXIOM node to an SDO DataObject - char* str = NULL; - str = AXIOM_NODE_TO_STRING(body, env); - if (str) - { - AXIS2_LOG_INFO((env)->log, "Axis2Client invoke has response OM: %s\n", str); - } - - // Convert the SOAP body to an SDO DataObject - AxiomHelper* axiomHelper = AxiomHelper::getHelper(); - DataObjectPtr outputBodyDataObject = axiomHelper->toSdo(body, dataFactory); - AxiomHelper::releaseHelper(axiomHelper); - - if(!outputBodyDataObject) - { - AXIS2_LOG_ERROR((env)->log, AXIS2_LOG_SI, "Axis2Service invoke: Could not convert received Axiom node to SDO"); - /** TODO: return a SOAP fault here */ - return; - } - - // Get the first body part representing the doc-lit-wrapped wrapper element - DataObjectPtr outputDataObject = NULL; - PropertyList bpl = outputBodyDataObject->getInstanceProperties(); - if (bpl.size()!=0) - { - if (bpl[0].isMany()) - { - DataObjectList& parts = outputBodyDataObject->getList((unsigned int)0); - outputDataObject = parts[0]; - } - else - { - outputDataObject = outputBodyDataObject->getDataObject(bpl[0]); - } - } - if (outputDataObject == NULL) - { - AXIS2_LOG_ERROR((env)->log, AXIS2_LOG_SI, "Axis2Client invoke: Could not convert body part to SDO"); - return; - } - - PropertyList pl = outputDataObject->getInstanceProperties(); - unsigned int i = 0; - - switch(pl[i].getTypeEnum()) - { - case Type::BooleanType: - { - bool* boolData = new bool; - *boolData = outputDataObject->getBoolean(pl[i]); - operation.setReturnValue(boolData); - } - break; - case Type::ByteType: - { - char* byteData = new char; - *byteData = outputDataObject->getByte(pl[i]); - operation.setReturnValue(byteData); - } - break; - case Type::BytesType: - { - int len = outputDataObject->getLength(pl[i]); - char* bytesData = new char[len+1]; - int bytesWritten = outputDataObject->getBytes(pl[i], bytesData, len); - // Ensure the bytes end with the null char. Not sure if this is neccessary - if(bytesWritten <= len) - { - bytesData[bytesWritten] = 0; - } - else - { - bytesData[len] = 0; - } - //printf("outputDataObject has BytesType named %s with length %d\n", name, bytesWritten); - operation.setReturnValue(&bytesData); - } - break; - case Type::CharacterType: - { - // This code should work but won't be used as there is no mapping from an XSD type to the SDO CharacterType - wchar_t* charData = new wchar_t; - *charData = outputDataObject->getCharacter(pl[i]); - operation.setReturnValue(charData); - } - break; - case Type::DoubleType: - { - long double* doubleData = new long double; - *doubleData = outputDataObject->getDouble(pl[i]); - operation.setReturnValue(doubleData); - } - break; - case Type::FloatType: - { - float* floatData = new float; - *floatData = outputDataObject->getFloat(pl[i]); - operation.setReturnValue(floatData); - } - break; - case Type::IntegerType: - { - long* intData = new long; - *intData = outputDataObject->getInteger(pl[i]); - operation.setReturnValue(intData); - } - break; - case Type::ShortType: - { - short* shortData = new short; - *shortData = outputDataObject->getShort(pl[i]); - operation.setReturnValue(shortData); - } - break; - case Type::StringType: - { - string* str = new string(outputDataObject->getCString(pl[i])); - operation.setReturnValue(str); - } - break; - case Type::DataObjectType: - { - DataObjectPtr dataObjectData = outputDataObject->getDataObject(pl[i]); - if(!dataObjectData) - { - LOGINFO(4, "SDO DataObject return value was null"); - } - operation.setReturnValue(&dataObjectData); - } - break; - case Type::OpenDataObjectType: - { - /* - * This code deals with xsd:any element parameters - */ - - DataObjectList& dataObjectList = outputDataObject->getList(pl[i]); - - for(int j=0; jgetSequence(); - if (sequence->size()!=0) - { - // Return a text element - if (sequence->isText(0)) - { - string* stringData = new string(sequence->getCStringValue(0)); - operation.setReturnValue(stringData); - } - else - { - // Return a DataObject representing a complex element - DataObjectPtr dob = sequence->getDataObjectValue(0); - if(!dob) - { - LOGINFO(4, "SDO DataObject return value was null"); - } - operation.setReturnValue(&dob); - } - } - else - { - // Empty content, add an empty string - LOGINFO(4, "SDO OpenDataObject return value was empy"); - string *stringData = new string(""); - operation.setReturnValue(stringData); - } - } - } - } - break; - case Type::DateType: - LOGERROR(0, "SDO DateType return values are not yet supported"); - break; - case Type::LongType: - LOGERROR(0, "SDO LongType (int64_t) return values are not yet supported"); - break; - case Type::UriType: - LOGERROR(0, "SDO UriType return values are not yet supported"); - break; - case Type::BigDecimalType: - LOGERROR(0, "SDO BigDecimalType return values are not yet supported"); - break; - case Type::BigIntegerType: - LOGERROR(0, "SDO BigIntegerType return values are not yet supported"); - break; - default: - LOGERROR(0, "Unknown SDO type has been found in return value. Unknown types are not yet supported"); - break; - } - } - else - { - // RPC - } - LOGEXIT(1, "Axis2Client::setReturn"); - } - - } // End namespace ws - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/Axis2Client.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/Axis2Client.h deleted file mode 100644 index 5ec302f0c8..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/Axis2Client.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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_ws_axis2client_h -#define tuscany_sca_extension_ws_axis2client_h - -#include - -#include "tuscany/sca/core/Operation.h" -#include "tuscany/sca/model/CompositeReference.h" -#include "tuscany/sca/model/WSDLOperation.h" - -using namespace tuscany::sca::model; - - -namespace tuscany -{ - namespace sca - { - namespace ws - { - - class Axis2Client - { - public: - Axis2Client(CompositeReference* externalService); - virtual ~Axis2Client(); - - virtual void invoke(Operation& operation); - - private: - CompositeReference* compositeReference; - - axiom_node_t* createPayload(Operation& operation, - const WSDLOperation& wsdlOp, - axis2_env_t* env); - - void setReturn(axiom_node_t* returnNode, - Operation& operation, - const WSDLOperation& wsdlOp, - axis2_env_t* env); - - }; - } // End namespace ws - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_extension_ws_axis2client_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceBindingExtension.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceBindingExtension.cpp deleted file mode 100644 index c260445b60..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceBindingExtension.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/* - * 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 "WSServiceBindingExtension.h" -#include "model/WSServiceBinding.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/core/SCARuntime.h" - -extern "C" -{ - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - void tuscany_sca_extension_initialize() - { - tuscany::sca::ws::WSServiceBindingExtension::initialize(); - } -} - - -namespace tuscany -{ - namespace sca - { - namespace ws - { - // =================================================================== - // Constructor for the WSServiceBinding class. - // =================================================================== - WSServiceBindingExtension::WSServiceBindingExtension() - { - LOGENTRY(1, "WSServiceBindingExtension::constructor"); - LOGEXIT(1, "WSServiceBindingExtension::constructor"); - } - - // =================================================================== - // Destructor for the WSServiceBindingExtension class. - // =================================================================== - WSServiceBindingExtension::~WSServiceBindingExtension() - { - LOGENTRY(1, "WSServiceBindingExtension::destructor");; - LOGEXIT(1, "WSServiceBindingExtension::destructor"); - } - - const string WSServiceBindingExtension::extensionName("ws"); - const string WSServiceBindingExtension::typeQName("http://www.osoa.org/xmlns/sca/1.0#WebServiceBinding"); - - - // =================================================================== - // loadModelElement - load the info from binding.ws - // =================================================================== - ServiceBinding* WSServiceBindingExtension::getServiceBinding(Composite *composite, Service* service, DataObjectPtr scdlBinding) - { - string bindingType = scdlBinding->getType().getName(); - if (bindingType == "WebServiceBinding") - { - string uri = scdlBinding->getCString("uri"); - string endpoint = scdlBinding->getCString("endpoint"); - commonj::sdo::DataObjectList& soap = scdlBinding->getList("soapbinding"); - string version; - if (soap.size()!=0) - { - version = soap.getCString(0); - } - else - { - version = ""; - } - - WSServiceBinding* serviceBinding = new WSServiceBinding(service, uri, endpoint, version); - - return serviceBinding; - } - else - { - return NULL; - } - } - - void WSServiceBindingExtension::initialize() - { - LOGENTRY(1, "WSServiceBindingExtension::initialize");; - SCARuntime::getInstance()->registerServiceBindingExtension(new WSServiceBindingExtension()); - LOGEXIT(1, "WSServiceBindingExtension::initialize");; - } - - } // End namespace ws - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceBindingExtension.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceBindingExtension.h deleted file mode 100644 index db2c0c791f..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceBindingExtension.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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_ws_wsservicebindingextension_h -#define tuscany_sca_extension_ws_wsservicebindingextension_h - -#include "tuscany/sca/extension/ServiceBindingExtension.h" - -namespace tuscany -{ - namespace sca - { - namespace ws - { - - class WSServiceBindingExtension : public ServiceBindingExtension - { - public: - /** - * Default constructor - */ - WSServiceBindingExtension(); - - /** - * Destructor - */ - virtual ~WSServiceBindingExtension(); - - /** - * return the name of the extension - */ - virtual const 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 string& getExtensionTypeQName() {return typeQName;} - - virtual ServiceBinding* getServiceBinding(Composite* composite, Service* service, DataObjectPtr scdlBinding); - - static void initialize(); - - private: - static const string extensionName; - static const string typeQName; - - }; - - - } // End namespace ws - } // End namespace sca -} // End namespace tuscany - -#endif //tuscany_sca_extension_ws_wsservicebindingextension_h - diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceWrapper.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceWrapper.cpp deleted file mode 100644 index 5839aa8722..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceWrapper.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/* - * 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$ */ - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4091) -#endif - -#include "tuscany/sca/util/Logging.h" -#include "Axis2Client.h" -#include "WSServiceWrapper.h" -#include "tuscany/sca/core/Operation.h" -#include "tuscany/sca/model/Service.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/ServiceType.h" - -#include "commonj/sdo/SDO.h" -using namespace commonj::sdo; - -using namespace tuscany::sca; -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace ws - { - - WSServiceWrapper::WSServiceWrapper(Service* service) : ServiceWrapper(service) - { - // Define the SOAP Body type and element to allow a SOAP body to - // be loaded in a DataObject - DataFactoryPtr dataFactory = service->getComponent()->getComposite()->getDataFactory(); - try { - const Type& bodyType = dataFactory->getType("http://www.w3.org/2003/05/soap-envelope", "Body"); - } catch (SDORuntimeException e) - { - dataFactory->addType("http://www.w3.org/2003/05/soap-envelope", "RootType", false, false, false); - dataFactory->addType("http://www.w3.org/2003/05/soap-envelope", "Body", false, true, false); - dataFactory->addPropertyToType( - "http://www.w3.org/2003/05/soap-envelope", "RootType", - "Body", - "http://www.w3.org/2003/05/soap-envelope", "Body", - false, false, true); - - dataFactory->addType("http://schemas.xmlsoap.org/soap/envelope/", "RootType", false, false, false); - dataFactory->addType("http://schemas.xmlsoap.org/soap/envelope/", "Body", false, true, false); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/soap/envelope/", "RootType", - "Body", - "http://schemas.xmlsoap.org/soap/envelope/", "Body", - false, false, true); - } - } - - WSServiceWrapper::~WSServiceWrapper() - { - } - - /// - /// This method will be called when a web service call needs to be made. - /// - void WSServiceWrapper::invoke(Operation& operation) - { - LOGENTRY(1, "WSServiceWrapper::invoke"); - - const string& operationName = operation.getName(); - - LOGINFO_2(2,"Service: %s, Operation: %s", getService()->getType()->getName().c_str() , operationName.c_str()); - - for (unsigned int i=0; igetComponent(); - - Axis2Client client(compositeReference); - client.invoke(operation); - - LOGEXIT(1, "WSServiceWrapper::invoke"); - } - - } // End namespace ws - } // End namespace sca -} // End namespace tuscany - - - diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceWrapper.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceWrapper.h deleted file mode 100644 index 93607db4a2..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceWrapper.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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_ws_wsservicewrapper_h -#define tuscany_sca_extension_ws_wsservicewrapper_h - -#include "tuscany/sca/core/ServiceWrapper.h" -#include "tuscany/sca/core/Operation.h" -#include "tuscany/sca/model/Service.h" - -using namespace tuscany::sca::model; - - -namespace tuscany -{ - namespace sca - { - - namespace ws - { - - class WSServiceWrapper : public ServiceWrapper - { - public: - - /** - * Constructor. - * @param target The service wrapper represents a Web service. - */ - WSServiceWrapper(Service* service); - - /** - * Destructor - */ - virtual ~WSServiceWrapper(); - - /** - * 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); - }; - } // End namespace ws - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_ws_wsservicewrapper_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/model/WSServiceBinding.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/model/WSServiceBinding.cpp deleted file mode 100644 index 8980ec489b..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/model/WSServiceBinding.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/* - * 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/ws/model/WSServiceBinding.h" -#include "tuscany/sca/core/ServiceWrapper.h" -#include "tuscany/sca/ws/WSServiceWrapper.h" - -namespace tuscany -{ - namespace sca - { - namespace ws - { - - // Constructor - WSServiceBinding::WSServiceBinding(Service* service, const string& uri, const string& endpoint, const string& version) - : ServiceBinding(service, uri), endpoint(endpoint), soapVersion(version) - { - parseEndpoint(); - - serviceWrapper = new WSServiceWrapper(service); - } - - void WSServiceBinding::parseEndpoint() - { - // Endpoint is of the form: #wsdl.endpoint(/) - string::size_type hash = endpoint.find("#"); - if (hash != string::npos) - { - // Found a hash - - // Namepace is the part before the # - wsdlNamespaceURL = endpoint.substr(0, hash); - - - if ( (hash+1) < endpoint.length()) - { - // Check the next part is wsdl.endpoint( - int ending = hash+15; - string check = endpoint.substr(hash+1, 14); - if (check.compare("wsdl.endpoint(") == 0) - { - // Find the matching ) - int endBracket = endpoint.find(")",ending); - if (endBracket-1 > ending+1) - { - string serviceAndEndpoint = endpoint.substr(ending, endBracket-ending); - // Look for a '/' - string::size_type slash = serviceAndEndpoint.find("/"); - if (slash != string::npos) - { - serviceName = serviceAndEndpoint.substr(0, slash); - - if ( (slash+1) < serviceAndEndpoint.length()) - { - endpointName = serviceAndEndpoint.substr(slash+1); - } - else - { - endpointName = ""; - } - - } - else - { - // No '/' so all of it is the service name - serviceName = serviceAndEndpoint; - endpointName = ""; - - } - } - else - { - // Nothing between the () - serviceName = ""; - endpointName = ""; - } - } - else - { - // not the correct characters after the #, ignore the rest - serviceName = ""; - endpointName = ""; - } - - } - else - { - // Nothing after the hash - serviceName = ""; - endpointName = ""; - } - } - else - { - // No hash at all - wsdlNamespaceURL = endpoint; - serviceName = ""; - endpointName = ""; - } - } - - // Destructor - WSServiceBinding::~WSServiceBinding() - { - } - - ServiceWrapper* WSServiceBinding::getServiceWrapper() - { - return serviceWrapper; - } - - } // End namespace ws - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/model/WSServiceBinding.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/model/WSServiceBinding.h deleted file mode 100644 index 15691ce6eb..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/model/WSServiceBinding.h +++ /dev/null @@ -1,137 +0,0 @@ -/* - * 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_ws_model_wsservicebinding_h -#define tuscany_sca_extension_ws_model_wsservicebinding_h - -#include "tuscany/sca/model/ServiceBinding.h" -#include "tuscany/sca/model/Service.h" - -#include -using std::string; - -namespace tuscany -{ - namespace sca - { - namespace ws - { - /** - * Information about a web service binding for service or a reference. - */ - class WSServiceBinding : public model::ServiceBinding - { - public: - - /** - * Constructor. - * @param uri The uri of the binding. - * @param endpoint The definition of the endpoint to which the service - * or reference is to be bound. This is of the form - * "namespace"#endpoint("service"/"endpoint") - */ - WSServiceBinding(model::Service* service, const string& uri, const string& endpoint, const string& version); - - /** - * Destructor. - */ - virtual ~WSServiceBinding(); - - /** - * Returns the type of binding. - */ - virtual string getType() { return "http://www.osoa.org/xmlns/sca/1.0#WebServiceBinding"; }; - - /** - * Create a wrapper for the service configured by this - * binding. - */ - virtual ServiceWrapper* getServiceWrapper(); - - /** - * Return the part of the endpoint definition describing the wsdl - * namespace. - * @return The wsdl namespace. - */ - string getWSDLNamespaceURL() const { return wsdlNamespaceURL; }; - - /** - * Return the service part of the endpoint definition. - * @return The service to use. - */ - string getServiceName() const { return serviceName; }; - - /** - * Return the endpoint name part of the endpoint definition. - * @return The endpoint name to use. - */ - string getEndpointName() const { return endpointName; }; - - /** - * Return the SOAP version. - * @return The SOAP version to use. - */ - string getSOAPVersion() const { return soapVersion; }; - - private: - - /** - * Parse the endpoint specification. - */ - void parseEndpoint(); - - /** - * The full endpoint string. - */ - string endpoint; - - /** - * Namespace from the endpoint. - */ - string wsdlNamespaceURL; - - /** - * Service name from the endpoint. - */ - string serviceName; - - /** - * WSDL Endpoint name. - */ - string endpointName; - - /** - * SOAP version. - */ - string soapVersion; - - /** - * The wrapper for the service configured by this binding. - */ - ServiceWrapper* serviceWrapper; - - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_extension_ws_model_wsservicebinding_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/deploy.bat b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/deploy.bat deleted file mode 100644 index 2bba10425c..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/reference/deploy.bat +++ /dev/null @@ -1,65 +0,0 @@ -@echo off - -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. - - -setlocal - -if . == .%1 ( -echo sca root not specified -goto usage -) -set rootdir=%1 -set deploydir=%rootdir%\deploy -set extdir=%deploydir%\extensions -set wsextdir=%extdir%\ws -set refextdir=%wsextdir%\reference -set srcdir=%rootdir%\runtime\extensions\ws\reference - -if . == .%2 ( -echo input directory not specified -goto usage -) -set inpath=%2 -echo %inpath% - -call %srcdir%\..\deploy.bat %rootdir% - -if not exist %deploydir% mkdir %deploydir% -if not exist %extdir% mkdir %extdir% -if not exist %wsextdir% mkdir %wsextdir% -if not exist %refextdir% mkdir %refextdir% -if not exist %refextdir%\bin mkdir %refextdir%\bin -if not exist %refextdir%\lib mkdir %refextdir%\lib - -set libname=tuscany_sca_ws_reference - -del %refextdir%\bin\%libname%.* -del %refextdir%\lib\%libname%.* - -copy %inpath%\%libname%.lib %refextdir%\lib -copy %inpath%\%libname%.dll %refextdir%\bin - -if exist %inpath%\%libname%.pdb copy %inpath%\%libname%.pdb %refextdir%\bin - -goto end -:usage -echo Usage: deploy -:end - -endlocal diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/Makefile.am b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/Makefile.am deleted file mode 100644 index 18e9ba89b9..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ -# 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. - -SUBDIRS = axis2c diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/Makefile.am b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/Makefile.am deleted file mode 100644 index feadf9e317..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ -# 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. - -SUBDIRS = src \ No newline at end of file diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/Makefile.am b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/Makefile.am deleted file mode 100644 index 37ab185259..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/Makefile.am +++ /dev/null @@ -1,86 +0,0 @@ -# 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/ws/service/lib -lib_LTLIBRARIES = \ -libtuscany_sca_ws_service.la \ -libtuscany_sca_ws_dispatcher.la - -noinst_HEADERS = \ -tuscany/sca/ws/*.h \ -tuscany/sca/ws/model/*.h - -libtuscany_sca_ws_service_la_SOURCES = \ -tuscany/sca/ws/WSReferenceBindingExtension.cpp \ -tuscany/sca/ws/model/WSReferenceBinding.cpp \ -tuscany/sca/ws/WSServiceProxy.cpp \ -tuscany/sca/ws/Axis2Service.cpp \ -tuscany/sca/ws/Axis2Utils.cpp - -libtuscany_sca_ws_service_la_LIBADD = \ - -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo -ltuscany_sdo_axiom \ - -L$(top_builddir)/runtime/core/src -ltuscany_sca \ - -L$(AXIS2C_HOME)/lib \ - -laxis2_util \ - -laxis2_axiom \ - -laxis2_wsdl \ - -laxis2_engine \ - -laxis2_parser \ - -laxis2_minizip \ - -lpthread \ - -lwoden \ - -laxis2_http_sender \ - -laxis2_http_receiver - -rootdir=$(prefix)/extensions/ws/service -root_DATA = axis2.xml -root_SCRIPTS = deploy.sh - -libtuscany_sca_ws_dispatcher_la_SOURCES = \ -tuscany/sca/ws/Axis2Dispatcher.cpp \ -tuscany/sca/ws/Axis2DispatcherModule.cpp - -libtuscany_sca_ws_dispatcher_la_LIBADD = \ - -L$(AXIS2C_HOME)/lib \ - -laxis2_util \ - -laxis2_axiom \ - -laxis2_wsdl \ - -laxis2_engine \ - -laxis2_parser \ - -laxis2_minizip \ - -lpthread \ - -lwoden \ - -laxis2_http_sender \ - -laxis2_http_receiver - -servicedir=$(rootdir)/services/tuscany -service_DATA = services.xml - -moduledir=$(rootdir)/modules/tuscany -module_DATA = module.xml - -EXTRA_DIST = axis2.xml services.xml module.xml deploy.sh - -install-data-hook: - cd $(servicedir); ln -s -f ../../lib/libtuscany_sca_ws_service.so libtuscany_sca_ws_service.so - cd $(moduledir); ln -s -f ../../lib/libtuscany_sca_ws_dispatcher.so libtuscany_sca_ws_dispatcher.so - -INCLUDES = -I$(top_builddir)/runtime/core/src \ - -I${TUSCANY_SDOCPP}/include \ - -I${AXIS2C_HOME}/include - -AM_CPPFLAGS = $(CPPFLAGS) -D_DEBUG diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/axis2.xml b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/axis2.xml deleted file mode 100644 index 641085466e..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/axis2.xml +++ /dev/null @@ -1,181 +0,0 @@ - - - - - - false - false - false - true - - admin - axis2 - - . - - 127.0.0.1 - 5555 - - - - - - - - - - - - - - - - - - - - - - - - - 6060 - - - - - - - - - - - - HTTP/1.1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/deploy.cmd b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/deploy.cmd deleted file mode 100644 index 6493e1cec9..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/deploy.cmd +++ /dev/null @@ -1,39 +0,0 @@ -@echo off -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. - - -rem Will deploy the Tuscany SCA WS service Axis2C service and module -rem to the correct places within the AXIS2C_HOME directory -setlocal -set currentPath=%~d0%~p0 - -if "%AXIS2C_HOME%" == "" ( -echo "AXIS2C_HOME not set" -goto end -) -echo Deploying to Axis2C installed at %AXIS2C_HOME% - -if not exist %AXIS2C_HOME%\services\tuscany mkdir %AXIS2C_HOME%\services\tuscany -if not exist %AXIS2C_HOME%\modules\tuscany mkdir %AXIS2C_HOME%\modules\tuscany - -copy %currentPath%\services\tuscany\* %AXIS2C_HOME%\services\tuscany -copy %currentPath%\modules\tuscany\* %AXIS2C_HOME%\modules\tuscany -copy %currentPath%\axis2.xml %AXIS2C_HOME%\axis2.xml - -:end -endlocal diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/deploy.sh b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/deploy.sh deleted file mode 100755 index ffe571b0ee..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/deploy.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh - -# 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. - -APFULLDIR=`pwd` - -if [ x$AXIS2C_HOME = x ]; then -echo "AXIS2C_HOME not set" -exit; -fi -echo "Deploying to Axis2C installed at $AXIS2C_HOME" - -if ! [ -d $AXIS2C_HOME/services/tuscany ]; then - mkdir $AXIS2C_HOME/services/tuscany -fi - -if ! [ -d $AXIS2C_HOME/modules/tuscany ]; then - mkdir $AXIS2C_HOME/modules/tuscany -fi - -cp $APFULLDIR/services/tuscany/services.xml $AXIS2C_HOME/services/tuscany - -if ! [ -f $AXIS2C_HOME/services/tuscany/libtuscany_sca_ws_service.so ]; then - ln -s $APFULLDIR/services/tuscany/libtuscany_sca_ws_service.so $AXIS2C_HOME/services/tuscany/libtuscany_sca_ws_service.so -fi - -cp $APFULLDIR/modules/tuscany/module.xml $AXIS2C_HOME/modules/tuscany -if ! [ -f $AXIS2C_HOME/modules/tuscany/libtuscany_sca_ws_dispatcher.so ]; then - ln -s $APFULLDIR/modules/tuscany/libtuscany_sca_ws_dispatcher.so $AXIS2C_HOME/modules/tuscany/libtuscany_sca_ws_dispatcher.so -fi - -cp $APFULLDIR/axis2.xml $AXIS2C_HOME/axis2.xml diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/module.xml b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/module.xml deleted file mode 100644 index 97d4d43a86..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/module.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/services.xml b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/services.xml deleted file mode 100644 index 335d4d96be..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/services.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - tuscany_sca_ws_service - - - diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Dispatcher.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Dispatcher.cpp deleted file mode 100644 index fe3eb52064..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Dispatcher.cpp +++ /dev/null @@ -1,176 +0,0 @@ -/* - * 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$ */ - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#pragma warning(disable: 4091) -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -extern "C" -{ - -axis2_status_t AXIS2_CALL -Axis2Dispatcher_invoke ( - axis2_handler_t * handler, - const axis2_env_t *env, - struct axis2_msg_ctx *msg_ctx); - -axis2_svc_t *AXIS2_CALL -Axis2Dispatcher_find_svc( - axis2_msg_ctx_t *msg_ctx, - const axis2_env_t *env); - -axis2_op_t *AXIS2_CALL -Axis2Dispatcher_find_op( - axis2_msg_ctx_t *msg_ctx, - const axis2_env_t *env, - axis2_svc_t *svc); - -AXIS2_EXPORT axis2_handler_t* AXIS2_CALL -Axis2Dispatcher_create(const axis2_env_t *env, - axis2_qname_t *qname) -{ - axis2_handler_t *handler = NULL; - - handler = axis2_handler_create(env); - if (!handler) - { - return NULL; - } - - /* handler init is handled by conf loading, so no need to do it here */ - - /* set the base struct's invoke op */ - if (handler->ops) - handler->ops->invoke = Axis2Dispatcher_invoke; - - return handler; -} - -axis2_svc_t *AXIS2_CALL -Axis2Dispatcher_find_svc( - axis2_msg_ctx_t *msg_ctx, - const axis2_env_t *env) -{ - axis2_svc_t *svc = NULL; - - AXIS2_ENV_CHECK(env, NULL); - - axis2_conf_ctx_t *conf_ctx = NULL; - conf_ctx = AXIS2_MSG_CTX_GET_CONF_CTX(msg_ctx, env); - if (conf_ctx) - { - axis2_conf_t *conf = NULL; - conf = AXIS2_CONF_CTX_GET_CONF(conf_ctx, env); - if (conf) - { - axis2_char_t* service_name = "TuscanyService"; - svc = AXIS2_CONF_GET_SVC(conf, env, service_name); - if (svc) - { - AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, - "Service found using target endpoint address"); - } - } - } - - return svc; -} - -axis2_op_t *AXIS2_CALL -Axis2Dispatcher_find_op( - axis2_msg_ctx_t *msg_ctx, - const axis2_env_t *env, - axis2_svc_t *svc) -{ - axis2_op_t *op = NULL; - - AXIS2_ENV_CHECK(env, NULL); - - axis2_qname_t *op_qname = NULL; - axis2_char_t* execute_op_name = "execute"; - op_qname = axis2_qname_create(env, execute_op_name, NULL, NULL); - - op = AXIS2_SVC_GET_OP_WITH_NAME(svc, env, AXIS2_QNAME_GET_LOCALPART(op_qname, env)); - - AXIS2_QNAME_FREE(op_qname, env); - if (op) - { - AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, - "TuscanyService execute operation found"); - } - return op; -} - -axis2_status_t AXIS2_CALL -Axis2Dispatcher_invoke( - axis2_handler_t * handler, - const axis2_env_t *env, - struct axis2_msg_ctx *msg_ctx) -{ - AXIS2_ENV_CHECK(env, AXIS2_FAILURE); - - if (!(AXIS2_MSG_CTX_GET_SERVER_SIDE(msg_ctx, env))) - return AXIS2_SUCCESS; - - msg_ctx->ops->find_svc = Axis2Dispatcher_find_svc; - msg_ctx->ops->find_op = Axis2Dispatcher_find_op; - - axis2_svc_t *axis_service = NULL; - axis2_op_t *op = NULL; - - axis_service = AXIS2_MSG_CTX_GET_SVC(msg_ctx, env); - - if (!axis_service) - { - axis_service = AXIS2_MSG_CTX_FIND_SVC(msg_ctx, env); - if (axis_service) - { - AXIS2_MSG_CTX_SET_SVC(msg_ctx, env, axis_service); - /*TODO Set the Service Group Context to the message Context*/ - } - } - op = AXIS2_MSG_CTX_GET_OP(msg_ctx, env); - if (!op) - { - op = AXIS2_MSG_CTX_FIND_OP(msg_ctx, env, axis_service); - - if (op) - { - AXIS2_MSG_CTX_SET_OP(msg_ctx, env, op); - } - } - - return AXIS2_SUCCESS; -} - -} diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2DispatcherModule.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2DispatcherModule.cpp deleted file mode 100644 index 0dc8f3358a..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2DispatcherModule.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/* - * 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$ */ - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#pragma warning(disable: 4091) -#endif - -#include -#include -#include -#include - -extern "C" -{ - -axis2_status_t AXIS2_CALL -Axis2DispatcherModule_shutdown(axis2_module_t *module, - const axis2_env_t *env); - -axis2_status_t AXIS2_CALL -Axis2DispatcherModule_init( - axis2_module_t *module, - const axis2_env_t *env, - axis2_conf_ctx_t *conf_ctx, - axis2_module_desc_t *module_desc); - -axis2_status_t AXIS2_CALL -Axis2DispatcherModule_fill_handler_create_func_map(axis2_module_t *module, - const axis2_env_t *env); - -AXIS2_EXTERN axis2_handler_t* AXIS2_CALL -Axis2Dispatcher_create(const axis2_env_t *env, - axis2_qname_t *qname); - -axis2_module_t * -Axis2DispatcherModule_create(const axis2_env_t *env) -{ - axis2_module_t *module = NULL; - module = (axis2_module_t*)AXIS2_MALLOC(env->allocator, - sizeof(axis2_module_t)); - - - module->ops = (axis2_module_ops_t*)AXIS2_MALLOC( - env->allocator, sizeof(axis2_module_ops_t)); - - module->ops->shutdown = Axis2DispatcherModule_shutdown; - module->ops->init = Axis2DispatcherModule_init; - module->ops->fill_handler_create_func_map = - Axis2DispatcherModule_fill_handler_create_func_map; - - return module; -} - -axis2_status_t AXIS2_CALL -Axis2DispatcherModule_init( - axis2_module_t *module, - const axis2_env_t *env, - axis2_conf_ctx_t *conf_ctx, - axis2_module_desc_t *module_desc) -{ - return AXIS2_SUCCESS; -} - -axis2_status_t AXIS2_CALL -Axis2DispatcherModule_shutdown(axis2_module_t *module, - const axis2_env_t *env) -{ - if(module->ops) - { - AXIS2_FREE(env->allocator, module->ops); - module->ops = NULL; - } - - if(module->handler_create_func_map) - { - axis2_hash_free(module->handler_create_func_map, env); - module->handler_create_func_map = NULL; - } - - if(module) - { - AXIS2_FREE(env->allocator, module); - module = NULL; - } - return AXIS2_SUCCESS; -} - -axis2_status_t AXIS2_CALL -Axis2DispatcherModule_fill_handler_create_func_map(axis2_module_t *module, - const axis2_env_t *env) -{ - AXIS2_ENV_CHECK(env, AXIS2_FAILURE); - - module->handler_create_func_map = axis2_hash_make(env); - axis2_hash_set(module->handler_create_func_map, "TuscanyDispatcher", - (axis2_ssize_t)AXIS2_HASH_KEY_STRING, (const void *)Axis2Dispatcher_create); - - return AXIS2_SUCCESS; -} - -/** - * Following block distinguish the exposed part of the dll. - */ - -AXIS2_EXPORT int -axis2_get_instance(axis2_module_t **inst, - const axis2_env_t *env) -{ - *inst = Axis2DispatcherModule_create(env); - if(!(*inst)) - { - return AXIS2_FAILURE; - } - - return AXIS2_SUCCESS; -} - -AXIS2_EXPORT int -axis2_remove_instance(axis2_module_t *inst, - const axis2_env_t *env) -{ - axis2_status_t status = AXIS2_FAILURE; - if (inst) - { - status = Axis2DispatcherModule_shutdown(inst, env); - } - return status; -} - -} diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Service.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Service.cpp deleted file mode 100644 index 046a6e221b..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Service.cpp +++ /dev/null @@ -1,506 +0,0 @@ -/* - * 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$ */ - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#pragma warning(disable: 4091) -#endif - -#include -#include -#include -#include -#include -#include - -#include -using commonj::sdo::DataObjectPtr; -using commonj::sdo::DataFactoryPtr; -using commonj::sdo::DataObjectList; -using commonj::sdo::PropertyList; -using commonj::sdo_axiom::AxiomHelper; - -#include "tuscany/sca/util/Exceptions.h" -#include "WSServiceProxy.h" -#include "model/WSReferenceBinding.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/CompositeService.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Reference.h" -#include "tuscany/sca/model/ReferenceType.h" -#include "tuscany/sca/model/WSDLDefinition.h" -#include "tuscany/sca/model/WSDLOperation.h" -#include "tuscany/sca/model/WSDLInterface.h" -#include "tuscany/sca/model/Interface.h" -#include "tuscany/sca/core/TuscanyRuntime.h" -#include "tuscany/sca/core/SCARuntime.h" -#include "tuscany/sca/util/Utils.h" -#include "Axis2Utils.h" - -using namespace tuscany::sca; -using namespace tuscany::sca::ws; -using namespace tuscany::sca::model; - -int AXIS2_CALL -Axis2Service_free(axis2_svc_skeleton_t *svc_skeleton, - const axis2_env_t *env); - -/* - * This method invokes the right service method - */ -axiom_node_t* AXIS2_CALL -Axis2Service_invoke(axis2_svc_skeleton_t *svc_skeleton, - const axis2_env_t *env, - axiom_node_t *node, - axis2_msg_ctx_t *msg_ctx); - -int AXIS2_CALL Axis2Service_init(axis2_svc_skeleton_t *svc_skeleton, - const axis2_env_t *env); - -axis2_svc_skeleton_t * -axis2_Axis2Service_create(axis2_env_t *env) -{ - axis2_svc_skeleton_t *svc_skeleton = NULL; - svc_skeleton = (axis2_svc_skeleton_t *) AXIS2_MALLOC((env)->allocator, - sizeof(axis2_svc_skeleton_t)); - - - svc_skeleton->ops = (axis2_svc_skeleton_ops_t *) AXIS2_MALLOC( - (env)->allocator, sizeof(axis2_svc_skeleton_ops_t)); - - svc_skeleton->func_array = NULL; - - svc_skeleton->ops->free = Axis2Service_free; - svc_skeleton->ops->init = Axis2Service_init; - svc_skeleton->ops->invoke = Axis2Service_invoke; - /*svc_skeleton->ops->on_fault = Axis2Service_on_fault;*/ - - return svc_skeleton; -} - -int AXIS2_CALL -Axis2Service_init(axis2_svc_skeleton_t *svc_skeleton, - const axis2_env_t *env) -{ - // This method never seems to be called - an old Axis2C artifact? - - svc_skeleton->func_array = axis2_array_list_create(env, 0); - return AXIS2_SUCCESS; -} - -int AXIS2_CALL -Axis2Service_free(axis2_svc_skeleton_t *svc_skeleton, - const axis2_env_t *env) -{ - /*if(svc_skeleton->func_array) - { - AXIS2_ARRAY_LIST_FREE(svc_skeleton->func_array, env); - svc_skeleton->func_array = NULL; - }*/ - - if(svc_skeleton->ops) - { - AXIS2_FREE((env)->allocator, svc_skeleton->ops); - svc_skeleton->ops = NULL; - } - - if(svc_skeleton) - { - AXIS2_FREE((env)->allocator, svc_skeleton); - svc_skeleton = NULL; - } - return AXIS2_SUCCESS; -} - -/** - * Initialize the Tuscany runtime - */ - -static string systemRoot = ""; -static string componentName = ""; -static string serviceName = ""; -static TuscanyRuntime* tuscanyRuntime = NULL; -static CompositeService* compositeService = NULL; - -void initTuscanyRuntime(const axis2_env_t *env, const char* root, const char *component, const char* service) -{ - AXIS2_LOG_INFO((env)->log, "Axis2Service init, root: %s, component: %s, service: %s\n", root, component, service); - try - { - - bool newInitParams = false; - - if(systemRoot != root) - { - systemRoot = root; - newInitParams = true; - } - - if(componentName != component) - { - componentName = component; - newInitParams = true; - } - - if(serviceName != service) - { - serviceName = service; - newInitParams = true; - } - - if(tuscanyRuntime == NULL) - { - AXIS2_LOG_INFO((env)->log, "Creating new Tuscany runtime\n"); - tuscanyRuntime = new TuscanyRuntime(componentName, systemRoot); - tuscanyRuntime->start(); - } - else if(tuscanyRuntime != NULL && newInitParams) - { - AXIS2_LOG_INFO((env)->log, "Restarting Tuscany runtime\n"); - tuscanyRuntime->stop(); - tuscanyRuntime->setDefaultComponentName(componentName); - tuscanyRuntime->setSystemRoot(systemRoot); - tuscanyRuntime->start(); - } - - if(compositeService == NULL) - { - Composite* composite = (Composite*)SCARuntime::getInstance()->getDefaultComponent()->getType(); - compositeService = (CompositeService*)composite->findComponent(serviceName); - } - else - { - if(newInitParams) - { - Composite* composite = SCARuntime::getInstance()->getDefaultComponent()->getComposite(); - compositeService = (CompositeService*)composite->findComponent(serviceName); - } - } - } - catch(TuscanyRuntimeException &ex) - { - AXIS2_LOG_ERROR((env)->log, AXIS2_LOG_SI, "%s has been caught: %s\n", ex.getEClassName(), ex.getMessageText()); - } -} - - -/* - * This method invokes the target service method - */ -axiom_node_t* AXIS2_CALL -Axis2Service_invoke(axis2_svc_skeleton_t *svc_skeleton, - const axis2_env_t *env, - axiom_node_t *node, - axis2_msg_ctx_t *msg_ctx) -{ - if (node) - { - if (AXIOM_NODE_GET_NODE_TYPE(node, env) == AXIOM_ELEMENT) - { - axiom_element_t *element = NULL; - element = (axiom_element_t *)AXIOM_NODE_GET_DATA_ELEMENT(node, env); - if (element) - { - string op_name = ""; - axis2_bool_t rest = AXIS2_MSG_CTX_GET_DOING_REST(msg_ctx, env); - if (rest) - { - axis2_endpoint_ref_t *endpoint_ref = AXIS2_MSG_CTX_GET_FROM(msg_ctx, env); - if (endpoint_ref) - { - const axis2_char_t *address = AXIS2_ENDPOINT_REF_GET_ADDRESS(endpoint_ref, env); - if (address) - { - axis2_char_t **url_tokens = axis2_parse_request_url_for_svc_and_op(env, address); - if (url_tokens) - { - if (url_tokens[1]) - { - op_name = url_tokens[1]; - } - if (NULL != url_tokens[1]) - AXIS2_FREE(env->allocator, url_tokens[1]); - if (NULL != url_tokens[0]) - AXIS2_FREE(env->allocator, url_tokens[0]); - AXIS2_FREE(env->allocator, url_tokens); - } - } - } - } - else - { - // This gets the operation name from the root element name - this is correct for DocLit Wrapped style - op_name = AXIOM_ELEMENT_GET_LOCALNAME(element, env); - } - - if (op_name != "") - { - // Get the Tuscany system root and composite service name from the Axis2 - // service parameters - char* rootParam = Axis2Utils::getAxisServiceParameterValue(env, msg_ctx, "TuscanySystemRoot"); - if (rootParam == NULL) - rootParam = ""; - - char* serviceParam = Axis2Utils::getAxisServiceParameterValue(env, msg_ctx, "TuscanyService"); - if (serviceParam != NULL) - { - AXIS2_LOG_INFO((env)->log, "Axis2Service invoke called with system root: %s, service name: %s, operation name: %s", rootParam, serviceParam, op_name.c_str()); - - // Service is of the form "component name"/"composite service name" - string component, service; - Utils::rTokeniseString("/", serviceParam, component, service); - - initTuscanyRuntime(env, rootParam, component.c_str(), service.c_str()); - } - else { - - // Use the default system root and component, the service is - // derived from the target address - axis2_endpoint_ref_t *endpoint_ref = NULL; - endpoint_ref = AXIS2_MSG_CTX_GET_FROM(msg_ctx, env); - axis2_char_t *address = NULL; - address = (axis2_char_t*) AXIS2_ENDPOINT_REF_GET_ADDRESS(endpoint_ref, env); - axis2_char_t **url_tokens = NULL; - url_tokens = axis2_parse_request_url_for_svc_and_op(env, address); - string service(url_tokens[0]); - - AXIS2_LOG_INFO((env)->log, "Axis2Service invoke called with system root: %s, service name: %s, operation name: %s", rootParam, service.c_str(), op_name.c_str()); - - initTuscanyRuntime(env, rootParam, "", service.c_str()); - } - - if(!compositeService) - { - AXIS2_LOG_ERROR((env)->log, AXIS2_LOG_SI, "Axis2Service_invoke: Tuscany initialisation failed"); - return 0; - } - - DataFactoryPtr dataFactory = compositeService->getComposite()->getDataFactory(); - if (dataFactory == 0) - { - AXIS2_LOG_ERROR((env)->log, AXIS2_LOG_SI, "Axis2Service_invoke: CompositeService has no SCA implementation"); - return 0; - } - - // Get the WS binding and the WSDL operation - Composite* composite = compositeService->getComposite(); - Reference* reference = compositeService->getReference(); - WSReferenceBinding* binding = (WSReferenceBinding*)reference->getBinding(); - WSDLOperation wsdlOperation; - - string wsdlNamespace = binding->getWSDLNamespaceURL(); - if (wsdlNamespace != "") - { - - // Lookup the WSDL model from the composite, keyed on the namespace - // (the wsdl will have been loaded at startup) - WSDLDefinition* wsdlDefinition = composite->findWSDLDefinition(wsdlNamespace); - if (wsdlDefinition == 0) - { - AXIS2_LOG_ERROR((env)->log, AXIS2_LOG_SI, "WSDL description %s not found\n", wsdlNamespace.c_str()); - string msg = "WSDL not found for " + wsdlNamespace; - throw SystemConfigurationException(msg.c_str()); - } - - // Find the target operation in the wsdl port type. - try { - wsdlOperation = wsdlDefinition->findOperation( - binding->getServiceName(), - binding->getEndpointName(), - op_name.c_str()); - } - catch(SystemConfigurationException &ex) - { - AXIS2_LOG_ERROR((env)->log, AXIS2_LOG_SI, "SystemConfigurationException has been caught: %s\n", ex.getMessageText()); - throw; - } - - } - else - { - Interface* iface = reference->getType()->getInterface(); - if (iface != NULL && - iface->getInterfaceTypeQName() == WSDLInterface::typeQName) - { - WSDLInterface* wsdlInterface = (WSDLInterface*)iface; - wsdlNamespace = wsdlInterface->getNamespaceURI(); - - if (wsdlNamespace != "") - { - - WSDLDefinition* wsdl = composite->findWSDLDefinition(wsdlNamespace); - if (wsdl == 0) - { - AXIS2_LOG_ERROR((env)->log, AXIS2_LOG_SI, "WSDL description %s not found\n", wsdlNamespace.c_str()); - string msg = "WSDL not found for " + wsdlNamespace; - throw SystemConfigurationException(msg.c_str()); - } - - try - { - wsdlOperation = wsdl->findOperation(wsdlInterface->getName(), op_name.c_str()); - } - catch(SystemConfigurationException &ex) - { - AXIS2_LOG_ERROR((env)->log, AXIS2_LOG_SI, "SystemConfigurationException has been caught: %s\n", ex.getMessageText()); - throw; - } - } - } - } - - if (wsdlNamespace == "") - { - // Create a default document literal wrapped WSDL operation - wsdlNamespace = compositeService->getName(); - wsdlOperation = WSDLOperation(); - wsdlOperation.setOperationName(op_name.c_str()); - wsdlOperation.setSoapAction(wsdlNamespace+ "#" +op_name); - wsdlOperation.setEndpoint(""); - wsdlOperation.setSoapVersion(WSDLOperation::SOAP11); - wsdlOperation.setDocumentStyle(true); - wsdlOperation.setWrappedStyle(true); - wsdlOperation.setEncoded(false); - wsdlOperation.setInputType(wsdlNamespace + "#" + op_name); - wsdlOperation.setOutputType(wsdlNamespace + "#" + op_name + "Response"); - } - - // Convert the input AXIOM node to an SDO DataObject - axiom_node_t* body = AXIOM_NODE_GET_PARENT(node, env); - char* str = NULL; - str = AXIOM_NODE_TO_STRING(body, env); - if (str) - { - AXIS2_LOG_INFO((env)->log, "Axis2Service invoke has request OM: %s\n", str); - } - - // Convert the SOAP body to an SDO DataObject - AxiomHelper* axiomHelper = AxiomHelper::getHelper(); - DataObjectPtr inputBodyDataObject = NULL; - - try - { - inputBodyDataObject = axiomHelper->toSdo(body, dataFactory); - } - catch(SDORuntimeException &ex) - { - AXIS2_LOG_ERROR((env)->log, AXIS2_LOG_SI, "Axis2Service_invoke: SDORuntimeException thrown: %s", ex.getMessageText()); - } - - if(!inputBodyDataObject) - { - AXIS2_LOG_ERROR((env)->log, AXIS2_LOG_SI, "Axis2Service_invoke: Could not convert received Axiom node to SDO"); - /** TODO: return a SOAP fault here */ - return 0; - } - - // Get the first body part representing the doc-lit-wrapped wrapper element - DataObjectPtr inputDataObject = NULL; - PropertyList bpl = inputBodyDataObject->getInstanceProperties(); - if (bpl.size()!=0) - { - if (bpl[0].isMany()) - { - DataObjectList& parts = inputBodyDataObject->getList((unsigned int)0); - inputDataObject = parts[0]; - } - else - { - inputDataObject = inputBodyDataObject->getDataObject(bpl[0]); - } - } - if (inputDataObject == NULL) - { - AXIS2_LOG_ERROR((env)->log, AXIS2_LOG_SI, "Axis2Service_invoke: Could not convert body part to SDO"); - return 0; - } - - // Dispatch to the WS proxy - WSServiceProxy* proxy = (WSServiceProxy*)binding->getServiceProxy(); - - DataObjectPtr outputDataObject = proxy->invoke(wsdlOperation, inputDataObject); - - if(!outputDataObject) - { - AXIS2_LOG_ERROR((env)->log, AXIS2_LOG_SI, "Axis2Service_invoke: Failure whilst invoking CompositeService"); - - /** TODO: return a SOAP fault here */ - return 0; - } - - // Convert the output DataObject to an Axiom node - axiom_node_t* outputNode = axiomHelper->toAxiomNode(outputDataObject, - wsdlOperation.getOutputTypeUri().c_str(), wsdlOperation.getOutputTypeName().c_str()); - - AxiomHelper::releaseHelper(axiomHelper); - - str = AXIOM_NODE_TO_STRING(outputNode, env); - if (str) - { - AXIS2_LOG_INFO((env)->log, "Axis2Service invoke has response OM : %s\n", str); - } - - - //LOGEXIT(1, "Axis2Service_invoke"); - return outputNode; - } - } - } - } - - AXIS2_LOG_ERROR((env)->log, AXIS2_LOG_SI, "Axis2Service_invoke: invalid OM parameters in request"); - //LOGERROR(0, "Axis2Service service ERROR: invalid OM parameters in request\n"); - - /** TODO: return a SOAP fault here */ - return 0; -} - - -extern "C" -{ - -/** - * Following block distinguish the exposed part of the dll. - */ - -AXIS2_EXPORT int axis2_get_instance(axis2_svc_skeleton **inst, - axis2_env_t *env) -{ - *inst = axis2_Axis2Service_create(env); - if(!(*inst)) - { - return AXIS2_FAILURE; - } - - return AXIS2_SUCCESS; -} - -AXIS2_EXPORT int axis2_remove_instance(axis2_svc_skeleton_t *inst, - axis2_env_t *env) -{ - axis2_status_t status = AXIS2_FAILURE; - if (inst) - { - status = AXIS2_SVC_SKELETON_FREE(inst, env); - } - return status; -} -} diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Utils.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Utils.cpp deleted file mode 100644 index 7a30ab2994..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Utils.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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$ */ - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#pragma warning(disable: 4091) -#endif -#include "Axis2Utils.h" - -#include -#include - -#include "tuscany/sca/util/Logging.h" - -using namespace tuscany::sca; -using namespace tuscany::sca::ws; - - -/* Static utility method to retrieve service parameters from the service.xml file - * Get an odd linking error if this method (or the header's it requires) are in - * a different class. - */ -char* Axis2Utils::getAxisServiceParameterValue(const axis2_env_t *env, axis2_msg_ctx_t *msg_ctx, char* parameterName) -{ - struct axis2_svc *svc = NULL; - struct axis2_op_ctx *op_ctx = NULL; - struct axis2_svc_ctx *svc_ctx = NULL; - axis2_param_t *param = NULL; - char* paramValue = NULL; - - LOGENTRY(1, "Axis2Utils::getAxisServiceParameterValue"); - - op_ctx = AXIS2_MSG_CTX_GET_OP_CTX(msg_ctx, env); - svc_ctx = AXIS2_OP_CTX_GET_PARENT(op_ctx, env); - svc = AXIS2_SVC_CTX_GET_SVC(svc_ctx, env); - if(NULL == svc) - { - return NULL; - } - - param = AXIS2_SVC_GET_PARAM(svc, env, parameterName); - if(!param) - { - LOGERROR_1(1,"Axis parameter %s cannot be found", parameterName); - } - else - { - paramValue = (char*) AXIS2_PARAM_GET_VALUE(param, env); - } - - LOGEXIT(1, "Axis2Utils::getAxisServiceParameterValue"); - return paramValue; -} - diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Utils.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Utils.h deleted file mode 100644 index 4e8b069010..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Utils.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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_ws_axis2utils_h -#define tuscany_sca_extension_ws_axis2utils_h - -#include -#include - - -namespace tuscany -{ - namespace sca - { - namespace ws - { - - class Axis2Utils - { - public: - static char* getAxisServiceParameterValue(const axis2_env_t *env, axis2_msg_ctx_t *msg_ctx, char* parameterName); - }; - - } // End namespace ws - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_extension_ws_axis2utils_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSReferenceBindingExtension.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSReferenceBindingExtension.cpp deleted file mode 100644 index 2cf5e5d8e1..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSReferenceBindingExtension.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/* - * 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 "WSReferenceBindingExtension.h" -#include "model/WSReferenceBinding.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/core/SCARuntime.h" - - -extern "C" -{ - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - void tuscany_sca_extension_initialize() - { - tuscany::sca::ws::WSReferenceBindingExtension::initialize(); - } -} - -namespace tuscany -{ - namespace sca - { - namespace ws - { - // =================================================================== - // Constructor for the WSReferenceBinding class. - // =================================================================== - WSReferenceBindingExtension::WSReferenceBindingExtension() - { - LOGENTRY(1, "WSReferenceBindingExtension::constructor"); - LOGEXIT(1, "WSReferenceBindingExtension::constructor"); - } - - // =================================================================== - // Destructor for the WSReferenceBindingExtension class. - // =================================================================== - WSReferenceBindingExtension::~WSReferenceBindingExtension() - { - LOGENTRY(1, "WSReferenceBindingExtension::destructor");; - LOGEXIT(1, "WSReferenceBindingExtension::destructor"); - } - - const string WSReferenceBindingExtension::extensionName("ws"); - const string WSReferenceBindingExtension::typeQName("http://www.osoa.org/xmlns/sca/1.0#WebServiceBinding"); - - // =================================================================== - // loadModelElement - load the info from binding.ws - // =================================================================== - ReferenceBinding* WSReferenceBindingExtension::getReferenceBinding(Composite *composite, Reference* reference, DataObjectPtr scdlBinding) - { - string bindingType = scdlBinding->getType().getName(); - if (bindingType == "WebServiceBinding") - { - string uri = scdlBinding->getCString("uri"); - string endpoint = scdlBinding->getCString("endpoint"); - commonj::sdo::DataObjectList& soap = scdlBinding->getList("soapbinding"); - string version; - if (soap.size()!=0) - { - version = soap.getCString(0); - } - else - { - version = ""; - } - - WSReferenceBinding* serviceBinding = new WSReferenceBinding(reference, uri, endpoint, version); - - return serviceBinding; - } - else - { - return NULL; - } - } - - void WSReferenceBindingExtension::initialize() - { - LOGENTRY(1, "WSReferenceBindingExtension::initialize");; - SCARuntime::getInstance()->registerReferenceBindingExtension(new WSReferenceBindingExtension()); - LOGEXIT(1, "WSReferenceBindingExtension::initialize");; - } - - } // End namespace ws - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSReferenceBindingExtension.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSReferenceBindingExtension.h deleted file mode 100644 index c7972fe15a..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSReferenceBindingExtension.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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_ws_wsreferencebindingextension_h -#define tuscany_sca_extension_ws_wsreferencebindingextension_h - -#include "tuscany/sca/extension/ReferenceBindingExtension.h" - -namespace tuscany -{ - namespace sca - { - namespace ws - { - - class WSReferenceBindingExtension : public ReferenceBindingExtension - { - public: - /** - * Default constructor - */ - WSReferenceBindingExtension(); - - /** - * Destructor - */ - virtual ~WSReferenceBindingExtension(); - - /** - * return the name of the extension - */ - virtual const 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 string& getExtensionTypeQName() {return typeQName;} - - virtual ReferenceBinding* getReferenceBinding(Composite* composite, Reference *reference, DataObjectPtr scdlBinding); - - static void initialize(); - - private: - static const string extensionName; - static const string typeQName; - - }; - - - } // End namespace ws - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_extension_ws_wsreferencebindingextension_h - diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSServiceProxy.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSServiceProxy.cpp deleted file mode 100644 index 960c91ed60..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSServiceProxy.cpp +++ /dev/null @@ -1,587 +0,0 @@ -/* - * 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 "WSServiceProxy.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/util/Exceptions.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/core/SCARuntime.h" -#include "tuscany/sca/model/Reference.h" -#include "tuscany/sca/model/ReferenceType.h" -#include "tuscany/sca/model/Service.h" -#include "tuscany/sca/model/ServiceType.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/ComponentType.h" -#include "tuscany/sca/core/ServiceWrapper.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/ServiceBinding.h" -#include "tuscany/sca/model/WSDLDefinition.h" -#include "tuscany/sca/model/WSDLInterface.h" -#include "tuscany/sca/model/WSDLOperation.h" -#include "model/WSReferenceBinding.h" - -#include "commonj/sdo/SDO.h" -using namespace commonj::sdo; - -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace ws - { - - // ============================ - // Constructor: Create a proxy - // ============================ - WSServiceProxy::WSServiceProxy(Reference* reference) - : ServiceProxy(reference) - { - LOGENTRY(1,"WSServiceProxy::constructor"); - - // Get the target service wrapper - WSReferenceBinding* referenceBinding = (WSReferenceBinding*)reference->getBinding(); - serviceWrapper = referenceBinding->getTargetServiceBinding()->getServiceWrapper(); - - // Define the SOAP Body type and element to allow a SOAP body to - // be loaded in a DataObject - DataFactoryPtr dataFactory = reference->getComponent()->getComposite()->getDataFactory(); - try { - const Type& bodyType = dataFactory->getType("http://www.w3.org/2003/05/soap-envelope", "Body"); - } catch (SDORuntimeException e) - { - - // Define the SOAP 1.2 Body type - dataFactory->addType("http://www.w3.org/2003/05/soap-envelope", "RootType", false, false, false); - dataFactory->addType("http://www.w3.org/2003/05/soap-envelope", "Body", false, true, false); - dataFactory->addPropertyToType( - "http://www.w3.org/2003/05/soap-envelope", "RootType", - "Body", - "http://www.w3.org/2003/05/soap-envelope", "Body", - false, false, true); - - // Define the SOAP 1.1 Body type - dataFactory->addType("http://schemas.xmlsoap.org/soap/envelope/", "RootType", false, false, false); - dataFactory->addType("http://schemas.xmlsoap.org/soap/envelope/", "Body", false, true, false); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/soap/envelope/", "RootType", - "Body", - "http://schemas.xmlsoap.org/soap/envelope/", "Body", - false, false, true); - } - - LOGEXIT(1,"WSServiceProxy::constructor"); - } - - // ========== - // Destructor - // ========== - WSServiceProxy::~WSServiceProxy() - { - LOGENTRY(1,"WSServiceProxy::destructor"); - LOGEXIT(1,"WSServiceProxy::destructor"); - } - - /// - /// This method will be called to process an operation invocation. - /// - DataObjectPtr WSServiceProxy::invoke(const WSDLOperation& wsdlOperation, DataObjectPtr inputDataObject) - { - LOGENTRY(1,"WSServiceProxy::invoke"); - - Reference* reference = getReference(); - Component* component = reference->getComponent(); - Composite* composite = component ->getComposite(); - - WSReferenceBinding* referenceBinding = (WSReferenceBinding*)reference->getBinding(); - DataFactoryPtr dataFactoryPtr = reference->getComponent()->getComposite()->getDataFactory(); - - bool documentStyle = wsdlOperation.isDocumentStyle(); - bool wrappedStyle = wsdlOperation.isWrappedStyle(); - - const char* outputTypeURI = wsdlOperation.getOutputTypeUri().c_str(); - const char* outputTypeName = wsdlOperation.getOutputTypeName().c_str(); - - LOGINFO_2(4, "WSServiceProxy has got WSDLOperation with inputType: %s#%s", - wsdlOperation.getInputTypeUri().c_str(), - wsdlOperation.getInputTypeName().c_str()); - LOGINFO_2(4, "WSServiceProxy has got WSDLOperation with outputType: %s#%s", - outputTypeURI, - outputTypeName); - LOGINFO_2(4, "WSServiceProxy has got WSDLOperation with documentStyle=%d and wrapped=%d", - documentStyle, - wrappedStyle); - - if (documentStyle) - { - if (wrappedStyle) - { - - // Create new Operation object and set parameters and return value - Operation operation(wsdlOperation.getOperationName().c_str()); - - // Go through the input data object to set the operation parameters - PropertyList pl = inputDataObject->getInstanceProperties(); - - for(int i=0; igetBoolean(pl[i]); - operation.addParameter(boolData); - } - break; - case Type::ByteType: - { - char* byteData = new char; - *byteData = inputDataObject->getByte(pl[i]); - operation.addParameter(byteData); - } - break; - case Type::BytesType: - { - int len = inputDataObject->getLength(pl[i]); - char* bytesData = new char[len+1]; - int bytesWritten = inputDataObject->getBytes(pl[i], bytesData, len); - // Ensure the bytes end with the null char. Not sure if this is neccessary - if(bytesWritten <= len) - { - bytesData[bytesWritten] = 0; - } - else - { - bytesData[len] = 0; - } - operation.addParameter(&bytesData); - } - break; - case Type::CharacterType: - { - // This code should work but won't be used as there is no mapping from an XSD type to the SDO CharacterType - wchar_t* charData = new wchar_t; - *charData = inputDataObject->getCharacter(pl[i]); - operation.addParameter(charData); - } - break; - case Type::DoubleType: - { - long double* doubleData = new long double; - *doubleData = inputDataObject->getDouble(pl[i]); - operation.addParameter(doubleData); - } - break; - case Type::FloatType: - { - float* floatData = new float; - *floatData = inputDataObject->getFloat(pl[i]); - operation.addParameter(floatData); - } - break; - case Type::IntegerType: - { - long* intData = new long; - *intData = inputDataObject->getInteger(pl[i]); - operation.addParameter(intData); - } - break; - case Type::ShortType: - { - short* shortData = new short; - *shortData = inputDataObject->getShort(pl[i]); - operation.addParameter(shortData); - } - break; - case Type::StringType: - { - string* stringData; - if(inputDataObject->isSet(pl[i])) - { - stringData = new string(inputDataObject->getCString(pl[i])); - } - else - { - // The data is not set, so pass an empty string as the parameter - stringData = new string(); - } - operation.addParameter(stringData); - } - break; - case Type::DataObjectType: - { - DataObjectPtr dataObjectData = inputDataObject->getDataObject(pl[i]); - if(!dataObjectData) - { - LOGINFO_1(4, "SDO DataObject parameter named %s was null", name); - } - operation.addParameter(&dataObjectData); - } - break; - case Type::OpenDataObjectType: - { - /* - * This code deals with xsd:any element parameters - * Get each element as a DataObject and add in to the parameter list - */ - - DataObjectList& dataObjectList = inputDataObject->getList(pl[i]); - - for(int j=0; jgetSequence(); - if (sequence->size()!=0) - { - // Add a text element - if (sequence->isText(0)) - { - string* stringData = new string(sequence->getCStringValue(0)); - operation.addParameter(stringData); - } - else - { - // Add a complex element DataObject - DataObjectPtr dob = sequence->getDataObjectValue(0); - if(!dob) - { - LOGINFO_1(4, "SDO DataObject parameter named %s was null", name); - } - operation.addParameter(&dob); - } - } - else - { - // Empty content, add an empty string - LOGINFO_2(4, "SDO OpenDataObject parameter named %s[%d] was empty", name, j); - string* stringData = new string(""); - operation.addParameter(stringData); - } - } - } - } - break; - case Type::DateType: - LOGERROR_1(0, "SDO DateType parameters are not yet supported (%s)", name); - return NULL; - case Type::LongType: - LOGERROR_1(0, "SDO LongType (int64_t) parameters are not yet supported (%s)", name); - return NULL; - break; - case Type::UriType: - LOGERROR_1(0, "SDO UriType parameters are not yet supported (%s)", name); - return NULL; - break; - case Type::BigDecimalType: - LOGERROR_1(0, "SDO BigDecimalType parameters are not yet supported (%s)", name); - return NULL; - break; - case Type::BigIntegerType: - LOGERROR_1(0, "SDO BigIntegerType parameters are not yet supported (%s)", name); - return NULL; - break; - default: - LOGERROR_1(0, "Unknown SDO type parameter named %s has been found. Unknown types are not yet supported", name); - return NULL; - } - } - - try - { - - // Call into the target service wrapper - serviceWrapper->invoke(operation); - - // Set the data in the outputDataObject to be returned - DataObjectPtr outputDataObject; - try { - - // Create the output wrapper - const Type& rootType = dataFactoryPtr->getType(outputTypeURI, "RootType"); - const Property& prop = rootType.getProperty(outputTypeName); - const Type& outputType = prop.getType(); - outputDataObject = dataFactoryPtr->create(outputType); - } - catch (SDORuntimeException e) - { - try - { - - // Create the output wrapper - const Type& outputType = dataFactoryPtr->getType(outputTypeURI, outputTypeName); - outputDataObject = dataFactoryPtr->create(outputType); - } - catch (SDORuntimeException e) - { - // The output wrapper type is not known, create an open DataObject - outputDataObject = dataFactoryPtr->create(Type::SDOTypeNamespaceURI, "OpenDataObject"); - } - } - - setOutputData(operation, outputDataObject, dataFactoryPtr); - - LOGEXIT(1,"WSServiceProxy::invoke"); - - return outputDataObject; - - } - catch(SDORuntimeException &ex) - { - // TODO: Return more error information than just a null DataObject - LOGERROR_2(0, "%s has been caught: %s\n", ex.getEClassName(), ex.getMessageText()); - return NULL; - } - catch(TuscanyRuntimeException &ex) - { - // TODO: Return more error information than just a null DataObject - LOGERROR_2(0, "%s has been caught: %s\n", ex.getEClassName(), ex.getMessageText()); - return NULL; - } - } - else - { - LOGERROR(0, "CompositeServices with non-wrapped document style WSDL Operations are not yet supported"); - LOGEXIT(1,"WSServiceProxy::invoke"); - return NULL; - } - } - else - { - // RPC style - LOGERROR(0, "CompositeServices with RPC style WSDL Operations are not yet supported"); - return NULL; - } - } - - - void WSServiceProxy::setOutputData(Operation& operation, DataObjectPtr outputDataObject, DataFactoryPtr dataFactoryPtr) - { - // Go through data object to set the return value - PropertyList pl = outputDataObject->getType().getProperties(); - - if(pl.size() == 0) - { - if(outputDataObject->getType().isOpenType() && outputDataObject->getType().isDataObjectType()) - { - /* - * This code deals with returning xsd:any elements - */ - DataObjectList& l = outputDataObject->getList("return"); - Operation::ParameterType resultType = operation.getReturnType(); - switch(resultType) - { - case Operation::BOOL: - { - l.append(*(bool*)operation.getReturnValue()); - break; - } - case Operation::SHORT: - { - l.append(*(short*)operation.getReturnValue()); - break; - } - case Operation::INT: - { - l.append(*(long*)operation.getReturnValue()); - break; - } - case Operation::LONG: - { - l.append(*(long*)operation.getReturnValue()); - break; - } - case Operation::USHORT: - { - l.append(*(short*)operation.getReturnValue()); - break; - } - case Operation::UINT: - { - l.append(*(long*)operation.getReturnValue()); - break; - } - case Operation::ULONG: - { - l.append(*(long*)operation.getReturnValue()); - break; - } - case Operation::FLOAT: - { - l.append(*(float*)operation.getReturnValue()); - break; - } - case Operation::DOUBLE: - { - l.append(*(long double*)operation.getReturnValue()); - break; - } - case Operation::LONGDOUBLE: - { - l.append(*(long double*)operation.getReturnValue()); - break; - } - case Operation::CHARS: - { - l.append(*(char**)operation.getReturnValue()); - break; - } - case Operation::STRING: - { - l.append((*(string*)operation.getReturnValue()).c_str()); - break; - } - case Operation::DATAOBJECT: - { - l.append(*(DataObjectPtr*)operation.getReturnValue()); - break; - } - default: - { - string msg = "Unsupported parameter type"; - msg += resultType; - throw msg.c_str(); - } - } - } - else - { - LOGINFO(4, "No return values are defined"); - } - } - else { - - // Should only be one return value.. This goes through all return values - for(int i=0; isetBoolean(pl[i], *(bool*)operation.getReturnValue()); - break; - } - case Operation::SHORT: - { - outputDataObject->setShort(pl[i], *(short*)operation.getReturnValue()); - break; - } - case Operation::INT: - { - outputDataObject->setInteger(pl[i], *(int*)operation.getReturnValue()); - break; - } - case Operation::LONG: - { - outputDataObject->setInteger(pl[i], *(long*)operation.getReturnValue()); - break; - } - case Operation::USHORT: - { - outputDataObject->setInteger(pl[i], *(unsigned short*)operation.getReturnValue()); - break; - } - case Operation::UINT: - { - outputDataObject->setInteger(pl[i], *(unsigned int*)operation.getReturnValue()); - break; - } - case Operation::ULONG: - { - outputDataObject->setInteger(pl[i], *(unsigned long*)operation.getReturnValue()); - break; - } - case Operation::FLOAT: - { - outputDataObject->setFloat(pl[i], *(float*)operation.getReturnValue()); - break; - } - case Operation::DOUBLE: - { - outputDataObject->setDouble(pl[i], *(double*)operation.getReturnValue()); - break; - } - case Operation::LONGDOUBLE: - { - outputDataObject->setDouble(pl[i], *(long double*)operation.getReturnValue()); - break; - } - case Operation::CHARS: - { - if(*(char**)operation.getReturnValue() != NULL) - { - outputDataObject->setCString(pl[i], *(char**)operation.getReturnValue()); - } - else - { - LOGINFO_1(4, "Return value is NULL, so leaving property %s unset", pl[i].getName()); - } - break; - } - case Operation::STRING: - { - outputDataObject->setCString(pl[i], (*(string*)operation.getReturnValue()).c_str()); - break; - } - case Operation::DATAOBJECT: - { - - if(*(DataObjectPtr*)operation.getReturnValue() != NULL) - { - outputDataObject->setDataObject(pl[i], *(DataObjectPtr*)operation.getReturnValue()); - } - else - { - LOGINFO_1(4, "Return value is NULL, so leaving property %s unset", pl[i].getName()); - } - - break; - } - default: - { - string msg = "Unsupported parameter type"; - msg += resultType; - throw msg.c_str(); - } - } - } - } - } - - } // End namespace ws - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSServiceProxy.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSServiceProxy.h deleted file mode 100644 index 82ab4385f2..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSServiceProxy.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * 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_ws_wsserviceproxy_h -#define tuscany_sca_extension_ws_wsserviceproxy_h - -#include "tuscany/sca/core/ServiceProxy.h" -#include "tuscany/sca/core/ServiceWrapper.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Reference.h" -#include "tuscany/sca/model/Service.h" -#include "tuscany/sca/model/WSDLOperation.h" -#include "model/WSReferenceBinding.h" -#include "commonj/sdo/SDO.h" - -using namespace tuscany::sca::model; - -using commonj::sdo::DataObjectPtr; -using commonj::sdo::DataFactoryPtr; - -namespace tuscany -{ - namespace sca - { - namespace ws - { - - /** - * Holds a proxy for a given component and reference. - * The proxy which is held inside a ServiceProxy will be specific to the programming - * interface expected by the client. In this particular case the client is an Axis2 - * Web service skeleton. - */ - class WSServiceProxy : public ServiceProxy - { - public: - /** - * Create a new service proxy for a reference. The proxy will contain a pointer to - * the target ServiceWrapper. - * @param reference The reference on the source component. - * @param target The wrapper of the service which is wired to this reference. - */ - WSServiceProxy(Reference* reference); - - /** - * Create a new service proxy for a service. The proxy will contain a pointer to - * the target ServiceWrapper. - * @param reference The service on the target component. - * @param target The wrapper of the target service. - */ - WSServiceProxy(Service* service); - - /** - * Destructor. - */ - virtual ~WSServiceProxy(); - - /** - * Invoke the specified operation - */ - DataObjectPtr invoke(const WSDLOperation& wsdlOperation, DataObjectPtr inputDataObject); - - private: - - void setOutputData(Operation& operation, DataObjectPtr outputDataObject, DataFactoryPtr dataFactoryPtr); - - /** - * The target service wrapper - */ - ServiceWrapper* serviceWrapper; - - }; - - } // End namespace ws - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_extension_ws_wsserviceproxy_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/model/WSReferenceBinding.cpp b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/model/WSReferenceBinding.cpp deleted file mode 100644 index 23ecc133e8..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/model/WSReferenceBinding.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/* - * 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/ws/model/WSReferenceBinding.h" -#include "tuscany/sca/core/ServiceProxy.h" -#include "tuscany/sca/ws/WSServiceProxy.h" - -namespace tuscany -{ - namespace sca - { - namespace ws - { - - // Constructor - WSReferenceBinding::WSReferenceBinding(Reference* reference, const string& uri, const string& endpoint, const string&version) - : ReferenceBinding(reference, uri), endpoint(endpoint), soapVersion(version) - { - parseEndpoint(); - } - - void WSReferenceBinding::parseEndpoint() - { - // Endpoint is of the form: #wsdl.endpoint(/) - string::size_type hash = endpoint.find("#"); - if (hash != string::npos) - { - // Found a hash - - // Namepace is the part before the # - wsdlNamespaceURL = endpoint.substr(0, hash); - - - if ( (hash+1) < endpoint.length()) - { - // Check the next part is wsdl.endpoint( - int ending = hash+15; - string check = endpoint.substr(hash+1, 14); - if (check.compare("wsdl.endpoint(") == 0) - { - // Find the matching ) - int endBracket = endpoint.find(")",ending); - if (endBracket-1 > ending+1) - { - string serviceAndEndpoint = endpoint.substr(ending, endBracket-ending); - // Look for a '/' - string::size_type slash = serviceAndEndpoint.find("/"); - if (slash != string::npos) - { - serviceName = serviceAndEndpoint.substr(0, slash); - - if ( (slash+1) < serviceAndEndpoint.length()) - { - endpointName = serviceAndEndpoint.substr(slash+1); - } - else - { - endpointName = ""; - } - - } - else - { - // No '/' so all of it is the service name - serviceName = serviceAndEndpoint; - endpointName = ""; - - } - } - else - { - // Nothing between the () - serviceName = ""; - endpointName = ""; - } - } - else - { - // not the correct characters after the #, ignore the rest - serviceName = ""; - endpointName = ""; - } - - } - else - { - // Nothing after the hash - serviceName = ""; - endpointName = ""; - } - } - else - { - // No hash at all - wsdlNamespaceURL = endpoint; - serviceName = ""; - endpointName = ""; - } - } - - // Destructor - WSReferenceBinding::~WSReferenceBinding() - { - } - - void WSReferenceBinding::configure(ServiceBinding *binding) - { - targetServiceBinding = binding; - - serviceProxy = new WSServiceProxy(getReference()); - } - - ServiceProxy* WSReferenceBinding::getServiceProxy() - { - return serviceProxy; - } - - } // End namespace ws - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/model/WSReferenceBinding.h b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/model/WSReferenceBinding.h deleted file mode 100644 index 90e28e326b..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/model/WSReferenceBinding.h +++ /dev/null @@ -1,153 +0,0 @@ -/* - * 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_ws_model_wsreferencebinding_h -#define tuscany_sca_extension_ws_model_wsreferencebinding_h - -#include "tuscany/sca/model/ReferenceBinding.h" - -using namespace tuscany::sca::model; - -#include -using std::string; - -namespace tuscany -{ - namespace sca - { - namespace ws - { - /** - * Information about a web service binding for service or a reference. - */ - class WSReferenceBinding : public ReferenceBinding - { - public: - - /** - * Constructor. - * @param uri The uri of the binding. - * @param endpoint The definition of the endpoint to which the entrypoint - * or external service is to be bound. This is of the form - * "namespace"#endpoint("service"/"endpoint") - */ - WSReferenceBinding(Reference* reference, const string&uri, const string& endpoint, const string& version); - - /** - * Destructor. - */ - virtual ~WSReferenceBinding(); - - /** - * Returns the type of binding. - */ - virtual string getType() { return "http://www.osoa.org/xmlns/sca/1.0#WebServiceBinding"; }; - - /** - * Configure this binding from a service binding. - */ - virtual void configure(ServiceBinding* serviceBinding); - - /** - * Create a proxy representing the reference to the - * client component. - */ - virtual ServiceProxy* getServiceProxy(); - - /** - * Return the part of the endpoint definition describing the wsdl - * namespace. - * @return The wsdl namespace. - */ - string getWSDLNamespaceURL() const { return wsdlNamespaceURL; }; - - /** - * Return the service part of the endpoint definition. - * @return The service to use. - */ - string getServiceName() const { return serviceName; }; - - /** - * Return the endpoint name part of the endpoint definition. - * @return The endpoint name to use. - */ - string getEndpointName() const { return endpointName; }; - - /** - * Return the SOAP version. - * @return The SOAP version to use. - */ - string getSOAPVersion() const { return soapVersion; }; - - /** - * Returns the target service binding. - */ - ServiceBinding* getTargetServiceBinding() const { return targetServiceBinding; }; - - private: - - /** - * Parse the endpoint specification. - */ - void parseEndpoint(); - - /** - * The full endpoint string. - */ - string endpoint; - - /** - * Namespace from the endpoint. - */ - string wsdlNamespaceURL; - - /** - * Service name from the endpoint. - */ - string serviceName; - - /** - * Endpoint name from the endpoint. - */ - string endpointName; - - /** - * SOAP version. - */ - string soapVersion; - - /** - * The proxy representing the reference to the client - * component. - */ - ServiceProxy* serviceProxy; - - /** - * The service binding of the target - */ - ServiceBinding* targetServiceBinding; - }; - - } // End namespace ws - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_extension_ws_model_wsreferencebinding_h diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/deploy.bat b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/deploy.bat deleted file mode 100644 index 0722342b03..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/deploy.bat +++ /dev/null @@ -1,73 +0,0 @@ -@echo off - -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. - - -setlocal - -if . == .%1 ( -echo sca root not specified -goto usage -) -set rootdir=%1 -set deploydir=%rootdir%\deploy -set extdir=%deploydir%\extensions -set wsextdir=%extdir%\ws -set svcextdir=%wsextdir%\service -set svcsdir=%svcextdir%\services -set srcdir=%rootdir%\runtime\extensions\ws\service\axis2c\src - -if . == .%2 ( -echo input directory not specified -goto usage -) -set inpath=%2 -echo %inpath% - -if not exist %deploydir% mkdir %deploydir% -if not exist %extdir% mkdir %extdir% -if not exist %wsextdir% mkdir %wsextdir% -if not exist %svcextdir% mkdir %svcextdir% -if not exist %svcextdir%\bin mkdir %svcextdir%\bin -if not exist %svcextdir%\lib mkdir %svcextdir%\lib - -set libname=tuscany_sca_ws_service - -del %svcextdir%\bin\%libname%.* -del %svcextdir%\lib\%libname%.* - -copy %inpath%\%libname%.lib %svcextdir%\lib -copy %inpath%\%libname%.dll %svcextdir%\bin - -if exist %inpath%\%libname%.pdb copy %inpath%\%libname%.pdb %svcextdir%\bin - -if not exist %svcsdir% mkdir %svcsdir% -if not exist %svcsdir%\tuscany mkdir %svcsdir%\tuscany - -copy %srcdir%\axis2.xml %svcextdir% -copy %srcdir%\deploy.cmd %svcextdir% -copy %srcdir%\services.xml %svcsdir%\tuscany -copy %inpath%\%libname%.dll %svcsdir%\tuscany -if exist %inpath%\%libname%.pdb copy %inpath%\%libname%.pdb %svcsdir%\tuscany - -goto end -:usage -echo Usage: deploy -:end - -endlocal diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/deploymodule.bat b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/deploymodule.bat deleted file mode 100644 index 246728b6b2..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/service/deploymodule.bat +++ /dev/null @@ -1,69 +0,0 @@ -@echo off - -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. - - -setlocal - -if . == .%1 ( -echo sca root not specified -goto usage -) -set rootdir=%1 -set deploydir=%rootdir%\deploy -set extdir=%deploydir%\extensions -set wsextdir=%extdir%\ws -set svcextdir=%wsextdir%\service -set modsdir=%svcextdir%\modules -set srcdir=%rootdir%\runtime\extensions\ws\service\axis2c\src - -if . == .%2 ( -echo input directory not specified -goto usage -) -set inpath=%2 -echo %inpath% - -if not exist %deploydir% mkdir %deploydir% -if not exist %extdir% mkdir %extdir% -if not exist %wsextdir% mkdir %wsextdir% - -set libname=tuscany_sca_ws_dispatcher - -del %svcextdir%\bin\%libname%.* -del %svcextdir%\lib\%libname%.* - -copy %inpath%\%libname%.lib %svcextdir%\lib -copy %inpath%\%libname%.dll %svcextdir%\bin - -if exist %inpath%\%libname%.pdb copy %inpath%\%libname%.pdb %svcextdir%\bin - - -if not exist %modsdir% mkdir %modsdir% -if not exist %modsdir%\tuscany mkdir %modsdir%\tuscany - -copy %srcdir%\module.xml %modsdir%\tuscany -copy %inpath%\%libname%.dll %modsdir%\tuscany -if exist %inpath%\%libname%.pdb copy %inpath%\%libname%.pdb %modsdir%\tuscany - -goto end -:usage -echo Usage: deploy -:end - -endlocal diff --git a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/xsd/sca-binding-webservice.xsd b/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/xsd/sca-binding-webservice.xsd deleted file mode 100644 index 2c1c2abbcc..0000000000 --- a/tags/cpp-1.0-incubating-M2-RC3/sca/runtime/extensions/ws/xsd/sca-binding-webservice.xsd +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- cgit v1.2.3